Skip to content

Commit

Permalink
fix: distribute files to machines for external contributors. (#22326)
Browse files Browse the repository at this point in the history
* fix: distribute files to machines for external contributors.

* fix path

* fix

* fix glob

* fix

* fix glob pattern spec->cy.

* fix

* echo things.

* test

* use cd.

* fix component tests.

* test

* test

* fix

* refactor

* test distribut-step

fix error
fix
fix
test
TEST

* Revert "test distribut-step"

This reverts commit 15c3606.

* Revert "refactor"

This reverts commit 21a8ad9.

* reduce flake by increasing viewport height

Co-authored-by: Ryan Manuel <ryanm@cypress.io>
Co-authored-by: Lachlan Miller <lachlan.miller.1990@outlook.com>
  • Loading branch information
3 people authored Jun 27, 2022
1 parent 4726ea9 commit 9101a90
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 9 deletions.
47 changes: 39 additions & 8 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -528,14 +528,45 @@ commands:
browser: <<parameters.browser>>
- run:
command: |
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
DEBUG=<<parameters.debug>> \
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=${TEST_LAUNCHPAD_RECORD_KEY:-$MAIN_RECORD_KEY} \
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
$cmd yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
echo Current working directory is $PWD
echo Total containers $CIRCLE_NODE_TOTAL
if [[ -v MAIN_RECORD_KEY ]]; then
# internal PR
cmd=$([[ <<parameters.percy>> == 'true' ]] && echo 'yarn percy exec --parallel -- --') || true
DEBUG=<<parameters.debug>> \
CYPRESS_KONFIG_ENV=production \
CYPRESS_RECORD_KEY=${TEST_LAUNCHPAD_RECORD_KEY:-$MAIN_RECORD_KEY} \
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
$cmd yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --record --parallel --group <<parameters.package>>-<<parameters.type>>
else
# external PR
# To make `circleci tests` work correctly, we need to step into the package folder.
cd packages/<<parameters.package>>
GLOB="cypress/e2e/**/*cy.*"
if [[ <<parameters.type>> == 'ct' ]]; then
# component tests are located side by side with the source codes.
GLOB="src/**/*cy.*"
fi
TESTFILES=$(circleci tests glob "$GLOB" | circleci tests split --total=$CIRCLE_NODE_TOTAL)
echo "Test files for this machine are $TESTFILES"
# To run the `yarn` command, we need to walk out of the package folder.
cd ../..
DEBUG=<<parameters.debug>> \
CYPRESS_KONFIG_ENV=production \
PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \
PERCY_ENABLE=${PERCY_TOKEN:-0} \
PERCY_PARALLEL_TOTAL=-1 \
yarn workspace @packages/<<parameters.package>> cypress:run:<<parameters.type>> --browser <<parameters.browser>> --spec $TESTFILES
fi
- run:
command: |
if [[ <<parameters.package>> == 'app' && <<parameters.percy>> == 'true' && -d "packages/app/cypress/screenshots/runner/screenshot/screenshot.cy.tsx/percy" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion packages/app/cypress/e2e/specs.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe('App: Specs', () => {

const expectedScaffoldPathsForPlatform = expectedScaffoldPaths.map(getPathForPlatform)

it('scaffolds example files when card is clicked', () => {
it('scaffolds example files when card is clicked', { viewportHeight: 1200 }, () => {
cy.get('@ScaffoldCard').click()

cy.findByRole('dialog', {
Expand Down

5 comments on commit 9101a90

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9101a90 Jun 27, 2022

Choose a reason for hiding this comment

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

Circle has built the linux x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.0/linux-x64/develop-9101a9066c44fa2bb5bcbca64351c30cb5457cae/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9101a90 Jun 27, 2022

Choose a reason for hiding this comment

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

Circle has built the linux arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.0/linux-arm64/develop-9101a9066c44fa2bb5bcbca64351c30cb5457cae/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9101a90 Jun 27, 2022

Choose a reason for hiding this comment

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

Circle has built the darwin arm64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.0/darwin-arm64/develop-9101a9066c44fa2bb5bcbca64351c30cb5457cae/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9101a90 Jun 27, 2022

Choose a reason for hiding this comment

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

Circle has built the darwin x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.0/darwin-x64/develop-9101a9066c44fa2bb5bcbca64351c30cb5457cae/cypress.tgz

@cypress-bot
Copy link
Contributor

@cypress-bot cypress-bot bot commented on 9101a90 Jun 28, 2022

Choose a reason for hiding this comment

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

Circle has built the win32 x64 version of the Test Runner.

Learn more about this pre-release platform-specific build at https://on.cypress.io/installing-cypress#Install-pre-release-version.

Run this command to install the pre-release locally:

npm install https://cdn.cypress.io/beta/npm/10.3.0/win32-x64/develop-9101a9066c44fa2bb5bcbca64351c30cb5457cae/cypress.tgz

Please sign in to comment.