-
Notifications
You must be signed in to change notification settings - Fork 347
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
cypress-io/github-action
does not distinguish steps.<step_id>.conclusion
from steps.<step_id>.outcome
#964
Comments
If you think there is a bug in I cannot see any use of The example workflow you posted will not display the step outcomes after an error in the previous step in the job occurs. You could add - name: 'Print previous step outcome/conclusion'
if: always() |
The reported observation comes from implementing/testing a workflow to run our Cypress/Cucumber E2E tests. After running the tests, we want to generate a Cucumber HTML report and then upload it together with the screenshots. This must happen regardless of the tests results, has long the step concludes with success. - name: 'Set up steps'
id: setup
run: |
echo "repository=$( echo "${{ github.event.repository.full_name || github.repository }}" )" >> $GITHUB_OUTPUT
echo "repository_owner=$( echo "${{ github.event.repository.owner.name || github.repository_owner }}" )" >> $GITHUB_OUTPUT
echo "repository_name=$( echo "${{ github.event.repository.name }}" )" >> $GITHUB_OUTPUT
echo "branch_ref=$( echo "${{ github.event.ref || github.ref }}" )" >> $GITHUB_OUTPUT
echo "branch_name=$( echo "${{ github.event.ref_name || github.ref_name }}" )" >> $GITHUB_OUTPUT
if [[ ("${{ github.event_name }}" == "workflow_dispatch") && ("${{ github.workflow }}" == "End-to-End Tests") ]]; then
echo "::add-mask::$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-url"?' | sed --regexp-extended --expression 's/\/$//g' )"
echo "::add-mask::$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-username"?' )"
echo "::add-mask::$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-password"?' )"
echo "deployment_url=$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-url"?' | sed --regexp-extended --expression 's/\/$//g' )" >> $GITHUB_OUTPUT
echo "deployment_username=$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-username"?' )" >> $GITHUB_OUTPUT
echo "deployment_password=$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."deployment-password"?' )" >> $GITHUB_OUTPUT
echo "browser=$( cat $GITHUB_EVENT_PATH | jq -e -M -r '.inputs?."browser"?' )" >> $GITHUB_OUTPUT
else
echo "deployment_url=$( echo "${{ secrets.E2E_TESTS_DEPLOYMENT_URL }}" )" >> $GITHUB_OUTPUT
echo "deployment_username=$( echo "${{ secrets.E2E_TESTS_DEPLOYMENT_USERNAME }}-${{ github.event.inputs.browser || inputs.browser }}" )" >> $GITHUB_OUTPUT
echo "deployment_password=$( echo "${{ secrets.E2E_TESTS_DEPLOYMENT_PASSWORD }}" )" >> $GITHUB_OUTPUT
echo "browser=$( echo "${{ github.event.inputs.browser || inputs.browser }}" )" >> $GITHUB_OUTPUT
fi
shell: bash
- name: 'Check out repository'
id: checkout
if: ${{ (success() || failure()) && (steps.setup.outcome == 'success') }}
uses: actions/checkout@v3
with:
ref: '${{ steps.setup.outputs.branch_ref }}'
- name: 'Set up node.js'
id: node
if: ${{ (success() || failure()) && (steps.checkout.outcome == 'success') }}
uses: valispace/actions/setup-node@master
with:
node-version: ${{ vars.NODE_VERSION }}
node-dependencies-file: 'e2e-tests/package-lock.json'
node-install-dependencies: true
- name: 'Install dependencies' # see https://docs.cypress.io/guides/continuous-integration/introduction#Dependencies
id: dependencies
if: ${{ (success() || failure()) && (steps.node.outcome == 'success') }}
run: 'sudo apt-get --quiet --no-install-recommends --assume-yes install libgtk2.0-0 libnotify-dev'
shell: 'bash'
- name: 'Run end-to-end tests'
id: cypress
if: ${{ (success() || failure()) && (steps.dependencies.outcome == 'success') }}
timeout-minutes: 15 # must be adjusted with e2e tests progress
uses: cypress-io/github-action@v5 # see https://github.com/cypress-io/github-action/issues/620
env:
ELECTRON_EXTRA_LAUNCH_ARGS: '--disable-gpu' # see https://github.com/cypress-io/cypress/issues/25357
with:
working-directory: 'e2e-tests'
cache-key: "node-cache-${{ runner.os }}-npm-${{ hashFiles('e2e-tests/package-lock.json') }}" # see https://github.com/cypress-io/github-action/pull/24
command: 'npx cypress run --e2e --browser ${{ steps.setup.outputs.browser }} --headless --config video=false --env host="${{ steps.setup.outputs.deployment_url }}",username="${{ steps.setup.outputs.deployment_username }}",password="${{ steps.setup.outputs.deployment_password }}"' # see https://github.com/cypress-io/github-action/issues/489
browser: '${{ steps.setup.outputs.browser }}'
headed: false
config: 'video=false' # see https://github.com/cypress-io/github-action/issues/483
env: 'host="${{ steps.setup.outputs.deployment_url }}",username="${{ steps.setup.outputs.deployment_username }}",password="${{ steps.setup.outputs.deployment_password }}"'
- name: 'Generate end-to-end tests report'
# if: ${{ (success() || failure()) && (steps.cypress.conclusion == 'success') }} # see https://github.com/cypress-io/github-action/issues/964
if: ${{ (success() || failure()) }}
id: reporter
working-directory: 'e2e-tests'
run: 'node cucumber-html-reporter.mjs'
shell: bash
- name: 'Upload end-to-end tests reports'
id: cucumber-reports
if: ${{ (success() || failure()) && (steps.reporter.outcome == 'success') }}
uses: actions/upload-artifact@v3
with:
name: 'cucumber-reports-${{ steps.setup.outputs.browser }}'
path: 'e2e-tests/cypress/reports/html'
if-no-files-found: ignore
- name: 'Upload end-to-end tests screenshots'
id: cypress-screenshots
if: ${{ (success() || failure()) && (steps.cypress.outcome == 'failure') }}
uses: actions/upload-artifact@v3
with:
name: 'cypress-screenshots-${{ steps.setup.outputs.browser }}'
path: 'e2e-tests/cypress/screenshots'
if-no-files-found: ignore
You are right, I did not include it because we are not using it and also for simplicity of the example.
I don't have the same interpretation...
True! That's why we are using You can find a good discussion about
Right! Should have added the |
I observed the following when I tried this out (without using
This agrees with the 'steps' context documentation, which describes how GitHub's actions/runner sets the values Your original post said "As long (as) cypress-io/github-action completes with success, it should report steps.cypress.conclusion=success." and this is exactly what I see. In the screenshots you posted, the job
A Again, if you think there is a bug, then a simple reproducible example together with logs would be extremely helpful. |
To my understanding, the table, regardless of
The property used in the next step conditional, depending on
Notice that we are not using
Screenshots with failing Cypress tests: Screenshots without failing Cypress tests: Screenshots with failing Cypress tests and Notice that all steps are marked as passed, although there are failing tests, hence this discussion about
Shouldn't the action produce the step summary, even when the tests fail?
The workflow, although not accompanied of the tests, is my example. |
I tested using the regular way of using
Using |
I'm sorry, but even after testing using the |
I'm trying to use the Using the I don't have the full picture and probably someone has a case for using the |
|
Is there anything else can work with Percy if |
|
The release of |
Your original problem description talks about status results which are set by the GitHub https://github.com/actions/runner software and documented in GitHub Actions > Learn GitHub Actions > Contexts > This may no longer be a problem for you, however if it is still an issue, then it is not something which ResourcesHere are other resource locations which might be helpful to you in case you need further assistance: |
Closing, as previously suggested. |
Given the following configuration, when one of the tests fails both
steps.cypress.conclusion
andsteps.cypress.outcome
reportfailure
, thus contradicting the documentation.As long
cypress-io/github-action
completes with success, it should reportsteps.cypress.conclusion=success
.This may be related to the use of a custom command.
The text was updated successfully, but these errors were encountered: