Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix workflow to update screenshots #4993

Merged
merged 2 commits into from
Feb 23, 2023
Merged

Conversation

joeyparrish
Copy link
Member

The initial commit was untested, but having the workflow in the main branch allowed me to iterate on the workflow and test it in a branch.

The following changes were made:

  • Standardize how workflow inputs are read (using inputs, which works for all triggers, instead of github.event.inputs, which only works for some triggers)
  • Improve the description of test_filter in selenium-lab-tests.
  • Add missing fields in the workflow_call trigger of selenium-lab-tests.yaml. (Unfortunately, the two triggers need to have the inputs defined separately, and with slightly different fields.)
  • Log the chosen ref in selenium-lab-tests, to help debug inputs.
  • Fix variable expansion in selenium-lab-tests so that test_filter can contain spaces.
  • Fix ignore_test_status, which did not work at all and broken the nightly tests last night.
  • Fix dependencies between jobs in update-screenshots.
  • Do not set status for the subordinate selenium-lab-tests job if started from update-screenshots.
  • Always upload screenshots from selenium-lab-tests if started from update-screenshots (normally only uploaded on failure).
  • Set the PR status from upload-screenshots.
  • Fix unpacking of screenshots from artifacts in upload-screenshots.
  • Fix updating of changed screenshots.
  • Fix handling of a lack of screenshot changes.
  • Split up the jobs for easier debugging in upload-screenshots.

Still to do:

  • Fix setting of final PR status
  • Use a personal access token so that tests can be triggered from the PR push

The initial commit was untested, but having the workflow in the main
branch allowed me to iterate on the workflow and test it in a branch.

The following changes were made:
 - Standardize how workflow inputs are read (using inputs, which works
   for all triggers, instead of github.event.inputs, which only works
   for some triggers)
 - Improve the description of test_filter in selenium-lab-tests.
 - Add missing fields in the workflow_call trigger of
   selenium-lab-tests.yaml.  (Unfortunately, the two triggers need to
   have the inputs defined separately, and with slightly different
   fields.)
 - Log the chosen ref in selenium-lab-tests, to help debug inputs.
 - Fix variable expansion in selenium-lab-tests so that test_filter
   can contain spaces.
 - Fix ignore_test_status, which did not work at all and broken the
   nightly tests last night.
 - Fix dependencies between jobs in update-screenshots.
 - Do not set status for the subordinate selenium-lab-tests job if
   started from update-screenshots.
 - Always upload screenshots from selenium-lab-tests if started from
   update-screenshots (normally only uploaded on failure).
 - Set the PR status from upload-screenshots.
 - Fix unpacking of screenshots from artifacts in upload-screenshots.
 - Fix updating of changed screenshots.
 - Fix handling of a lack of screenshot changes.
 - Split up the jobs for easier debugging in upload-screenshots.

Still to do:
 - Fix setting of final PR status
 - Use a personal access token so that tests can be triggered from the
   PR push
@joeyparrish joeyparrish added the type: CI An issue with our continuous integration tests label Feb 10, 2023
@github-actions
Copy link
Contributor

Incremental code coverage: No instrumented code was changed.

