From 407ec47d669d01d080d0f9e5989163ef0c3acfb5 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 10 Oct 2018 11:44:47 +0530 Subject: [PATCH 1/4] Updated test script --- scripts/test.sh | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index bfbd4f842..348849be8 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -94,20 +94,11 @@ else fi if ! [ -z "${TRAVIS_PULL_REQUEST+x}" ] && [ "$TRAVIS_PULL_REQUEST" != false ]; then - mkdir tempPoly - mv contracts/modules/TransferManager/SingleTradeVolumeRestrictionManager.sol tempPoly/SingleTradeVolumeRestrictionManager.sol - mv contracts/modules/TransferManager/SingleTradeVolumeRestrictionManagerFactory.sol tempPoly/SingleTradeVolumeRestrictionManagerFactory.sol - mv test/x_single_trade_volume_restriction.js tempPoly/x_single_trade_volume_restriction.js + wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/master/lib/app.js node_modules/.bin/solidity-coverage - if [ "$CONTINUOUS_INTEGRATION" = true ]; then cat coverage/lcov.info | node_modules/.bin/coveralls fi - - mv tempPoly/SingleTradeVolumeRestrictionManager.sol contracts/modules/TransferManager/SingleTradeVolumeRestrictionManager.sol - mv tempPoly/SingleTradeVolumeRestrictionManagerFactory.sol contracts/modules/TransferManager/SingleTradeVolumeRestrictionManagerFactory.sol - mv tempPoly/x_single_trade_volume_restriction.js test/x_single_trade_volume_restriction.js - rm -rf tempPoly else # Do not run a_poly_oracle,js tests unless it is a cron job from travis if [ "$TRAVIS_EVENT_TYPE" = "cron" ]; then @@ -115,4 +106,4 @@ else else node_modules/.bin/truffle test `find test/*.js ! -name a_poly_oracle.js -and ! -name s_v130_to_v140_upgrade.js` fi -fi +fi \ No newline at end of file From 5369c9f513551daacf2ea58f2a547643847fb42e Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 10 Oct 2018 12:09:46 +0530 Subject: [PATCH 2/4] Updated travis script --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index ef6406947..8ac7d5ba9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ before_install: - sudo apt-get -y install solc before_script: - truffle version + - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/master/lib/app.js script: - npm run test notifications: From 987c7d5f86318e196f2613c416e785537aefc1bc Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 10 Oct 2018 12:27:11 +0530 Subject: [PATCH 3/4] Mac Compatibility --- .travis.yml | 2 +- scripts/test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8ac7d5ba9..14c03d06b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: - sudo apt-get -y install solc before_script: - truffle version - - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/master/lib/app.js + - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js script: - npm run test notifications: diff --git a/scripts/test.sh b/scripts/test.sh index 348849be8..6dd3ce95a 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -94,7 +94,7 @@ else fi if ! [ -z "${TRAVIS_PULL_REQUEST+x}" ] && [ "$TRAVIS_PULL_REQUEST" != false ]; then - wget -O node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/master/lib/app.js + curl -o node_modules/solidity-coverage/lib/app.js https://raw.githubusercontent.com/maxsam4/solidity-coverage/relative-path/lib/app.js node_modules/.bin/solidity-coverage if [ "$CONTINUOUS_INTEGRATION" = true ]; then cat coverage/lcov.info | node_modules/.bin/coveralls From eab90927fa378a21d7647335645976669a3c5af7 Mon Sep 17 00:00:00 2001 From: Mudit Gupta Date: Wed, 10 Oct 2018 14:11:46 +0530 Subject: [PATCH 4/4] Ignored mocks and oracles in test coverage --- .solcover.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.solcover.js b/.solcover.js index 65c10cd0f..f835b2835 100644 --- a/.solcover.js +++ b/.solcover.js @@ -4,5 +4,6 @@ module.exports = { copyPackages: ['openzeppelin-solidity'], testCommand: 'node ../node_modules/.bin/truffle test `find test/*.js ! -name a_poly_oracle.js -and ! -name s_v130_to_v140_upgrade.js` --network coverage', deepSkip: true, - skipFiles: ['external', 'flat', 'helpers'] + skipFiles: ['external', 'flat', 'helpers', 'mocks', 'oracles'], + forceParse: ['mocks', 'oracles'] }; \ No newline at end of file