From 42dca0ce97f454fea62aebeca4bda811de64224f Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 11:31:24 -0800 Subject: [PATCH 01/21] Add Windows CI build, use path.join for all paths --- .circleci/config.yml | 25 +++++++++++++++++++------ plugins/resources/plugin.utils.js | 9 +++------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 11eb785d..953426f1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,7 @@ -version: 2.0 +version: 2.1 + +orbs: + win: circleci/windows@2.2.0 # Necessary for running in machine mode, # which is necessary to execute the E2E scripts @@ -75,6 +78,15 @@ jobs: name: MetaCoin E2E command: | ./scripts/run-metacoin.sh + e2e-metacoin-windows: + executor: win/default + steps: + - checkout + - run: dotnet tool install --global PowerShell + - run: + name: MetaCoin E2E + command: | + pwsh ./scripts/run-metacoin.sh e2e-buidler: machine: true steps: @@ -97,8 +109,9 @@ workflows: version: 2 build: jobs: - - unit-test - - e2e-zeppelin - - e2e-metacoin - - e2e-buidler - - e2e-moloch + #- unit-test + #- e2e-zeppelin + #- e2e-metacoin + - e2e-metacoin-windows + #- e2e-buidler + #- e2e-moloch diff --git a/plugins/resources/plugin.utils.js b/plugins/resources/plugin.utils.js index 72fa5a31..5a8ed3ba 100644 --- a/plugins/resources/plugin.utils.js +++ b/plugins/resources/plugin.utils.js @@ -128,11 +128,8 @@ function checkContext(config, tempContractsDir, tempArtifactsDir){ // ============================= function assembleFiles(config, skipFiles=[]){ - let targets; - let skipFolders; - let skipped = []; - - targets = shell.ls(`${config.contractsDir}/**/*.sol`); + const targetsPath = path.join(config.contractsDir, '**', '*.sol'); + const targets = shell.ls(targetsPath); skipFiles = assembleSkipped(config, targets, skipFiles); @@ -174,7 +171,7 @@ function assembleTargets(config, targets=[], skipFiles=[]){ */ function assembleSkipped(config, targets, skipFiles=[]){ // Make paths absolute - skipFiles = skipFiles.map(contract => `${config.contractsDir}/${contract}`); + skipFiles = skipFiles.map(contract => path.join(config.contractsDir, contract)); // Enumerate files in skipped folders const skipFolders = skipFiles.filter(item => path.extname(item) !== '.sol') From 7e02f3fba174194fff8d5af1751d00fe02b18654 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 11:33:41 -0800 Subject: [PATCH 02/21] Use bash --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 953426f1..3bc875d3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -86,7 +86,7 @@ jobs: - run: name: MetaCoin E2E command: | - pwsh ./scripts/run-metacoin.sh + bash ./scripts/run-metacoin.sh e2e-buidler: machine: true steps: From c37f051a5761e03bdbf70473639221412b97ef84 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 11:38:48 -0800 Subject: [PATCH 03/21] Remove sudos from script --- scripts/run-metacoin.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 91854459..21b5fda9 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -8,7 +8,7 @@ set -o errexit # Get rid of any caches -sudo rm -rf node_modules +rm -rf node_modules echo "NVM CURRENT >>>>>" && nvm current # Use PR env variables (for forks) or fallback on local if PR not available @@ -17,7 +17,7 @@ SED_REGEX="s/git@github.com:/https:\/\/github.com\//" if [[ -v CIRCLE_PR_REPONAME ]]; then PR_PATH="https://github.com/$CIRCLE_PR_USERNAME/$CIRCLE_PR_REPONAME#$CIRCLE_SHA1" else - PR_PATH=$(echo "$CIRCLE_REPOSITORY_URL#$CIRCLE_SHA1" | sudo sed "$SED_REGEX") + PR_PATH=$(echo "$CIRCLE_REPOSITORY_URL#$CIRCLE_SHA1" | sed "$SED_REGEX") fi echo "PR_PATH >>>>> $PR_PATH" From 5f6e13b203cbbf85d59a2f3ba52bdfcee5a9aa61 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 11:46:58 -0800 Subject: [PATCH 04/21] Try truffle as a local dep --- scripts/run-metacoin.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 21b5fda9..75613fda 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -23,7 +23,7 @@ fi echo "PR_PATH >>>>> $PR_PATH" # Install truffle and metacoin box -npm install -g truffle +#npm install -g truffle npm install -g yarn mkdir metacoin @@ -38,6 +38,7 @@ cat truffle-config.js # Install and run solidity-coverage @ PR npm init --yes yarn add $PR_PATH --dev +yarn add truffle --dev npx truffle run coverage # Test that coverage/ was generated From c8487bb17039d857293c82042099461cbebc5aff Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 11:54:44 -0800 Subject: [PATCH 05/21] Fixes.. --- .circleci/config.yml | 1 + scripts/run-metacoin.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3bc875d3..5c8cfd9d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,6 +83,7 @@ jobs: steps: - checkout - run: dotnet tool install --global PowerShell + - run: export IS_WINDOWS=true - run: name: MetaCoin E2E command: | diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 75613fda..40d357de 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -25,6 +25,7 @@ echo "PR_PATH >>>>> $PR_PATH" # Install truffle and metacoin box #npm install -g truffle npm install -g yarn +npm install -g truffle mkdir metacoin cd metacoin @@ -38,7 +39,11 @@ cat truffle-config.js # Install and run solidity-coverage @ PR npm init --yes yarn add $PR_PATH --dev -yarn add truffle --dev + +if [ $IS_WINDOWS == true ]; then + yarn add truffle --dev +fi + npx truffle run coverage # Test that coverage/ was generated From 614a22b11a7c9c23ee3fb291afab323d12471be1 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 11:56:38 -0800 Subject: [PATCH 06/21] Use bash command to export --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c8cfd9d..eb5ba787 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ jobs: steps: - checkout - run: dotnet tool install --global PowerShell - - run: export IS_WINDOWS=true + - run: bash export IS_WINDOWS=true - run: name: MetaCoin E2E command: | From 5b4f8f7ce34b16d95750daef4aa5e5219dadad50 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 12:02:10 -0800 Subject: [PATCH 07/21] Powershell custom set env --- .circleci/config.yml | 2 +- scripts/run-metacoin.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eb5ba787..e026dc3f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -83,7 +83,7 @@ jobs: steps: - checkout - run: dotnet tool install --global PowerShell - - run: bash export IS_WINDOWS=true + - run: $Env:IS_WINDOWS += true - run: name: MetaCoin E2E command: | diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 40d357de..bb1bc63f 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -40,7 +40,7 @@ cat truffle-config.js npm init --yes yarn add $PR_PATH --dev -if [ $IS_WINDOWS == true ]; then +if [ "$IS_WINDOWS" == true ]; then yarn add truffle --dev fi From 71d9d52856000effb653d61afeb77e902cf8566e Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 12:07:26 -0800 Subject: [PATCH 08/21] mmmm --- scripts/run-metacoin.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index bb1bc63f..d3433941 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -40,9 +40,11 @@ cat truffle-config.js npm init --yes yarn add $PR_PATH --dev -if [ "$IS_WINDOWS" == true ]; then - yarn add truffle --dev -fi +yarn add truffle --dev +echo "IS_WINDOWS --> $IS_WINDOWS" +# if [ "$IS_WINDOWS" == true ]; then +# yarn add truffle --dev +# fi npx truffle run coverage From 1d5053f183a0e1a3bec37ca6e4f1644e7fa78139 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 12:17:20 -0800 Subject: [PATCH 09/21] Try env again --- scripts/run-metacoin.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index d3433941..66568d5e 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -40,11 +40,11 @@ cat truffle-config.js npm init --yes yarn add $PR_PATH --dev -yarn add truffle --dev -echo "IS_WINDOWS --> $IS_WINDOWS" -# if [ "$IS_WINDOWS" == true ]; then -# yarn add truffle --dev -# fi +echo "env:IS_WINDOWS --> $env:IS_WINDOWS" + +if [ "$env:IS_WINDOWS" == true ]; then + yarn add truffle --dev +fi npx truffle run coverage From 43364e4bf6ea02a3714e8e5be190855418481a10 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 12:26:22 -0800 Subject: [PATCH 10/21] Debugging lines.. --- plugins/truffle.plugin.js | 7 +++++++ scripts/run-metacoin.sh | 8 +------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/truffle.plugin.js b/plugins/truffle.plugin.js index 5df66dc4..db717a4d 100644 --- a/plugins/truffle.plugin.js +++ b/plugins/truffle.plugin.js @@ -2,6 +2,7 @@ const API = require('./../lib/api'); const utils = require('./resources/plugin.utils'); const truffleUtils = require('./resources/truffle.utils'); const PluginUI = require('./resources/truffle.ui'); +const shell = require('shell'); const pkg = require('./../package.json'); const death = require('death'); @@ -100,9 +101,15 @@ async function plugin(config){ config.compilers.solc.settings.optimizer.enabled = false; // Compile Instrumented Contracts + console.log('CONFIG --> ' + util.inspect(config)); + await truffle.contracts.compile(config); await api.onCompileComplete(config); + console.log('contractsDir --> ' + util.inspect(shell.ls(config.contracts_directory)); + + + // Run tests try { failures = await truffle.test.run(config) diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 66568d5e..231b6f76 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -39,13 +39,7 @@ cat truffle-config.js # Install and run solidity-coverage @ PR npm init --yes yarn add $PR_PATH --dev - -echo "env:IS_WINDOWS --> $env:IS_WINDOWS" - -if [ "$env:IS_WINDOWS" == true ]; then - yarn add truffle --dev -fi - +yarn add truffle --dev npx truffle run coverage # Test that coverage/ was generated From d4961c4c5e7c3e00fe0ce60e1873985f7f6a0988 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 12:36:13 -0800 Subject: [PATCH 11/21] fix paren --- plugins/truffle.plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/truffle.plugin.js b/plugins/truffle.plugin.js index db717a4d..2ce85aa0 100644 --- a/plugins/truffle.plugin.js +++ b/plugins/truffle.plugin.js @@ -106,7 +106,7 @@ async function plugin(config){ await truffle.contracts.compile(config); await api.onCompileComplete(config); - console.log('contractsDir --> ' + util.inspect(shell.ls(config.contracts_directory)); + console.log('contractsDir --> ' + util.inspect(shell.ls(config.contracts_directory))); From 13e9f22fda4d6d3954c6083d7db14901914c9677 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 12:40:49 -0800 Subject: [PATCH 12/21] shelljs --- plugins/truffle.plugin.js | 2 +- scripts/run-metacoin.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/truffle.plugin.js b/plugins/truffle.plugin.js index 2ce85aa0..728b0e6b 100644 --- a/plugins/truffle.plugin.js +++ b/plugins/truffle.plugin.js @@ -2,7 +2,7 @@ const API = require('./../lib/api'); const utils = require('./resources/plugin.utils'); const truffleUtils = require('./resources/truffle.utils'); const PluginUI = require('./resources/truffle.ui'); -const shell = require('shell'); +const shell = require('shelljs'); const pkg = require('./../package.json'); const death = require('death'); diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 231b6f76..1f6ca8bb 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -40,6 +40,12 @@ cat truffle-config.js npm init --yes yarn add $PR_PATH --dev yarn add truffle --dev +yarn add shell.js --dev + +# if [ "$CIRCLE_JOB" == "e2e-metacoin-windows" ]; then +# yarn add truffle --dev +# fi + npx truffle run coverage # Test that coverage/ was generated From ca4a10233f071829606f0590186f139fc7dd236b Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 12:44:33 -0800 Subject: [PATCH 13/21] util --- plugins/truffle.plugin.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/truffle.plugin.js b/plugins/truffle.plugin.js index 728b0e6b..1083819f 100644 --- a/plugins/truffle.plugin.js +++ b/plugins/truffle.plugin.js @@ -2,7 +2,9 @@ const API = require('./../lib/api'); const utils = require('./resources/plugin.utils'); const truffleUtils = require('./resources/truffle.utils'); const PluginUI = require('./resources/truffle.ui'); + const shell = require('shelljs'); +const util = require('util'); const pkg = require('./../package.json'); const death = require('death'); From 71f187a79ba5bd74d20677f35e2e3afe9ee4e394 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 13:03:12 -0800 Subject: [PATCH 14/21] More logging --- plugins/truffle.plugin.js | 5 ++--- scripts/run-metacoin.sh | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/truffle.plugin.js b/plugins/truffle.plugin.js index 1083819f..e41f55ce 100644 --- a/plugins/truffle.plugin.js +++ b/plugins/truffle.plugin.js @@ -108,9 +108,8 @@ async function plugin(config){ await truffle.contracts.compile(config); await api.onCompileComplete(config); - console.log('contractsDir --> ' + util.inspect(shell.ls(config.contracts_directory))); - - + console.log('contracts_directory --> ' + config.contracts_directory); + console.log('ls contracts_directory --> ' + JSON.stringify(shell.ls(config.contracts_directory))); // Run tests try { diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 1f6ca8bb..1e9a068b 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -40,11 +40,11 @@ cat truffle-config.js npm init --yes yarn add $PR_PATH --dev yarn add truffle --dev -yarn add shell.js --dev -# if [ "$CIRCLE_JOB" == "e2e-metacoin-windows" ]; then -# yarn add truffle --dev -# fi +if [ "$CIRCLE_JOB" == "e2e-metacoin-windows" ]; then + echo "ENTERED WINDOW SPECIFIC LOGIC IN CIRCLE...." + #yarn add truffle --dev +fi npx truffle run coverage From 7eb13621d40bebd6e8df4f630e951750ab4555d4 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 13:09:16 -0800 Subject: [PATCH 15/21] debugging lines --- plugins/resources/plugin.utils.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/resources/plugin.utils.js b/plugins/resources/plugin.utils.js index 5a8ed3ba..f30c1d0c 100644 --- a/plugins/resources/plugin.utils.js +++ b/plugins/resources/plugin.utils.js @@ -67,7 +67,11 @@ function setupTempFolders(config, tempContractsDir, tempArtifactsDir){ function save(targets, originalDir, tempDir){ let _path; for (target of targets) { + console.log('IN SAVE') + console.log('originalDir --> ' + originalDir); + console.log('tempDir --> ' + tempDir); _path = target.canonicalPath.replace(originalDir, tempDir); + console.log('_path --> ' + _path) fs.outputFileSync(_path, target.source); } } From 4666db62edc6916d67046f0c12b62faa01669f5e Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 13:32:18 -0800 Subject: [PATCH 16/21] normalizer --- plugins/resources/plugin.utils.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/resources/plugin.utils.js b/plugins/resources/plugin.utils.js index f30c1d0c..2088b086 100644 --- a/plugins/resources/plugin.utils.js +++ b/plugins/resources/plugin.utils.js @@ -70,6 +70,9 @@ function save(targets, originalDir, tempDir){ console.log('IN SAVE') console.log('originalDir --> ' + originalDir); console.log('tempDir --> ' + tempDir); + console.log('target.canonicalPath --> ' + target.canonicalPath); + console.log('path.normalize --> ' + path.normalize(target.canonicalPath)); + _path = target.canonicalPath.replace(originalDir, tempDir); console.log('_path --> ' + _path) fs.outputFileSync(_path, target.source); From 2c6455de3be3fa144fbceb759d62ce42c5252090 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 13:53:17 -0800 Subject: [PATCH 17/21] normalize path --- plugins/resources/plugin.utils.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/plugins/resources/plugin.utils.js b/plugins/resources/plugin.utils.js index 2088b086..01c4f40d 100644 --- a/plugins/resources/plugin.utils.js +++ b/plugins/resources/plugin.utils.js @@ -67,14 +67,10 @@ function setupTempFolders(config, tempContractsDir, tempArtifactsDir){ function save(targets, originalDir, tempDir){ let _path; for (target of targets) { - console.log('IN SAVE') - console.log('originalDir --> ' + originalDir); - console.log('tempDir --> ' + tempDir); - console.log('target.canonicalPath --> ' + target.canonicalPath); - console.log('path.normalize --> ' + path.normalize(target.canonicalPath)); - - _path = target.canonicalPath.replace(originalDir, tempDir); - console.log('_path --> ' + _path) + + _path = path.normalize(target.canonicalPath) + .replace(originalDir, tempDir); + fs.outputFileSync(_path, target.source); } } From afbf6c74c42e0438e6bff466061b5c5ceee1a795 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 14:07:52 -0800 Subject: [PATCH 18/21] Consolidate and simplify .yml / cleanup --- .circleci/config.yml | 34 +++++-------------------------- plugins/truffle.plugin.js | 5 ----- scripts/run-buidler.sh | 43 +++++++++++++++++++++++++++++---------- scripts/run-metacoin.sh | 4 ++-- 4 files changed, 39 insertions(+), 47 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e026dc3f..0412bd92 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,19 +47,6 @@ jobs: name: Upload coverage command: | bash <(curl -s https://codecov.io/bash) - - # This works but takes a while.... - e2e-colony: - docker: - - image: circleci/node:10.12-stretch - working_directory: ~/colonyNetwork - steps: - - checkout - - run: - name: ColonyNetwork E2E - command: | - ./scripts/run-colony.sh - e2e-zeppelin: machine: true steps: @@ -83,9 +70,8 @@ jobs: steps: - checkout - run: dotnet tool install --global PowerShell - - run: $Env:IS_WINDOWS += true - run: - name: MetaCoin E2E + name: Windows Metacoin E2E command: | bash ./scripts/run-metacoin.sh e2e-buidler: @@ -97,22 +83,12 @@ jobs: name: Buidler E2E command: | ./scripts/run-buidler.sh - e2e-moloch: - machine: true - steps: - - checkout - - <<: *step_install_nvm - - run: - name: Moloch E2E - command: | - ./scripts/run-moloch.sh workflows: version: 2 build: jobs: - #- unit-test - #- e2e-zeppelin - #- e2e-metacoin + - unit-test + - e2e-zeppelin + - e2e-metacoin - e2e-metacoin-windows - #- e2e-buidler - #- e2e-moloch + - e2e-buidler diff --git a/plugins/truffle.plugin.js b/plugins/truffle.plugin.js index e41f55ce..283330b3 100644 --- a/plugins/truffle.plugin.js +++ b/plugins/truffle.plugin.js @@ -103,14 +103,9 @@ async function plugin(config){ config.compilers.solc.settings.optimizer.enabled = false; // Compile Instrumented Contracts - console.log('CONFIG --> ' + util.inspect(config)); - await truffle.contracts.compile(config); await api.onCompileComplete(config); - console.log('contracts_directory --> ' + config.contracts_directory); - console.log('ls contracts_directory --> ' + JSON.stringify(shell.ls(config.contracts_directory))); - // Run tests try { failures = await truffle.test.run(config) diff --git a/scripts/run-buidler.sh b/scripts/run-buidler.sh index 104d0479..d3418dd8 100755 --- a/scripts/run-buidler.sh +++ b/scripts/run-buidler.sh @@ -6,6 +6,13 @@ set -o errexit +function verifyCoverageExists { + if [ ! -d "coverage" ]; then + echo "ERROR: no coverage folder was created." + exit 1 + fi +} + # Get rid of any caches sudo rm -rf node_modules echo "NVM CURRENT >>>>>" && nvm current @@ -27,7 +34,7 @@ echo "Simple buidler/buidler-trufflev5 " echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" echo "" -# Install buidler e2e test +# Install buidler-e2e git clone https://github.com/sc-forks/buidler-e2e.git cd buidler-e2e npm install @@ -38,12 +45,9 @@ cat package.json npx buidler coverage -# Test that coverage/ was generated -if [ ! -d "coverage" ]; then - echo "ERROR: no coverage folder was created for buidler-trufflev5." - exit 1 -fi +verifyCoverageExists +# Install buidler-ethers echo "" echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" echo "Simple buidler/buidler-ethers " @@ -60,8 +64,25 @@ cat package.json npx buidler coverage -# Test that coverage/ was generated -if [ ! -d "coverage" ]; then - echo "ERROR: no coverage folder was created for buidler-ethers." - exit 1 -fi +verifyCoverageExists + +echo "" +echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" +echo "Complex: MolochDao/moloch " +echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" +echo "" + +# Install sc-forks/moloch +cd .. +git clone https://github.com/sc-forks/moloch.git +cd moloch +npm install +npm uninstall --save-dev solidity-coverage + +# Install and run solidity-coverage @ PR +# Should run on network 'localhost' +npm install --save-dev $PR_PATH +npm run coverage + +verifyCoverageExists + diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 1e9a068b..4451f106 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -41,9 +41,9 @@ npm init --yes yarn add $PR_PATH --dev yarn add truffle --dev +# require("truffle") not working on global install in Circle's Windows enviroment if [ "$CIRCLE_JOB" == "e2e-metacoin-windows" ]; then - echo "ENTERED WINDOW SPECIFIC LOGIC IN CIRCLE...." - #yarn add truffle --dev + yarn add truffle --dev fi npx truffle run coverage From 7749c9a9ba2fc2814bc29fb084129939ec61381e Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 14:11:28 -0800 Subject: [PATCH 19/21] Remove debugging stuff --- plugins/truffle.plugin.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/truffle.plugin.js b/plugins/truffle.plugin.js index 283330b3..d574ffae 100644 --- a/plugins/truffle.plugin.js +++ b/plugins/truffle.plugin.js @@ -2,10 +2,6 @@ const API = require('./../lib/api'); const utils = require('./resources/plugin.utils'); const truffleUtils = require('./resources/truffle.utils'); const PluginUI = require('./resources/truffle.ui'); - -const shell = require('shelljs'); -const util = require('util'); - const pkg = require('./../package.json'); const death = require('death'); const path = require('path'); From e114a6ef87f6c1af800cd2c24fd9b293884781cb Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 14:24:37 -0800 Subject: [PATCH 20/21] More cleanup --- scripts/run-metacoin.sh | 2 +- scripts/run-moloch.sh | 39 --------------------------------------- 2 files changed, 1 insertion(+), 40 deletions(-) delete mode 100755 scripts/run-moloch.sh diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 4451f106..471aaa17 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -41,7 +41,7 @@ npm init --yes yarn add $PR_PATH --dev yarn add truffle --dev -# require("truffle") not working on global install in Circle's Windows enviroment +# require("truffle") not working on global install in Circle's Windows env if [ "$CIRCLE_JOB" == "e2e-metacoin-windows" ]; then yarn add truffle --dev fi diff --git a/scripts/run-moloch.sh b/scripts/run-moloch.sh deleted file mode 100755 index e3fc9818..00000000 --- a/scripts/run-moloch.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -# -# E2E CI: installs PR candidate on sc-forks/buidler-e2e (a simple example, -# similar to Metacoin) and runs coverage -# - -set -o errexit - -# Get rid of any caches -sudo rm -rf node_modules -echo "NVM CURRENT >>>>>" && nvm current - -# Use PR env variables (for forks) or fallback on local if PR not available -SED_REGEX="s/git@github.com:/https:\/\/github.com\//" - -if [[ -v CIRCLE_PR_REPONAME ]]; then - PR_PATH="https://github.com/$CIRCLE_PR_USERNAME/$CIRCLE_PR_REPONAME#$CIRCLE_SHA1" -else - PR_PATH=$(echo "$CIRCLE_REPOSITORY_URL#$CIRCLE_SHA1" | sudo sed "$SED_REGEX") -fi - -echo "PR_PATH >>>>> $PR_PATH" - -# Install buidler e2e test -git clone https://github.com/sc-forks/moloch.git -cd moloch -npm install -npm uninstall --save-dev solidity-coverage - -# Install and run solidity-coverage @ PR -# Should run on network 'localhost' -npm install --save-dev $PR_PATH -npm run coverage - -# Test that coverage/ was generated -if [ ! -d "coverage" ]; then - echo "ERROR: no coverage folder was created." - exit 1 -fi From 0b06ee69e702c776902e7509bf9f189e43ee22b8 Mon Sep 17 00:00:00 2001 From: cgewecke Date: Fri, 20 Dec 2019 14:26:15 -0800 Subject: [PATCH 21/21] More cleanup --- scripts/run-metacoin.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/run-metacoin.sh b/scripts/run-metacoin.sh index 471aaa17..fdc96da3 100755 --- a/scripts/run-metacoin.sh +++ b/scripts/run-metacoin.sh @@ -23,7 +23,6 @@ fi echo "PR_PATH >>>>> $PR_PATH" # Install truffle and metacoin box -#npm install -g truffle npm install -g yarn npm install -g truffle