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
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ matrix:
sudo: required
compiler: gcc
node_js:
- "6"
- "7"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should upgrade to 8 instead, see #3485

services:
- docker
before_install:
- nvm install 6
- nvm use 6
- nvm install 7
- nvm use 7
- docker pull trzeci/emscripten:sdk-tag-1.35.4-64bit
env:
- SOLC_EMSCRIPTEN=On
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
export NVM_DIR="/usr/local/nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm --version
nvm install 6
nvm install 7
node --version
npm --version
- run:
Expand Down
45 changes: 28 additions & 17 deletions test/externalTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,32 @@ fi

SOLJSON="$1"

DIR=$(mktemp -d)
(
echo "Running Zeppelin tests..."
git clone --depth 1 https://github.com/OpenZeppelin/zeppelin-solidity.git "$DIR"
cd "$DIR"
function test_truffle
{
name="$1"
repo="$2"
echo "Running $name tests..."
DIR=$(mktemp -d)
(
git clone --depth 1 "$repo" "$DIR"
cd "$DIR"
npm install
find . -name soljson.js -exec cp "$SOLJSON" {} \;
if [ "$name" == "Zeppelin" ]; then
# Fix some things that look like bugs (only seemed to fail on Node 6 and not Node 8)
# FIXME: report upstream or to web3.js?
sed -i -e 's/let token = await ERC827TokenMock.new();//;' test/token/ERC827/ERC827Token.js
sed -i -e 's/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0)/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address)/' test/crowdsale/CappedCrowdsale.test.js
sed -i -e 's/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, { from: owner })/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address, { from: owner })/' test/crowdsale/RefundableCrowdsale.test.js
fi
if [ "$name" == "Gnosis" ]; then
# Replace fixed-version pragmas in Gnosis (part of Consensys best practice)
find contracts test -name '*.sol' -type f -print0 | xargs -0 sed -i -e 's/pragma solidity 0/pragma solidity ^0/'
fi
npm run test
)
rm -rf "$DIR"
}

# Fix some things that look like bugs (only seemed to fail on Node 6 and not Node 8)
# FIXME: report upstream or to web3.js?
sed -i -e 's/let token = await ERC827TokenMock.new();//;' test/token/ERC827/ERC827Token.js
sed -i -e 's/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0)/CappedCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address)/' test/crowdsale/CappedCrowdsale.test.js
sed -i -e 's/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, { from: owner })/RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, this.token.address, { from: owner })/' test/crowdsale/RefundableCrowdsale.test.js

npm install
find . -name soljson.js -exec cp "$SOLJSON" {} \;

npm run test
)
rm -rf "$DIR"
test_truffle Gnosis https://github.com/gnosis/gnosis-contracts.git
test_truffle Zeppelin https://github.com/OpenZeppelin/zeppelin-solidity.git