From 15c36065cab1d7dd3fa6213144ca442509cbca53 Mon Sep 17 00:00:00 2001 From: KHeo Date: Mon, 27 Jun 2022 15:08:32 +0900 Subject: [PATCH] test distribut-step fix error fix fix test TEST --- circle.yml | 56 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/circle.yml b/circle.yml index d298b15ecf28..3686ba0d9166 100644 --- a/circle.yml +++ b/circle.yml @@ -366,13 +366,45 @@ commands: ## * https://unix.stackexchange.com/questions/43945/whats-the-difference-between-various-term-variables command: yarn check-terminal - print-ci-settings: + distribute-test-files-for-external-contributors: + parameters: + package: + description: package to target + type: enum + enum: ['frontend-shared', 'launchpad', 'app', 'reporter', 'driver'] + type: + description: ct or e2e + type: enum + enum: ['ct', 'e2e'] steps: - run: + name: Distribute test files for external contributors. command: | echo Current working directory is $PWD echo Total containers $CIRCLE_NODE_TOTAL + if ! [[ -v MAIN_RECORD_KEY ]]; then + # To make `circleci tests` work correctly, we need to step into the package folder. + cd packages/<> + + GLOB="cypress/e2e/**/*cy.*" + + if [[ <> == 'ct' ]]; then + # component tests are located side by side with the source codes. + GLOB="src/**/*cy.*" + fi + + echo "export TESTFILES=$(circleci tests glob \"$GLOB\" | circleci tests split --total=$CIRCLE_NODE_TOTAL)" >> $BASH_ENV + echo "Test files for this machine are $TESTFILES" + + if [[ -z "$TESTFILES" ]]; then + echo "Empty list of test files" + fi + + # To run the `yarn` command, we need to walk out of the package folder. + cd ../.. + fi + install-required-node: # https://discuss.circleci.com/t/switch-nodejs-version-on-machine-executor-solved/26675/2 description: Install Node version matching .node-version @@ -444,7 +476,6 @@ commands: - install-chrome: channel: <> version: $(node ./scripts/get-browser-version.js chrome:<>) - - print-ci-settings - run: environment: CYPRESS_KONFIG_ENV: production @@ -519,7 +550,9 @@ commands: - restore_cached_workspace - windows-install-chrome: browser: <> - - print-ci-settings + - distribute-test-files-for-external-contributors: + package: <> + type: <> - run: command: | if [[ -v MAIN_RECORD_KEY ]]; then @@ -534,23 +567,6 @@ commands: $cmd yarn workspace @packages/<> cypress:run:<> --browser <> --record --parallel --group <>-<> else # external PR - - # To make `circleci tests` work correctly, we need to step into the package folder. - cd packages/<> - - GLOB="cypress/e2e/**/*cy.*" - - if [[ <> == '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=<> \ CYPRESS_KONFIG_ENV=production \ PERCY_PARALLEL_NONCE=$CIRCLE_SHA1 \