diff --git a/.circleci/config.yml b/.circleci/config.yml index f79efe9275..b664f08ba7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -640,7 +640,7 @@ jobs: type: string jobsize: type: string - parallelism: 15 + parallelism: << parameters.parallelism >> steps: - checkout - attach_workspace: @@ -781,6 +781,20 @@ workflows: script: ["flaky.sh"] job: ["nogroup"] jobsize: ["1"] + parallelism: 10 + run_flaky_tests: + jobs: + - build + - remix-ide-browser: + requires: + - build + matrix: + parameters: + browser: ["chrome"] + script: ["metamask.sh"] + job: ["nogroup"] + jobsize: ["1"] + parallelism: 1 build_all: unless: << pipeline.parameters.run_flaky_tests >> jobs: @@ -867,6 +881,7 @@ workflows: script: ["browser_test.sh"] job: ["0","1","2","3","4","5","6","7","8","9"] jobsize: ["10"] + parallelism: 15 - tests-passed: requires: - lint diff --git a/apps/remix-ide/ci/browser_test.sh b/apps/remix-ide/ci/browser_test.sh index 8af369b567..ed1e968109 100755 --- a/apps/remix-ide/ci/browser_test.sh +++ b/apps/remix-ide/ci/browser_test.sh @@ -15,7 +15,7 @@ sleep 5 # 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 $2 $3 | circleci tests split --split-by=timings) +TESTFILES=$(node apps/remix-ide/ci/splice_tests.js $2 $3 | grep -v 'metamask' | circleci tests split --split-by=timings) for TESTFILE in $TESTFILES; do npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch-${1}.js dist/apps/remix-ide-e2e/src/tests/${TESTFILE}.js --env=$1 || npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch-${1}.js dist/apps/remix-ide-e2e/src/tests/${TESTFILE}.js --env=$1 || TEST_EXITCODE=1 done diff --git a/apps/remix-ide/ci/metamask.sh b/apps/remix-ide/ci/metamask.sh new file mode 100755 index 0000000000..8e29c876f1 --- /dev/null +++ b/apps/remix-ide/ci/metamask.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +set -e + +TESTFILES=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "metamask" | sort ) + +# count test files +fileCount=$(grep -IRiL "\'@disabled\': \?true" "dist/apps/remix-ide-e2e/src/tests" | grep "metamask" | wc -l ) +# if fileCount is 0 +if [ $fileCount -eq 0 ] +then + echo "No metamask tests found" + exit 0 +fi + +BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} +echo "$BUILD_ID" +TEST_EXITCODE=0 + +npx ganache & +npx http-server -p 9090 --cors='*' ./node_modules & +yarn run serve:production & +sleep 5 + +for TESTFILE in $TESTFILES; do + npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch-${1}.js $TESTFILE --env=$1 || TEST_EXITCODE=1 +done + +echo "$TEST_EXITCODE" +if [ "$TEST_EXITCODE" -eq 1 ] +then + exit 1 +fi