From 1c09954998843e30c1c38b602b5cbfda6506bef9 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Mon, 10 Dec 2018 17:49:20 +0530 Subject: [PATCH 01/26] Initial circleci script --- .circleci/config.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..86bb215de --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,39 @@ +version: 2 +jobs: + test: + docker: + - image: circleci/node:8 + steps: + - checkout + - restore_cache: + key: dependency-cache-{{ checksum "package.json" }} + - run: + - yarn + - node --version + - truffle version + - npm run test + - save_cache: + key: dependency-cache-{{ checksum "package.json" }} + paths: + - node_modules + docs: + docker: + - image: circleci/node:8 + steps: + - checkout + - restore_cache: + key: dependency-cache-{{ checksum "package.json" }} + - run: + - yarn + - npm run docs + - save_cache: + key: dependency-cache-{{ checksum "package.json" }} + paths: + - node_modules +workflows: + version: 2 + test_and_docs: + jobs: + - test + - docs + \ No newline at end of file From cd83c01871b84ef99e0e1b122014515923469092 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Mon, 10 Dec 2018 17:56:30 +0530 Subject: [PATCH 02/26] circle ci run fixed --- .circleci/config.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 86bb215de..41ac6838b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,11 +7,10 @@ jobs: - checkout - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - - run: - - yarn - - node --version - - truffle version - - npm run test + - run: yarn + - run: node --version + - run: truffle version + - run: npm run test - save_cache: key: dependency-cache-{{ checksum "package.json" }} paths: @@ -23,9 +22,10 @@ jobs: - checkout - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - - run: - - yarn - - npm run docs + - run: yarn + - run: node --version + - run: truffle version + - run: npm run docs - save_cache: key: dependency-cache-{{ checksum "package.json" }} paths: From 1dba68c91b5f24c274d6f4557bfda06f29eba8da Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Mon, 10 Dec 2018 18:00:25 +0530 Subject: [PATCH 03/26] Added global truffle installation --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 41ac6838b..feb53b66e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,6 +8,7 @@ jobs: - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - run: yarn + - run: npm i truffle -g - run: node --version - run: truffle version - run: npm run test @@ -23,6 +24,7 @@ jobs: - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - run: yarn + - run: npm i truffle -g - run: node --version - run: truffle version - run: npm run docs From e2605859ffae129e2b1e0a862a95492315a5e6d9 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Mon, 10 Dec 2018 18:03:13 +0530 Subject: [PATCH 04/26] Added sudo to global install --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index feb53b66e..f69a20ced 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ jobs: - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - run: yarn - - run: npm i truffle -g + - run: sudo npm i truffle -g - run: node --version - run: truffle version - run: npm run test @@ -24,7 +24,7 @@ jobs: - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - run: yarn - - run: npm i truffle -g + - run: sudo npm i truffle -g - run: node --version - run: truffle version - run: npm run docs From e157e399694c52487d570c716a1f53717f8dca18 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Mon, 10 Dec 2018 18:23:20 +0530 Subject: [PATCH 05/26] Added coverage, parallelism --- .circleci/config.yml | 49 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f69a20ced..00b97d3ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,8 +1,26 @@ version: 2 jobs: + build: + docker: + - image: circleci/node:8 + parallelism: 4 + steps: + - checkout + - restore_cache: + key: dependency-cache-{{ checksum "package.json" }} + - run: yarn + - run: sudo npm i truffle -g + - run: node --version + - run: truffle version + - run: truffle compile + - save_cache: + key: dependency-cache-{{ checksum "package.json" }} + paths: + - node_modules test: docker: - image: circleci/node:8 + parallelism: 4 steps: - checkout - restore_cache: @@ -16,6 +34,23 @@ jobs: key: dependency-cache-{{ checksum "package.json" }} paths: - node_modules + coverage: + docker: + - image: circleci/node:8 + parallelism: 4 + steps: + - checkout + - restore_cache: + key: dependency-cache-{{ checksum "package.json" }} + - run: yarn + - run: sudo npm i truffle -g + - run: node --version + - run: truffle version + - run: npm run coverage + - save_cache: + key: dependency-cache-{{ checksum "package.json" }} + paths: + - node_modules docs: docker: - image: circleci/node:8 @@ -34,8 +69,16 @@ jobs: - node_modules workflows: version: 2 - test_and_docs: + build-test-coverage-docs: jobs: - - test - - docs + - build + - test: + - requires: + - build + - coverage: + - requires: + - test + - docs: + - requires: + - coverage \ No newline at end of file From 3df37ca6e471f6a52599980f93677bcccd818fd7 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Mon, 10 Dec 2018 18:27:16 +0530 Subject: [PATCH 06/26] Workflow fixed --- .circleci/config.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 00b97d3ce..2714ad01e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,12 +73,12 @@ workflows: jobs: - build - test: - - requires: - - build + requires: + - build - coverage: - - requires: - - test + requires: + - test - docs: - - requires: - - coverage + requires: + - coverage \ No newline at end of file From 2a3a8592e09b198a9e2c28853bfc8eb769001ad1 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Mon, 10 Dec 2018 18:41:25 +0530 Subject: [PATCH 07/26] Removed parallelism --- .circleci/config.yml | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2714ad01e..26383b3bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,6 @@ jobs: build: docker: - image: circleci/node:8 - parallelism: 4 steps: - checkout - restore_cache: @@ -20,7 +19,6 @@ jobs: test: docker: - image: circleci/node:8 - parallelism: 4 steps: - checkout - restore_cache: @@ -37,7 +35,6 @@ jobs: coverage: docker: - image: circleci/node:8 - parallelism: 4 steps: - checkout - restore_cache: @@ -72,13 +69,6 @@ workflows: build-test-coverage-docs: jobs: - build - - test: - requires: - - build - - coverage: - requires: - - test - - docs: - requires: - - coverage - \ No newline at end of file + - test + - coverage + - docs \ No newline at end of file From 30a8c5d624c025dc6f35f27971caafb4d491f7d4 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 13:13:02 +0530 Subject: [PATCH 08/26] WIP --- .circleci/config.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 26383b3bd..fe65e9fca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: - checkout - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - - run: yarn + - run: yarn install - run: sudo npm i truffle -g - run: node --version - run: truffle version @@ -23,7 +23,7 @@ jobs: - checkout - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - - run: yarn + - run: yarn install - run: sudo npm i truffle -g - run: node --version - run: truffle version @@ -39,7 +39,7 @@ jobs: - checkout - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - - run: yarn + - run: yarn install - run: sudo npm i truffle -g - run: node --version - run: truffle version @@ -55,7 +55,7 @@ jobs: - checkout - restore_cache: key: dependency-cache-{{ checksum "package.json" }} - - run: yarn + - run: yarn install - run: sudo npm i truffle -g - run: node --version - run: truffle version @@ -68,7 +68,5 @@ workflows: version: 2 build-test-coverage-docs: jobs: - - build - test - - coverage - - docs \ No newline at end of file + - coverage \ No newline at end of file From 6e14dafd84c749810547762e9953d6d3b91ec5d8 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 13:30:49 +0530 Subject: [PATCH 09/26] CircleCI changes --- .circleci/config.yml | 17 +++++++++++++++-- scripts/coverage.sh | 2 +- scripts/test.sh | 25 ++++++++++--------------- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe65e9fca..cff30c3ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,7 +66,20 @@ jobs: - node_modules workflows: version: 2 - build-test-coverage-docs: + commit: jobs: + - build - test - - coverage \ No newline at end of file + daily-coverage: + triggers: + - schedule: + cron: "0 0 * * *" + jobs: + - coverage + docs: + filters: + branches: + only: + - master + jobs: + - docs \ No newline at end of file diff --git a/scripts/coverage.sh b/scripts/coverage.sh index e42ed6a84..5d1e2a24e 100755 --- a/scripts/coverage.sh +++ b/scripts/coverage.sh @@ -2,4 +2,4 @@ rm -rf flat -TRAVIS_PULL_REQUEST=true scripts/test.sh \ No newline at end of file +COVERAGE=true scripts/test.sh \ No newline at end of file diff --git a/scripts/test.sh b/scripts/test.sh index 6dd3ce95a..fa569144f 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -19,11 +19,7 @@ cleanup() { fi } -if ! [ -z "${TRAVIS_PULL_REQUEST+x}" ] && [ "$TRAVIS_PULL_REQUEST" != false ]; then - testrpc_port=8545 -else - testrpc_port=8545 -fi +testrpc_port=8545 testrpc_running() { nc -z localhost "$testrpc_port" @@ -60,20 +56,19 @@ start_testrpc() { --account="0x2bdd21761a483f71054e14f5b827213567971c676928d9a1808cbfa4b7501209,1000000000000000000000000" ) - if ! [ -z "${TRAVIS_PULL_REQUEST+x}" ] && [ "$TRAVIS_PULL_REQUEST" != false ]; then + if [ "$COVERAGE" = true ]; then node_modules/.bin/testrpc-sc --gasLimit 0xfffffffffff --port "$testrpc_port" "${accounts[@]}" > /dev/null & else node_modules/.bin/ganache-cli --gasLimit 8000000 "${accounts[@]}" > /dev/null & fi - testrpc_pid=$! } if testrpc_running; then echo "Using existing testrpc instance" - # Do not start ethereum bridge unless it is a cron job from travis - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then + # Do not start ethereum bridge unless it is a cron job + if [ "$CIRCLE_CI_CRON" = true ]; then bridge_running if bridge_running; then echo "Using existing ethereum-bridge instance" @@ -85,23 +80,23 @@ if testrpc_running; then else echo "Starting our own testrpc instance" start_testrpc - # Do not start ethereum bridge unless it is a cron job from travis - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then + # Do not start ethereum bridge unless it is a cron job + if [ "$CIRCLE_CI_CRON" = true ]; then echo "Starting our own ethereum-bridge instance" sleep 10 start_bridge fi fi -if ! [ -z "${TRAVIS_PULL_REQUEST+x}" ] && [ "$TRAVIS_PULL_REQUEST" != false ]; then +if [ "$COVERAGE" = true ]; then curl -o node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js node_modules/.bin/solidity-coverage - if [ "$CONTINUOUS_INTEGRATION" = true ]; then + if [ "$CI" = true ]; then cat coverage/lcov.info | node_modules/.bin/coveralls fi else - # Do not run a_poly_oracle,js tests unless it is a cron job from travis - if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then + # Do not run a_poly_oracle,js tests unless it is a cron job + if [ "$CIRCLE_CI_CRON" = true ]; then node_modules/.bin/truffle test `ls test/*.js` else node_modules/.bin/truffle test `find test/*.js ! -name a_poly_oracle.js -and ! -name s_v130_to_v140_upgrade.js` From 646952006030fa847b4e1b65be70df8052aa6dc2 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 13:33:29 +0530 Subject: [PATCH 10/26] CircleCI changes --- .circleci/config.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index cff30c3ee..450b659a2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,6 +74,12 @@ workflows: triggers: - schedule: cron: "0 0 * * *" + filters: + branches: + only: + - master + - development-2.1.0 + - development-3.0.0 jobs: - coverage docs: From 65441f51f012592e937e1c3560f62a143841175a Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 13:36:04 +0530 Subject: [PATCH 11/26] CircleCI changes --- .circleci/config.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 450b659a2..d74a38924 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,9 +83,9 @@ workflows: jobs: - coverage docs: - filters: - branches: - only: - - master jobs: - - docs \ No newline at end of file + - docs: + filters: + branches: + only: + - master \ No newline at end of file From 1c0fd7ca405a4b7277f31baa0c9e2963f81f44e8 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 13:47:32 +0530 Subject: [PATCH 12/26] Badge --- .circleci/config.yml | 1 + README.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d74a38924..421f32002 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -70,6 +70,7 @@ workflows: jobs: - build - test + - coverage daily-coverage: triggers: - schedule: diff --git a/README.md b/README.md index 51610e9d4..81f754148 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/PolymathNetwork/polymath-core.svg?branch=master)](https://travis-ci.org/PolymathNetwork/polymath-core) +[![CircleCI](https://circleci.com/gh/maxsam4/polymath-core.svg?style=svg)](https://circleci.com/gh/maxsam4/polymath-core) [![Coverage Status](https://coveralls.io/repos/github/PolymathNetwork/polymath-core/badge.svg?branch=master)](https://coveralls.io/github/PolymathNetwork/polymath-core?branch=master) [![Gitter](https://img.shields.io/badge/chat-gitter-green.svg)](https://gitter.im/PolymathNetwork/Lobby) [![Telegram](https://img.shields.io/badge/50k+-telegram-blue.svg)](https://gitter.im/PolymathNetwork/Lobby) [![Greenkeeper badge](https://badges.greenkeeper.io/PolymathNetwork/polymath-core.svg)](https://greenkeeper.io/) From 8f81424d66cd0209dae75649860b21c2adcc2cd8 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 14:18:02 +0530 Subject: [PATCH 13/26] Store test results --- .circleci/config.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 421f32002..105d4b9aa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,6 +32,8 @@ jobs: key: dependency-cache-{{ checksum "package.json" }} paths: - node_modules + - store_test_results: + path: test-results coverage: docker: - image: circleci/node:8 @@ -48,6 +50,9 @@ jobs: key: dependency-cache-{{ checksum "package.json" }} paths: - node_modules + - store_test_results: + path: test-results + docs: docker: - image: circleci/node:8 From 57db7a93596869b6ae4653df1b9c2d4340669e21 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 14:35:04 +0530 Subject: [PATCH 14/26] Removed coverage from commit workflow --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 105d4b9aa..de4dcba6b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -75,7 +75,6 @@ workflows: jobs: - build - test - - coverage daily-coverage: triggers: - schedule: From 23bf3a83c816e266bcc52c6ff0b623c1d25e1d60 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 17:07:52 +0530 Subject: [PATCH 15/26] Fix merge conflict --- .circleci/config.yml | 8 +++----- .gitignore | 6 +++++- package.json | 1 + scripts/test.sh | 6 ++++++ truffle-ci.js | 33 +++++++++++++++++++++++++++++++++ yarn.lock | 41 ++++++++++++++++++++++++++++++++++++++++- 6 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 truffle-ci.js diff --git a/.circleci/config.yml b/.circleci/config.yml index de4dcba6b..47f5344f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,9 +50,6 @@ jobs: key: dependency-cache-{{ checksum "package.json" }} paths: - node_modules - - store_test_results: - path: test-results - docs: docker: - image: circleci/node:8 @@ -73,9 +70,9 @@ workflows: version: 2 commit: jobs: - - build - test - daily-coverage: + - coverage + daily-builds: triggers: - schedule: cron: "0 0 * * *" @@ -86,6 +83,7 @@ workflows: - development-2.1.0 - development-3.0.0 jobs: + - test - coverage docs: jobs: diff --git a/.gitignore b/.gitignore index 1693ab75c..f1aed51ad 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,8 @@ package-lock.json bridge.log .node-xml* .solcover.js.bk -allFiredEvents \ No newline at end of file +allFiredEvents +extract/ +extract.py +extract.zip +/test-results \ No newline at end of file diff --git a/package.json b/package.json index fcf504ea0..57713a060 100644 --- a/package.json +++ b/package.json @@ -89,6 +89,7 @@ "ethereumjs-abi": "^0.6.5", "fast-csv": "^2.4.1", "ganache-cli": "^6.1.8", + "mocha-junit-reporter": "^1.18.0", "prettier": "^1.14.3", "sol-merger": "^0.1.2", "solidity-coverage": "^0.5.11", diff --git a/scripts/test.sh b/scripts/test.sh index fa569144f..12a3704c5 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -95,6 +95,12 @@ if [ "$COVERAGE" = true ]; then cat coverage/lcov.info | node_modules/.bin/coveralls fi else + if [ "$CI" = true ]; then + mkdir test-results + mkdir test-results/mocha + rm truffle-config.js + mv truffle-ci.js truffle-config.js + fi # Do not run a_poly_oracle,js tests unless it is a cron job if [ "$CIRCLE_CI_CRON" = true ]; then node_modules/.bin/truffle test `ls test/*.js` diff --git a/truffle-ci.js b/truffle-ci.js new file mode 100644 index 000000000..f427eb332 --- /dev/null +++ b/truffle-ci.js @@ -0,0 +1,33 @@ +require('babel-register'); +require('babel-polyfill'); + +module.exports = { + networks: { + development: { + host: 'localhost', + port: 8545, + network_id: '*', // Match any network id + gas: 7900000, + }, + coverage: { + host: "localhost", + network_id: "*", + port: 8545, // <-- If you change this, also set the port option in .solcover.js. + gas: 0xfffffffffff, // <-- Use this high gas value + gasPrice: 0x01 // <-- Use this low gas price + } + }, + solc: { + optimizer: { + enabled: true, + runs: 200, + }, + }, + mocha: { + enableTimeouts: false, + reporter: "mocha-junit-reporter", + reporterOptions: { + mochaFile: './test-results/mocha/results.xml' + } + } +}; diff --git a/yarn.lock b/yarn.lock index aba68e85b..c31bbb848 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1373,6 +1373,11 @@ chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" +charenc@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" + integrity sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc= + checkpoint-store@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/checkpoint-store/-/checkpoint-store-1.1.0.tgz#04e4cb516b91433893581e6d4601a78e9552ea06" @@ -1708,6 +1713,11 @@ cross-spawn@^6.0.5: semver "^5.5.0" shebang-command "^1.2.0" which "^1.2.9" + +crypt@~0.0.1: + version "0.0.2" + resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" + integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs= crypto-browserify@3.12.0, crypto-browserify@^3.11.0: version "3.12.0" @@ -3545,7 +3555,7 @@ is-binary-path@^1.0.0: dependencies: binary-extensions "^1.0.0" -is-buffer@^1.1.5: +is-buffer@^1.1.5, is-buffer@~1.1.1: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -4207,6 +4217,15 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +md5@^2.1.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9" + integrity sha1-U6s41f48iJG6RlMp6iP6wFQBJvk= + dependencies: + charenc "~0.0.1" + crypt "~0.0.1" + is-buffer "~1.1.1" + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -4406,12 +4425,27 @@ mkdirp-promise@^5.0.1: dependencies: mkdirp "*" +<<<<<<< HEAD mkdirp@*, mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0: +======= +mkdirp@*, mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkdirp@~0.5.1: +>>>>>>> e543061f... Added test reporter version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: minimist "0.0.8" +mocha-junit-reporter@^1.18.0: + version "1.18.0" + resolved "https://registry.yarnpkg.com/mocha-junit-reporter/-/mocha-junit-reporter-1.18.0.tgz#9209a3fba30025ae3ae5e6bfe7f9c5bc3c2e8ee2" + integrity sha512-y3XuqKa2+HRYtg0wYyhW/XsLm2Ps+pqf9HaTAt7+MVUAKFJaNAHOrNseTZo9KCxjfIbxUWwckP5qCDDPUmjSWA== + dependencies: + debug "^2.2.0" + md5 "^2.1.0" + mkdirp "~0.5.1" + strip-ansi "^4.0.0" + xml "^1.0.0" + mocha@^4.0.1, mocha@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/mocha/-/mocha-4.1.0.tgz#7d86cfbcf35cb829e2754c32e17355ec05338794" @@ -7124,6 +7158,11 @@ xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: parse-headers "^2.0.0" xtend "^4.0.0" +xml@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" + integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU= + xmlhttprequest@*, xmlhttprequest@1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" From edbd4b139db1878e6a993c2f71dbbe50e1a87e99 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 17:19:47 +0530 Subject: [PATCH 16/26] Addded artifact collection --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 47f5344f1..c17f9010e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,8 @@ jobs: - node_modules - store_test_results: path: test-results + - store_artifacts: + path: ./test-results/mocha/results.xml coverage: docker: - image: circleci/node:8 @@ -50,6 +52,8 @@ jobs: key: dependency-cache-{{ checksum "package.json" }} paths: - node_modules + - store_artifacts: + path: ./coverage/lcov.info docs: docker: - image: circleci/node:8 From 88607d61434cf4e44dfa8629b680a7c86a0afa88 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 17:34:11 +0530 Subject: [PATCH 17/26] Added parallelism --- .circleci/config.yml | 1 + scripts/test.sh | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c17f9010e..1dff7a561 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,6 +19,7 @@ jobs: test: docker: - image: circleci/node:8 + parallelism: 2 steps: - checkout - restore_cache: diff --git a/scripts/test.sh b/scripts/test.sh index 12a3704c5..b0b99dd34 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -100,10 +100,11 @@ else mkdir test-results/mocha rm truffle-config.js mv truffle-ci.js truffle-config.js - fi - # Do not run a_poly_oracle,js tests unless it is a cron job - if [ "$CIRCLE_CI_CRON" = true ]; then - node_modules/.bin/truffle test `ls test/*.js` + if [ "$CIRCLE_CI_CRON" = true ]; then + node_modules/.bin/truffle test `ls test/*.js | circleci tests split --split-by=timings` + else + node_modules/.bin/truffle test `find test/*.js ! -name a_poly_oracle.js -and ! -name s_v130_to_v140_upgrade.js | circleci tests split --split-by=timings` + fi else node_modules/.bin/truffle test `find test/*.js ! -name a_poly_oracle.js -and ! -name s_v130_to_v140_upgrade.js` fi From a2ef395857446289641f43232a120451faf7632a Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 17:44:34 +0530 Subject: [PATCH 18/26] Comment --- scripts/test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/test.sh b/scripts/test.sh index b0b99dd34..2f4e5b057 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -100,6 +100,7 @@ else mkdir test-results/mocha rm truffle-config.js mv truffle-ci.js truffle-config.js + # only run poly oracle and upgrade tests if cron job by CI if [ "$CIRCLE_CI_CRON" = true ]; then node_modules/.bin/truffle test `ls test/*.js | circleci tests split --split-by=timings` else From f5c1d87afc650cb843abc47903ce0271d270f4f4 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 17:46:08 +0530 Subject: [PATCH 19/26] Bumped parallelism to 3 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1dff7a561..e55982c40 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: test: docker: - image: circleci/node:8 - parallelism: 2 + parallelism: 3 steps: - checkout - restore_cache: From d84e09dc74990f8ce4f37c16f28bb1bf32bd71ed Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 17:51:23 +0530 Subject: [PATCH 20/26] Coverage requires approval --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e55982c40..78530ce94 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -76,7 +76,8 @@ workflows: commit: jobs: - test - - coverage + - coverage: + type: approval daily-builds: triggers: - schedule: From e5d28e4472b6d1814560e331cb6d8cb9702c696e Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 18:06:20 +0530 Subject: [PATCH 21/26] Bumped parallelism to 4 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 78530ce94..d73bda085 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: test: docker: - image: circleci/node:8 - parallelism: 3 + parallelism: 4 steps: - checkout - restore_cache: From c8d4b72559558aaef023700a1ae3eb87db9f0c5d Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 18:12:49 +0530 Subject: [PATCH 22/26] Removed manual approval --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d73bda085..e55982c40 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: test: docker: - image: circleci/node:8 - parallelism: 4 + parallelism: 3 steps: - checkout - restore_cache: @@ -76,8 +76,7 @@ workflows: commit: jobs: - test - - coverage: - type: approval + - coverage daily-builds: triggers: - schedule: From 97c7b6fe44a8845781dffc842f3e24bf1de3acc1 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 20:09:16 +0530 Subject: [PATCH 23/26] Combine travis and CircleCI --- .circleci/config.yml | 9 ++++----- .travis.yml | 15 +-------------- README.md | 2 +- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e55982c40..986c13c2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: test: docker: - image: circleci/node:8 - parallelism: 3 + parallelism: 2 steps: - checkout - restore_cache: @@ -75,7 +75,6 @@ workflows: version: 2 commit: jobs: - - test - coverage daily-builds: triggers: @@ -85,10 +84,10 @@ workflows: branches: only: - master - - development-2.1.0 - - development-3.0.0 + - dev-2.1.0 + - dev-2.2.0 + - dev-3.0.0 jobs: - - test - coverage docs: jobs: diff --git a/.travis.yml b/.travis.yml index 2265b2d88..b676c5840 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,24 +4,11 @@ node_js: cache: directories: - node_modules -matrix: - fast_finish: true - allow_failures: - - env: 'TASK=docs' jobs: include: - - stage: Tests and Coverage - after_install: wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js + - stage: test before_script: truffle version script: npm run test - - stage: Docs - env: 'TASK=docs' - before_install: - - echo -ne '\n' | sudo apt-add-repository -y ppa:hvr/z3 - - sudo apt-get -y update - - sudo apt-get -y install libz3-dev - before_script: wget -O node_modules/solidity-docgen/lib/index.js https://raw.githubusercontent.com/maxsam4/solidity-docgen/buffer-size/lib/index.js - script: npm run docs notifications: slack: secure: W4FZSabLrzF74f317hutolEHnlq2GBlQxU6b85L5XymrjgLEhlgE16c5Qz7Emoyt6le6PXL+sfG2ujJc3XYys/6hppgrHSAasuJnKCdQNpmMZ9BNyMs6WGkmB3enIf3K/FLXb26AQdwpQdIXuOeJUTf879u+YoiZV0eZH8d3+fsIOyovq9N6X5pKOpDM9iT8gGB4t7fie7xf51s+iUaHxyO9G7jDginZ4rBXHcU7mxCub9z+Z1H8+kCTnPWaF+KKVEXx4Z0nI3+urboD7E4OIP02LwrThQls2CppA3X0EoesTcdvj/HLErY/JvsXIFiFEEHZzB1Wi+k2TiOeLcYwEuHIVij+HPxxlJNX/j8uy01Uk8s4rd+0EhvfdKHJqUKqxH4YN2npcKfHEss7bU3y7dUinXQfYShW5ZewHdvc7pnnxBTfhvmdi64HdNrXAPq+s1rhciH7MmnU+tsm4lhrpr+FBuHzUMA9fOCr7b0SQytZEgWpiUls88gdbh3yG8TjyZxmZJGx09cwEP0q7VoH0UwFh7mIu5XmYdd5tWUhavTiO7YV8cUPn7MvwMsTltB3YBpF/fB26L7ka8zBhCsjm9prW6SVYU/dyO3m91VeZtO/zJFHRDA6Q58JGVW2rgzO39z193qC1EGRXqTie96VwAAtNg8+hRb+bI/CWDVzSPc= \ No newline at end of file diff --git a/README.md b/README.md index 81f754148..51610e9d4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![CircleCI](https://circleci.com/gh/maxsam4/polymath-core.svg?style=svg)](https://circleci.com/gh/maxsam4/polymath-core) +[![Build Status](https://travis-ci.org/PolymathNetwork/polymath-core.svg?branch=master)](https://travis-ci.org/PolymathNetwork/polymath-core) [![Coverage Status](https://coveralls.io/repos/github/PolymathNetwork/polymath-core/badge.svg?branch=master)](https://coveralls.io/github/PolymathNetwork/polymath-core?branch=master) [![Gitter](https://img.shields.io/badge/chat-gitter-green.svg)](https://gitter.im/PolymathNetwork/Lobby) [![Telegram](https://img.shields.io/badge/50k+-telegram-blue.svg)](https://gitter.im/PolymathNetwork/Lobby) [![Greenkeeper badge](https://badges.greenkeeper.io/PolymathNetwork/polymath-core.svg)](https://greenkeeper.io/) From 731f1e8ad0a5e67e4aea1a857da371b3df651c87 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 20:55:37 +0530 Subject: [PATCH 24/26] env var changes --- scripts/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index 2f4e5b057..f23df2845 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -91,11 +91,11 @@ fi if [ "$COVERAGE" = true ]; then curl -o node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js node_modules/.bin/solidity-coverage - if [ "$CI" = true ]; then + if [ "$CIRCLECI" = true ]; then cat coverage/lcov.info | node_modules/.bin/coveralls fi else - if [ "$CI" = true ]; then + if [ "$CIRCLECI" = true ]; then mkdir test-results mkdir test-results/mocha rm truffle-config.js From e20c91a19af0636c3b09928f36946f315af2912a Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Thu, 13 Dec 2018 21:01:27 +0530 Subject: [PATCH 25/26] comment --- scripts/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test.sh b/scripts/test.sh index f23df2845..9f595d0ba 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -95,7 +95,7 @@ if [ "$COVERAGE" = true ]; then cat coverage/lcov.info | node_modules/.bin/coveralls fi else - if [ "$CIRCLECI" = true ]; then + if [ "$CIRCLECI" = true ]; then # using mocha junit reporter for parallelism in CircleCI mkdir test-results mkdir test-results/mocha rm truffle-config.js From 896816648e99e52ccdfeb2426c57eaca7df30b32 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Fri, 14 Dec 2018 20:20:15 +0530 Subject: [PATCH 26/26] Increased no o/p timeout --- .circleci/config.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 986c13c2d..a39d287a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,9 @@ jobs: - run: sudo npm i truffle -g - run: node --version - run: truffle version - - run: npm run coverage + - run: + command: npm run coverage + no_output_timeout: 1h - save_cache: key: dependency-cache-{{ checksum "package.json" }} paths: @@ -95,4 +97,4 @@ workflows: filters: branches: only: - - master \ No newline at end of file + - master