Skip to content

Commit

Permalink
Merge pull request #2789 from ethereum/parallelism
Browse files Browse the repository at this point in the history
Circle CI Parallelism
  • Loading branch information
yann300 authored Apr 30, 2020
2 parents 265c425 + 47bb65f commit 7a35f28
Show file tree
Hide file tree
Showing 29 changed files with 106 additions and 287 deletions.
100 changes: 16 additions & 84 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
version: 2
jobs:
remix-ide-chrome-1:
remix-ide-chrome:
docker:
# specify the version you desire here
- image: circleci/node:9.11.2-browsers
Expand All @@ -20,6 +20,7 @@ jobs:
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide

parallelism: 20
steps:
- checkout
- run: npm install
Expand All @@ -31,79 +32,13 @@ jobs:
name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --config=../remix-ide/seleniumConfig.js
background: true
- run: ./ci/browser_tests_chrome_part1.sh
- run: ./ci/browser_tests_chrome.sh
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots

remix-ide-chrome-2:
docker:
# specify the version you desire here
- image: circleci/node:9.11.2-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"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide

steps:
- checkout
- run: npm install
- run: npm run lint && npm run test && npm run make-mock-compiler
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --config=../remix-ide/seleniumConfig.js
- run:
name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --config=../remix-ide/seleniumConfig.js
background: true
- run: ./ci/browser_tests_chrome_part2.sh
- store_artifacts:
path: ./reports/screenshots

remix-ide-firefox-1:
docker:
# specify the version you desire here
- image: circleci/node:9.11.2-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"
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide

steps:
- checkout
- run: npm install
- run: npm run lint && npm run test && npm run make-mock-compiler
- run:
name: Download Selenium
command: ./node_modules/.bin/selenium-standalone install --config=../remix-ide/seleniumConfig.js
- run:
name: Start Selenium
command: ./node_modules/.bin/selenium-standalone start --config=../remix-ide/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: ./ci/browser_tests_firefox_part1.sh
- store_artifacts:
path: ./reports/screenshots

remix-ide-firefox-2:
remix-ide-firefox:
docker:
# specify the version you desire here
- image: circleci/node:9.11.2-browsers
Expand All @@ -119,6 +54,7 @@ jobs:
- FILES_TO_PACKAGE: "assets background.js build icon.png index.html manifest.json README.md soljson.js package.json"
working_directory: ~/remix-ide

parallelism: 20
steps:
- checkout
- run: npm install
Expand All @@ -136,7 +72,9 @@ jobs:
- run:
name: Install Firefox
command: sudo dpkg -i firefox-mozilla-build_73.0.1-0ubuntu1_amd64.deb
- run: ./ci/browser_tests_firefox_part2.sh
- run: ./ci/browser_tests_firefox.sh
- store_test_results:
path: ./reports/tests
- store_artifacts:
path: ./reports/screenshots

Expand Down Expand Up @@ -234,27 +172,21 @@ workflows:
version: 2
build_all:
jobs:
- remix-ide-chrome-1
- remix-ide-firefox-1
- remix-ide-chrome-2
- remix-ide-firefox-2
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-run-deploy
- deploy-remix-live:
requires:
- remix-ide-chrome-1
- remix-ide-firefox-1
- remix-ide-chrome-2
- remix-ide-firefox-2
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-run-deploy
filters:
branches:
only: remix_live
- deploy-remix-alpha:
requires:
- remix-ide-chrome-1
- remix-ide-firefox-1
- remix-ide-chrome-2
- remix-ide-firefox-2
- remix-ide-chrome
- remix-ide-firefox
- remix-ide-run-deploy
filters:
branches:
Expand Down
31 changes: 31 additions & 0 deletions ci/browser_tests_chrome.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

set -e

setupRemixd () {
mkdir remixdSharedfolder
cd contracts
echo 'sharing folder: '
echo $PWD
./../node_modules/remixd/bin/remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ..
}

BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0

npm run ganache-cli &
npm run serve &
setupRemixd

sleep 5

TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings)
npm run nightwatch_local_chrome $TESTFILES

echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi
39 changes: 0 additions & 39 deletions ci/browser_tests_chrome_part1.sh

This file was deleted.

39 changes: 0 additions & 39 deletions ci/browser_tests_chrome_part2.sh

This file was deleted.

31 changes: 31 additions & 0 deletions ci/browser_tests_firefox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

set -e

setupRemixd () {
mkdir remixdSharedfolder
cd contracts
echo 'sharing folder: '
echo $PWD
./../node_modules/remixd/bin/remixd -s $PWD --remix-ide http://127.0.0.1:8080 &
cd ..
}

BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}}
echo "$BUILD_ID"
TEST_EXITCODE=0

npm run ganache-cli &
npm run serve &
setupRemixd

sleep 5

TESTFILES=$(circleci tests glob "./test-browser/tests/**/*.test.js" | circleci tests split --split-by=timings)
npm run nightwatch_local_firefox $TESTFILES

echo "$TEST_EXITCODE"
if [ "$TEST_EXITCODE" -eq 1 ]
then
exit 1
fi
39 changes: 0 additions & 39 deletions ci/browser_tests_firefox_part1.sh

This file was deleted.

39 changes: 0 additions & 39 deletions ci/browser_tests_firefox_part2.sh

This file was deleted.

2 changes: 1 addition & 1 deletion nightwatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const metamaskExtension = new Buffer.from(crxFile).toString('base64') // eslint-

module.exports = {
'src_folders': ['test-browser/tests'],
'output_folder': 'reports',
'output_folder': './reports/tests',
'custom_commands_path': ['test-browser/commands'],
'custom_assertions_path': '',
'page_objects_path': '',
Expand Down
Loading

0 comments on commit 7a35f28

Please sign in to comment.