From 6c497d07219a70eae5198600b86eafe6eed1ad3a Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Fri, 26 Mar 2021 13:26:52 +0100 Subject: [PATCH] Split ci builds --- .circleci/config.yml | 152 +++++++++++++++--- .../{ballot_0_4_11 => ballot_0_4_11.spec.ts} | 0 ...ts_chrome.sh => browser_tests_chrome_1.sh} | 0 apps/remix-ide/ci/browser_tests_chrome_2.sh | 27 ++++ ..._firefox.sh => browser_tests_firefox_1.sh} | 0 apps/remix-ide/ci/browser_tests_firefox_2.sh | 27 ++++ package.json | 2 +- 7 files changed, 182 insertions(+), 26 deletions(-) rename apps/remix-ide-e2e/src/tests/{ballot_0_4_11 => ballot_0_4_11.spec.ts} (100%) rename apps/remix-ide/ci/{browser_tests_chrome.sh => browser_tests_chrome_1.sh} (100%) create mode 100755 apps/remix-ide/ci/browser_tests_chrome_2.sh rename apps/remix-ide/ci/{browser_tests_firefox.sh => browser_tests_firefox_1.sh} (100%) create mode 100755 apps/remix-ide/ci/browser_tests_firefox_2.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index f5e5e4bb1d..c19a9d10ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ # version: 2 jobs: - remix-libs: + lint: docker: # specify the version you desire here - image: circleci/node:10.18.0-browsers @@ -23,10 +23,31 @@ jobs: - checkout - run: npm install - run: npm run lint:libs + - run: npm run lint + - run: npm run lint remix-ide-e2e + + remix-libs: + docker: + # specify the version you desire here + - image: circleci/node:10.18.0-browsers + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + resource_class: xlarge + # - image: circleci/mongo:3.4.4 + environment: + - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" + - COMMIT_AUTHOR: "Circle CI" + working_directory: ~/remix-project + + steps: + - checkout + - run: npm install - run: npm run build:libs - run: npm run test:libs - remix-ide-chrome: + remix-ide-chrome-1: docker: # specify the version you desire here - image: circleci/node:10.18.0-browsers @@ -39,15 +60,12 @@ jobs: environment: - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" - COMMIT_AUTHOR: "Circle CI" - - FILES_TO_PACKAGE: "dist/apps/remix-ide/assets dist/apps/remix-ide/index.html dist/apps/remix-ide/main.js dist/apps/remix-ide/polyfills.js dist/apps/remix-ide/runtime.js dist/apps/remix-ide/vendor.js dist/apps/remix-ide/favicon.ico" working_directory: ~/remix-project parallelism: 20 steps: - checkout - run: npm install - - run: npm run lint - - run: npm run lint remix-ide-e2e - run: npm run build:libs - run: npm run build - run: @@ -57,13 +75,47 @@ jobs: name: Start Selenium command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com background: true - - run: ./apps/remix-ide/ci/browser_tests_chrome.sh + - run: ./apps/remix-ide/ci/browser_tests_chrome_1.sh - store_test_results: path: ./reports/tests - store_artifacts: path: ./reports/screenshots - remix-ide-firefox: + remix-ide-chrome-2: + docker: + # specify the version you desire here + - image: circleci/node:10.18.0-browsers + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + resource_class: xlarge + # - image: circleci/mongo:3.4.4 + environment: + - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" + - COMMIT_AUTHOR: "Circle CI" + working_directory: ~/remix-project + + parallelism: 20 + steps: + - checkout + - run: npm install + - run: npm run build:libs + - run: npm run build + - run: + name: Download Selenium + command: ./node_modules/.bin/selenium-standalone install --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com + - run: + name: Start Selenium + command: ./node_modules/.bin/selenium-standalone start --drivers.chrome.version=2.39 --drivers.chrome.baseURL=https://chromedriver.storage.googleapis.com + background: true + - run: ./apps/remix-ide/ci/browser_tests_chrome_2.sh + - store_test_results: + path: ./reports/tests + - store_artifacts: + path: ./reports/screenshots + + remix-ide-firefox-1: docker: # specify the version you desire here - image: circleci/node:10.18.0-browsers @@ -76,15 +128,12 @@ jobs: environment: - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" - COMMIT_AUTHOR: "Circle CI" - - FILES_TO_PACKAGE: "dist/apps/remix-ide/assets dist/apps/remix-ide/index.html dist/apps/remix-ide/main.js dist/apps/remix-ide/polyfills.js dist/apps/remix-ide/runtime.js dist/apps/remix-ide/vendor.js dist/apps/remix-ide/favicon.ico" working_directory: ~/remix-project parallelism: 20 steps: - checkout - run: npm install - - run: npm run lint - - run: npm run lint remix-ide-e2e - run: npm run build:libs - run: npm run build - run: @@ -100,7 +149,47 @@ jobs: - run: name: Install Firefox command: sudo dpkg -i firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb - - run: ./apps/remix-ide/ci/browser_tests_firefox.sh + - run: ./apps/remix-ide/ci/browser_tests_firefox_1.sh + - store_test_results: + path: ./reports/tests + - store_artifacts: + path: ./reports/screenshots + + remix-ide-firefox-2: + docker: + # specify the version you desire here + - image: circleci/node:10.18.0-browsers + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + resource_class: xlarge + # - image: circleci/mongo:3.4.4 + environment: + - COMMIT_AUTHOR_EMAIL: "yann@ethereum.org" + - COMMIT_AUTHOR: "Circle CI" + working_directory: ~/remix-project + + parallelism: 20 + steps: + - checkout + - run: npm install + - run: npm run build:libs + - run: npm run build + - run: + name: Download Selenium + command: ./node_modules/.bin/selenium-standalone install --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js + - run: + name: Start Selenium + command: ./node_modules/.bin/selenium-standalone start --config=../remix-project/apps/remix-ide-e2e/seleniumConfig.js + background: true + - run: + name: Download Latest Firefox + command: sudo apt-get purge -y firefox && wget https://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb + - run: + name: Install Firefox + command: sudo dpkg -i firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb + - run: ./apps/remix-ide/ci/browser_tests_firefox_2.sh - store_test_results: path: ./reports/tests - store_artifacts: @@ -125,8 +214,6 @@ jobs: steps: - checkout - run: npm install - - run: npm run lint - - run: npm run lint remix-ide-e2e - run: npm run build:libs - run: npm run build - run: @@ -162,7 +249,6 @@ jobs: steps: - checkout - run: npm install - - run: npm run lint - run: npm run build:libs - run: npm run build - run: @@ -246,7 +332,6 @@ jobs: steps: - checkout - run: npm install - - run: npm run lint - run: npm run build:libs - run: npm run build - run: @@ -260,11 +345,20 @@ workflows: version: 2 build_all: jobs: + - lint - remix-libs - - remix-ide-chrome: + requires: + - lint + - remix-ide-chrome-1: + requires: + - remix-libs + - remix-ide-chrome-2: + requires: + - remix-libs + - remix-ide-firefox-1: requires: - remix-libs - - remix-ide-firefox: + - remix-ide-firefox-2: requires: - remix-libs - remix-ide-run-deploy: @@ -272,29 +366,37 @@ workflows: - remix-libs - publish: requires: - - remix-ide-chrome - - remix-ide-firefox + - remix-ide-chrome-1 + - remix-ide-chrome-2 + - remix-ide-firefox-1 + - remix-ide-firefox-2 - remix-ide-run-deploy - deploy-remix-live: requires: - - remix-ide-chrome - - remix-ide-firefox + - remix-ide-chrome-1 + - remix-ide-chrome-2 + - remix-ide-firefox-1 + - remix-ide-firefox-2 - remix-ide-run-deploy filters: branches: only: remix_live - deploy-remix-alpha: requires: - - remix-ide-chrome - - remix-ide-firefox + - remix-ide-chrome-1 + - remix-ide-chrome-2 + - remix-ide-firefox-1 + - remix-ide-firefox-2 - remix-ide-run-deploy filters: branches: only: master - deploy-remix-beta: requires: - - remix-ide-chrome - - remix-ide-firefox + - remix-ide-chrome-1 + - remix-ide-chrome-2 + - remix-ide-firefox-1 + - remix-ide-firefox-2 - remix-ide-run-deploy filters: branches: diff --git a/apps/remix-ide-e2e/src/tests/ballot_0_4_11 b/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts similarity index 100% rename from apps/remix-ide-e2e/src/tests/ballot_0_4_11 rename to apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.ts diff --git a/apps/remix-ide/ci/browser_tests_chrome.sh b/apps/remix-ide/ci/browser_tests_chrome_1.sh similarity index 100% rename from apps/remix-ide/ci/browser_tests_chrome.sh rename to apps/remix-ide/ci/browser_tests_chrome_1.sh diff --git a/apps/remix-ide/ci/browser_tests_chrome_2.sh b/apps/remix-ide/ci/browser_tests_chrome_2.sh new file mode 100755 index 0000000000..003578e173 --- /dev/null +++ b/apps/remix-ide/ci/browser_tests_chrome_2.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e + +BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} +echo "$BUILD_ID" +TEST_EXITCODE=0 + +npm run ganache-cli & +npm run serve & +echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' & +npm run remixd & + +sleep 5 + +npm run build:e2e + +TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.spec.js" | circleci tests split --split-by=timings) +for TESTFILE in $TESTFILES; do + npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=chrome || TEST_EXITCODE=1 +done + +echo "$TEST_EXITCODE" +if [ "$TEST_EXITCODE" -eq 1 ] +then + exit 1 +fi diff --git a/apps/remix-ide/ci/browser_tests_firefox.sh b/apps/remix-ide/ci/browser_tests_firefox_1.sh similarity index 100% rename from apps/remix-ide/ci/browser_tests_firefox.sh rename to apps/remix-ide/ci/browser_tests_firefox_1.sh diff --git a/apps/remix-ide/ci/browser_tests_firefox_2.sh b/apps/remix-ide/ci/browser_tests_firefox_2.sh new file mode 100755 index 0000000000..45d6553db3 --- /dev/null +++ b/apps/remix-ide/ci/browser_tests_firefox_2.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e + +BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} +echo "$BUILD_ID" +TEST_EXITCODE=0 + +npm run ganache-cli & +npm run serve & +echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' & +npm run remixd & + +sleep 5 + +npm run build:e2e + +TESTFILES=$(circleci tests glob "dist/apps/remix-ide-e2e/src/tests/**/*.spec.js" | circleci tests split --split-by=timings) +for TESTFILE in $TESTFILES; do + npx nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js $TESTFILE --env=firefox || TEST_EXITCODE=1 +done + +echo "$TEST_EXITCODE" +if [ "$TEST_EXITCODE" -eq 1 ] +then + exit 1 +fi diff --git a/package.json b/package.json index 5180840e01..57279fa5a3 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "nightwatch_local_firefox": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=firefox", "nightwatch_local_chrome": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js --env=chrome", "nightwatch_local_ballot": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot.test.js --env=chrome", - "nightwatch_local_ballot_0_4_11": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.test.js --env=chrome", + "nightwatch_local_ballot_0_4_11": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/ballot_0_4_11.spec.js --env=firefox", "nightwatch_local_usingWorker": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/usingWebWorker.test.js --env=chrome", "nightwatch_local_libraryDeployment": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/libraryDeployment.test.js --env=chrome", "nightwatch_local_solidityImport": "npm run build:e2e & nightwatch --config dist/apps/remix-ide-e2e/nightwatch.js dist/apps/remix-ide-e2e/src/tests/solidityImport.test.js --env=chrome",