Skip to content

test: harmonize example custom-ci-build-id to use module API only #1454

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

Merged

Conversation

MikeMcC399
Copy link
Collaborator

@MikeMcC399 MikeMcC399 commented May 2, 2025

Situation

The workflow .github/workflows/example-custom-ci-build-id.yml contains hybrid use of the action, with both Module API and CLI commands beings used.

The job smoke-tests uses regular action parameters

          record: true
          parallel: true
          group: '1 - smoke tests'
          ci-build-id: ${{ needs.prepare.outputs.uuid }}
          spec: 'cypress/e2e/spec-a.cy.js'
          working-directory: examples/recording

The follow-on job all-tests uses the action with a CLI command

          command: |
            npx cypress run --record --parallel \
              --ci-build-id ${{ needs.prepare.outputs.uuid }} \
              --group "2 - all tests"
          working-directory: examples/recording

Assessment

The command parameter uses a CLI command to run the action, which by-passes the Module API.

Best practice is however to use non-command parameters.

Each of the CLI options can be used with action parameters, so there is no necessity to use the command parameter.

Change

  • Convert the all-tests job to use action parameters other than command. Suppress the job summary with publish-summary: false because there are 4 tests load-balanced over 3 containers and the job summary does not consolidate parallel results. Instead, consolidated results can be viewed in Cypress Cloud https://cloud.cypress.io/projects/3tb7jn/runs
          record: true
          parallel: true
          group: '2 - all tests'
          ci-build-id: ${{ needs.prepare.outputs.uuid }}
          publish-summary: false
          working-directory: examples/recording
  • Remove the reference to the outdated blog article from the year 2019.

  • Remove the icons for consistency with other workflows.

  • Reduce all-tests job to 2 parallel containers, as even with 3 containers, load-balancing sometimes uses only 2 containers. The .github/workflows/example-recording.yml workflow, which uses the same examples/recording project, also uses only 2 containers.

@cypress-app-bot
Copy link

@MikeMcC399 MikeMcC399 self-assigned this May 2, 2025
@MikeMcC399 MikeMcC399 marked this pull request as ready for review May 2, 2025 15:09
@jennifer-shehane jennifer-shehane merged commit 41bd6af into cypress-io:master May 2, 2025
75 checks passed
@MikeMcC399 MikeMcC399 deleted the convert/custom-ci-build-id branch May 3, 2025 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants