Merge pull request #10429 from ethereum/fix-and-enable-external-tests

Fix and enable external tests
This commit is contained in:
chriseth
2020-12-07 16:48:44 +01:00
committed by GitHub
8 changed files with 147 additions and 31 deletions
+1
View File
@@ -44,6 +44,7 @@ printTask "Running external tests..."
"$REPO_ROOT/externalTests/zeppelin.sh" "$SOLJSON"
"$REPO_ROOT/externalTests/gnosis.sh" "$SOLJSON"
"$REPO_ROOT/externalTests/gnosis-v2.sh" "$SOLJSON"
"$REPO_ROOT/externalTests/colony.sh" "$SOLJSON"
"$REPO_ROOT/externalTests/ens.sh" "$SOLJSON"
+2 -2
View File
@@ -33,12 +33,12 @@ function colony_test
OPTIMIZER_LEVEL=3
CONFIG="truffle.js"
truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/colonyNetwork.git develop_070
truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/colonyNetwork.git develop_070_new
run_install "$SOLJSON" install_fn
cd lib
rm -Rf dappsys
git clone https://github.com/solidity-external-tests/dappsys-monolithic.git -b master_060 dappsys
git clone https://github.com/solidity-external-tests/dappsys-monolithic.git -b master_070 dappsys
cd ..
truffle_run_test "$SOLJSON" compile_fn test_fn
+3 -7
View File
@@ -109,13 +109,6 @@ function replace_version_pragmas
find . test -name '*.sol' -type f -print0 | xargs -0 sed -i -E -e 's/pragma solidity [^;]+;/pragma solidity >=0.0;/'
}
function replace_libsolc_call
{
# Change "compileStandard" to "compile" (needed for pre-5.x Truffle)
printLog "Replacing libsolc compile call in Truffle..."
sed -i s/solc.compileStandard/solc.compile/ "node_modules/truffle/build/cli.bundled.js"
}
function find_truffle_config
{
local config_file="truffle.js"
@@ -142,6 +135,9 @@ function force_solc_truffle_modules
rm -rf solc
git clone --depth 1 -b master https://github.com/ethereum/solc-js.git solc
cp "$1" solc/soljson.js
cd solc
npm install
fi
)
done
+3
View File
@@ -38,6 +38,9 @@ function ens_test
# Use latest Truffle. Older versions crash on the output from 0.8.0.
force_truffle_version ^5.1.55
# Remove the lock file (if it exists) to prevent it from overriding our changes in package.json
rm -f package-lock.json
run_install "$SOLJSON" install_fn
truffle_run_test "$SOLJSON" compile_fn test_fn
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env bash
# ------------------------------------------------------------------------------
# This file is part of solidity.
#
# solidity is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# solidity is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with solidity. If not, see <http://www.gnu.org/licenses/>
#
# (c) 2020 solidity contributors.
#------------------------------------------------------------------------------
source scripts/common.sh
source test/externalTests/common.sh
verify_input "$1"
SOLJSON="$1"
function install_fn { npm install --package-lock; }
function compile_fn { npx truffle compile; }
function test_fn { npm test; }
function gnosis_safe_test
{
OPTIMIZER_LEVEL=1
CONFIG="truffle-config.js"
truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/safe-contracts.git v2_070
sed -i 's|github:gnosis/mock-contract#sol_0_5_0|github:solidity-external-tests/mock-contract#master_070_new|g' package.json
sed -i -E 's|"@gnosis.pm/util-contracts": "[^"]+"|"@gnosis.pm/util-contracts": "github:solidity-external-tests/util-contracts#solc-7"|g' package.json
# Remove the lock file (if it exists) to prevent it from overriding our changes in package.json
rm -f package-lock.json
run_install "$SOLJSON" install_fn
truffle_run_test "$SOLJSON" compile_fn test_fn
}
external_test Gnosis-Safe gnosis_safe_test
+5 -6
View File
@@ -31,17 +31,16 @@ function test_fn { npm test; }
function gnosis_safe_test
{
OPTIMIZER_LEVEL=1
CONFIG="truffle.js"
CONFIG="truffle-config.js"
truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/safe-contracts.git development_070
truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/safe-contracts.git development_070_new
force_truffle_version ^5.0.42
sed -i 's|github:gnosis/mock-contract#sol_0_5_0|github:solidity-external-tests/mock-contract#master_070|g' package.json
sed -i 's|github:gnosis/mock-contract#sol_0_5_0|github:solidity-external-tests/mock-contract#master_070_new|g' package.json
# Remove the lock file (if it exists) to prevent it from overriding our changes in package.json
rm -f package-lock.json
rm -rf node_modules/
run_install "$SOLJSON" install_fn
replace_libsolc_call
truffle_run_test "$SOLJSON" compile_fn test_fn
}
+1 -1
View File
@@ -33,7 +33,7 @@ function zeppelin_test
OPTIMIZER_LEVEL=1
CONFIG="truffle-config.js"
truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/openzeppelin-contracts.git upgrade-0.7.0
truffle_setup "$SOLJSON" https://github.com/solidity-external-tests/openzeppelin-contracts.git master_070
run_install "$SOLJSON" install_fn
truffle_run_test "$SOLJSON" compile_fn test_fn