diff --git a/.circleci/config.yml b/.circleci/config.yml index 3f4c45eb2f..e0e3eec57f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,7 +81,9 @@ jobs: type: string group: type: string - parallelism: 95 + groupsize: + type: number + parallelism: 10 steps: - browser-tools/install-browser-tools - run: @@ -111,7 +113,7 @@ jobs: name: Start Selenium command: java -jar /usr/local/bin/selenium.jar background: true - - run: ./apps/remix-ide/ci/<< parameters.script >> << parameters.browser >> << parameters.group >> + - run: ./apps/remix-ide/ci/<< parameters.script >> << parameters.browser >> << parameters.grousize >> << parameters.group >> - store_test_results: path: ./reports/tests - store_artifacts: @@ -245,6 +247,7 @@ workflows: browser: ["chrome", "firefox"] script: ["flaky.sh"] group: ["nogroup"] + groupsize: [1] build_all: unless: << pipeline.parameters.run_flaky_tests >> jobs: @@ -269,7 +272,8 @@ workflows: parts: ["1"] browser: ["chrome", "firefox"] script: ["browser_test.sh"] - group: ["a-c","d-f","g-m","n-r","s","t-z"] + group: ["0","1","2","3","4","5","6"] + groupsize: [7] - deploy-remix-live: requires: - lint diff --git a/apps/remix-ide/ci/browser_test.sh b/apps/remix-ide/ci/browser_test.sh index 469026f05d..70b5a82b32 100755 --- a/apps/remix-ide/ci/browser_test.sh +++ b/apps/remix-ide/ci/browser_test.sh @@ -16,8 +16,10 @@ yarn run remixd & sleep 5 yarn run build:e2e -grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[${2}]" -TESTFILES=$(grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[$2]" | circleci tests split --split-by=timings ) +# grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[${2}]" +# TESTFILES=$(grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests" | grep "\.spec\|\.test" | xargs -I {} basename {} .test.js | grep -E "\b[$2]" | circleci tests split --split-by=timings ) +node apps/remix-ide/ci/splice_tests.js $2 $3 +TESTFILES = $(node apps/remix-ide/ci/splice_tests.js 10 $2 $3 | circleci tests split --split-by=timings) for TESTFILE in $TESTFILES; do npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/${TESTFILE}.test.js --env=$1 || TEST_EXITCODE=1 done diff --git a/apps/remix-ide/ci/splice_tests.js b/apps/remix-ide/ci/splice_tests.js new file mode 100644 index 0000000000..7e2e48f7ff --- /dev/null +++ b/apps/remix-ide/ci/splice_tests.js @@ -0,0 +1,27 @@ +const fs = require('fs') +var exec = require('child_process').exec; +let cmd = `grep -IRiL "@disabled" "dist/apps/remix-ide-e2e/src/tests"` +// get command line arguments +let args = process.argv.slice(2) + +const grouplength = args[0] || 10; +const group = args[1] || 0; +exec(cmd, (error, stdout, stderr) => { + if (error) { + console.error(`error: ${error.message}`); + return; + } + + if (stderr) { + console.error(`stderr: ${stderr}`); + return; + } + + let files = stdout.split('\n').filter(f => f.includes('.test')).map(f => f.replace('dist/apps/remix-ide-e2e/src/tests/', '')).map(f => f.replace('.js', '')) + let splitIndex = Math.ceil(files.length / grouplength); + const parts = [] + for (let i = 0; i < grouplength; i++) { + parts.push(files.slice(i * splitIndex, (i + 1) * splitIndex)) + } + console.log(parts[group].join('\n')) + });