avelad
avelad previously approved these changes Feb 11, 2023
@@ -269,7 +290,7 @@ jobs:
# Upload new screenshots and diffs on failure; ignore if missing
- name: Upload screenshots
uses: actions/upload-artifact@v3
if: ${{ failure() }}
if: ${{ failure() || inputs.ignore_test_status }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description of ignore_test_status says "If true, ignore test failures and treat the workflow as a success"
However, this seems to be treating the workflow as a failure. Is the description inaccurate?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means the job runs on failure, or if ignore_test_status is true. Normally, we would only upload screenshot artifacts if the tests failed. But if we're running the workflow specifically to get the screenshots updated, we upload them no matter what.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment updated. ignore_test_status modifies many things that normally depend on test status.

@@ -197,25 +204,28 @@ jobs:
# the container.
- name: Test Player
run: |
# Use of an array keeps elements in tact, and allows an element to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"in tact" -> "intact"
Unless you're saying that using an array makes the elements remain tactful and sensitive.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

ref: refs/pull/${{ github.event.inputs.pr }}/head
ref: refs/pull/${{ inputs.pr }}/head

- name: Set commit status to pending
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Say, the first two steps of this workflow are the exact same as the steps of set-pending-status.
This needs run-lab-tests, which needs set-pending-status.
So shouldn't set-pending-status have already been run by the time this is run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, those are separate jobs. Each job runs with a clean slate. You're thinking of "steps" within jobs. Calling another workflow (run-lab-tests) requires its own job. So the jobs are: 1. Set pending status, 2. run test workflow, 3. update PR, 4. set final status

@joeyparrish joeyparrish merged commit 25fc81e into main Feb 23, 2023
@joeyparrish joeyparrish deleted the update-screenshots-workflow branch February 23, 2023 19:26
joeyparrish added a commit that referenced this pull request Mar 1, 2023
The initial commit was untested, but having the workflow in the main
branch allowed me to iterate on the workflow and test it in a branch.

The following changes were made:
- Standardize how workflow inputs are read (using inputs, which works
for all triggers, instead of github.event.inputs, which only works for
some triggers)
 - Improve the description of test_filter in selenium-lab-tests.
- Add missing fields in the workflow_call trigger of
selenium-lab-tests.yaml. (Unfortunately, the two triggers need to have
the inputs defined separately, and with slightly different fields.)
 - Log the chosen ref in selenium-lab-tests, to help debug inputs.
- Fix variable expansion in selenium-lab-tests so that test_filter can
contain spaces.
- Fix ignore_test_status, which did not work at all and broken the
nightly tests last night.
 - Fix dependencies between jobs in update-screenshots.
- Do not set status for the subordinate selenium-lab-tests job if
started from update-screenshots.
- Always upload screenshots from selenium-lab-tests if started from
update-screenshots (normally only uploaded on failure).
 - Set the PR status from upload-screenshots.
 - Fix unpacking of screenshots from artifacts in upload-screenshots.
 - Fix updating of changed screenshots.
 - Fix handling of a lack of screenshot changes.
 - Split up the jobs for easier debugging in upload-screenshots.

Still to do:
 - Fix setting of final PR status
- Use a personal access token so that tests can be triggered from the PR
push
joeyparrish added a commit that referenced this pull request Mar 1, 2023
The initial commit was untested, but having the workflow in the main
branch allowed me to iterate on the workflow and test it in a branch.

The following changes were made:
- Standardize how workflow inputs are read (using inputs, which works
for all triggers, instead of github.event.inputs, which only works for
some triggers)
 - Improve the description of test_filter in selenium-lab-tests.
- Add missing fields in the workflow_call trigger of
selenium-lab-tests.yaml. (Unfortunately, the two triggers need to have
the inputs defined separately, and with slightly different fields.)
 - Log the chosen ref in selenium-lab-tests, to help debug inputs.
- Fix variable expansion in selenium-lab-tests so that test_filter can
contain spaces.
- Fix ignore_test_status, which did not work at all and broken the
nightly tests last night.
 - Fix dependencies between jobs in update-screenshots.
- Do not set status for the subordinate selenium-lab-tests job if
started from update-screenshots.
- Always upload screenshots from selenium-lab-tests if started from
update-screenshots (normally only uploaded on failure).
 - Set the PR status from upload-screenshots.
 - Fix unpacking of screenshots from artifacts in upload-screenshots.
 - Fix updating of changed screenshots.
 - Fix handling of a lack of screenshot changes.
 - Split up the jobs for easier debugging in upload-screenshots.

Still to do:
 - Fix setting of final PR status
- Use a personal access token so that tests can be triggered from the PR
push
joeyparrish added a commit that referenced this pull request Mar 1, 2023
The initial commit was untested, but having the workflow in the main
branch allowed me to iterate on the workflow and test it in a branch.

The following changes were made:
- Standardize how workflow inputs are read (using inputs, which works
for all triggers, instead of github.event.inputs, which only works for
some triggers)
 - Improve the description of test_filter in selenium-lab-tests.
- Add missing fields in the workflow_call trigger of
selenium-lab-tests.yaml. (Unfortunately, the two triggers need to have
the inputs defined separately, and with slightly different fields.)
 - Log the chosen ref in selenium-lab-tests, to help debug inputs.
- Fix variable expansion in selenium-lab-tests so that test_filter can
contain spaces.
- Fix ignore_test_status, which did not work at all and broken the
nightly tests last night.
 - Fix dependencies between jobs in update-screenshots.
- Do not set status for the subordinate selenium-lab-tests job if
started from update-screenshots.
- Always upload screenshots from selenium-lab-tests if started from
update-screenshots (normally only uploaded on failure).
 - Set the PR status from upload-screenshots.
 - Fix unpacking of screenshots from artifacts in upload-screenshots.
 - Fix updating of changed screenshots.
 - Fix handling of a lack of screenshot changes.
 - Split up the jobs for easier debugging in upload-screenshots.

Still to do:
 - Fix setting of final PR status
- Use a personal access token so that tests can be triggered from the PR
push
joeyparrish added a commit that referenced this pull request Mar 2, 2023
The initial commit was untested, but having the workflow in the main
branch allowed me to iterate on the workflow and test it in a branch.

The following changes were made:
- Standardize how workflow inputs are read (using inputs, which works
for all triggers, instead of github.event.inputs, which only works for
some triggers)
 - Improve the description of test_filter in selenium-lab-tests.
- Add missing fields in the workflow_call trigger of
selenium-lab-tests.yaml. (Unfortunately, the two triggers need to have
the inputs defined separately, and with slightly different fields.)
 - Log the chosen ref in selenium-lab-tests, to help debug inputs.
- Fix variable expansion in selenium-lab-tests so that test_filter can
contain spaces.
- Fix ignore_test_status, which did not work at all and broken the
nightly tests last night.
 - Fix dependencies between jobs in update-screenshots.
- Do not set status for the subordinate selenium-lab-tests job if
started from update-screenshots.
- Always upload screenshots from selenium-lab-tests if started from
update-screenshots (normally only uploaded on failure).
 - Set the PR status from upload-screenshots.
 - Fix unpacking of screenshots from artifacts in upload-screenshots.
 - Fix updating of changed screenshots.
 - Fix handling of a lack of screenshot changes.
 - Split up the jobs for easier debugging in upload-screenshots.

Still to do:
 - Fix setting of final PR status
- Use a personal access token so that tests can be triggered from the PR
push
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: CI An issue with our continuous integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants