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
10 changes: 10 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,23 @@ jobs:
name: MetaCoin E2E
command: |
./scripts/run-metacoin.sh
e2e-buidler:
machine: true
steps:
- checkout
- <<: *step_install_nvm
- run:
name: Buidler E2E
command: |
./scripts/run-buidler.sh
workflows:
version: 2
build:
jobs:
- unit-test
- e2e-zeppelin
- e2e-metacoin
- e2e-buidler
# TODO: re-enable.
# At the moment we're using forks so this is pointless
#nightly:
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"name": "solidity-coverage",
"version": "0.7.0-beta.2",
"description": "",
"main": "index.js",
"buidler": "dist/buidler.coverage.js",
"main": "dist/buidler.plugin.js",
"bin": {
"solidity-coverage": "./dist/bin.js"
},
Expand Down
37 changes: 37 additions & 0 deletions scripts/run-buidler.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/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/[email protected]:/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/buidler-e2e.git
cd buidler-e2e
npm install

# Install and run solidity-coverage @ PR
npm install --save-dev $PR_PATH
npx buidler coverage

# Test that coverage/ was generated
if [ ! -d "coverage" ]; then
echo "ERROR: no coverage folder was created."
exit 1
fi
7 changes: 7 additions & 0 deletions scripts/run-metacoin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ cat truffle-config.js
npm init --yes
yarn add $PR_PATH --dev
npx truffle run coverage

# Test that coverage/ was generated
if [ ! -d "coverage" ]; then
echo "ERROR: no coverage folder was created."
exit 1
fi

2 changes: 1 addition & 1 deletion truffle-plugin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"commands": {
"coverage": "dist/truffle.plugin.js"
"coverage": "truffle.plugin.js"
}
}