Skip to content

Commit 33b33f9

Browse files
authored
Moloch E2E (#439)
1 parent 404c73d commit 33b33f9

File tree

2 files changed

+52
-15
lines changed

2 files changed

+52
-15
lines changed

.circleci/config.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: 2.0
2-
# Necessary for running in machine mode, which is necessary to execute the
3-
# Zeppelin and MetaCoin E2E scripts
2+
3+
# Necessary for running in machine mode,
4+
# which is necessary to execute the E2E scripts
45
step_install_nvm: &step_install_nvm
56
run:
67
name: "Install nvm for machine"
@@ -12,6 +13,7 @@ step_install_nvm: &step_install_nvm
1213
nvm alias default v8.15.0
1314
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
1415
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
16+
1517
jobs:
1618
unit-test:
1719
machine: true
@@ -82,6 +84,15 @@ jobs:
8284
name: Buidler E2E
8385
command: |
8486
./scripts/run-buidler.sh
87+
e2e-moloch:
88+
machine: true
89+
steps:
90+
- checkout
91+
- <<: *step_install_nvm
92+
- run:
93+
name: Moloch E2E
94+
command: |
95+
./scripts/run-moloch.sh
8596
workflows:
8697
version: 2
8798
build:
@@ -90,16 +101,4 @@ workflows:
90101
- e2e-zeppelin
91102
- e2e-metacoin
92103
- e2e-buidler
93-
# TODO: re-enable.
94-
# At the moment we're using forks so this is pointless
95-
#nightly:
96-
# triggers:
97-
# - schedule:
98-
# cron: "0 1 * * *" # 1am UTC
99-
# filters:
100-
# branches:
101-
# only:
102-
# - master
103-
# jobs:
104-
#- e2e-zeppelin
105-
#- e2e-colony
104+
- e2e-moloch

scripts/run-moloch.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/env bash
2+
#
3+
# E2E CI: installs PR candidate on sc-forks/buidler-e2e (a simple example,
4+
# similar to Metacoin) and runs coverage
5+
#
6+
7+
set -o errexit
8+
9+
# Get rid of any caches
10+
sudo rm -rf node_modules
11+
echo "NVM CURRENT >>>>>" && nvm current
12+
13+
# Use PR env variables (for forks) or fallback on local if PR not available
14+
SED_REGEX="s/[email protected]:/https:\/\/github.com\//"
15+
16+
if [[ -v CIRCLE_PR_REPONAME ]]; then
17+
PR_PATH="https://github.com/$CIRCLE_PR_USERNAME/$CIRCLE_PR_REPONAME#$CIRCLE_SHA1"
18+
else
19+
PR_PATH=$(echo "$CIRCLE_REPOSITORY_URL#$CIRCLE_SHA1" | sudo sed "$SED_REGEX")
20+
fi
21+
22+
echo "PR_PATH >>>>> $PR_PATH"
23+
24+
# Install buidler e2e test
25+
git clone https://github.com/sc-forks/moloch.git
26+
cd moloch
27+
npm install
28+
npm uninstall --save-dev solidity-coverage
29+
30+
# Install and run solidity-coverage @ PR
31+
npm install --save-dev $PR_PATH
32+
npm run coverage
33+
34+
# Test that coverage/ was generated
35+
if [ ! -d "coverage" ]; then
36+
echo "ERROR: no coverage folder was created."
37+
exit 1
38+
fi

0 commit comments

Comments
 (0)