Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 13 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -44,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:
Expand All @@ -75,30 +65,30 @@ jobs:
name: MetaCoin E2E
command: |
./scripts/run-metacoin.sh
e2e-buidler:
machine: true
e2e-metacoin-windows:
executor: win/default
steps:
- checkout
- <<: *step_install_nvm
- run: dotnet tool install --global PowerShell
- run:
name: Buidler E2E
name: Windows Metacoin E2E
command: |
./scripts/run-buidler.sh
e2e-moloch:
bash ./scripts/run-metacoin.sh
e2e-buidler:
machine: true
steps:
- checkout
- <<: *step_install_nvm
- run:
name: Moloch E2E
name: Buidler E2E
command: |
./scripts/run-moloch.sh
./scripts/run-buidler.sh
workflows:
version: 2
build:
jobs:
- unit-test
- e2e-zeppelin
- e2e-metacoin
- e2e-metacoin-windows
- e2e-buidler
- e2e-moloch
14 changes: 7 additions & 7 deletions plugins/resources/plugin.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ function setupTempFolders(config, tempContractsDir, tempArtifactsDir){
function save(targets, originalDir, tempDir){
let _path;
for (target of targets) {
_path = target.canonicalPath.replace(originalDir, tempDir);

_path = path.normalize(target.canonicalPath)
.replace(originalDir, tempDir);

fs.outputFileSync(_path, target.source);
}
}
Expand Down Expand Up @@ -128,11 +131,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);

Expand Down Expand Up @@ -174,7 +174,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')
Expand Down
1 change: 0 additions & 1 deletion plugins/truffle.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +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 pkg = require('./../package.json');
const death = require('death');
const path = require('path');
Expand Down
43 changes: 32 additions & 11 deletions scripts/run-buidler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 "
Expand All @@ -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

13 changes: 10 additions & 3 deletions scripts/run-metacoin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -17,14 +17,14 @@ 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"

# Install truffle and metacoin box
npm install -g truffle
npm install -g yarn
npm install -g truffle

mkdir metacoin
cd metacoin
Expand All @@ -38,6 +38,13 @@ cat truffle-config.js
# Install and run solidity-coverage @ PR
npm init --yes
yarn add $PR_PATH --dev
yarn add truffle --dev

# require("truffle") not working on global install in Circle's Windows env
if [ "$CIRCLE_JOB" == "e2e-metacoin-windows" ]; then
yarn add truffle --dev
fi

npx truffle run coverage

# Test that coverage/ was generated
Expand Down
39 changes: 0 additions & 39 deletions scripts/run-moloch.sh

This file was deleted.