This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 563
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update test scripts and actions (#657)
* Update test scripts and CI * Update timeout * Update test-helper * fix issue for staking test * fix bug in test helper * reduce block time * Update test cases * use truffle 5.4.14 as global * remove two checks * reduce block time to 150ms * fix patches paths * Update test scripts Co-authored-by: Federico Kunze Küllmer <[email protected]>
- Loading branch information
1 parent
f70e4c1
commit 8bf8d34
Showing
21 changed files
with
3,491 additions
and
1,671 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,7 +78,11 @@ jobs: | |
|
||
test-solidity: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
timeout-minutes: 240 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
batch: ['1-3', '2-3', '3-3'] | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: actions/setup-go@v2 | ||
|
@@ -96,7 +100,7 @@ jobs: | |
go.sum | ||
- name: test-solidity | ||
run: | | ||
make test-solidity | ||
./scripts/run-solidity-tests.sh --batch=${{ matrix.batch }} | ||
if: "env.GIT_DIFF != ''" | ||
|
||
liveness-test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ else | |
yarn install | ||
fi | ||
|
||
yarn test --network ethermint | ||
yarn test --network ethermint $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/node_modules/truffle/build/459.bundled.js b/node_modules/truffle/build/459.bundled.js | ||
index a206402..72962d6 100644 | ||
--- a/node_modules/truffle/build/459.bundled.js | ||
+++ b/node_modules/truffle/build/459.bundled.js | ||
@@ -19843,16 +19843,23 @@ const reason = { | ||
|
||
if (isObject) { | ||
const data = res.error.data; | ||
- const hash = Object.keys(data)[0]; | ||
+ if (typeof data === "object") { | ||
+ const hash = Object.keys(data)[0]; | ||
|
||
- if (data[hash].return && data[hash].return.includes(errorStringHash)) { | ||
- try { | ||
- return web3.eth.abi.decodeParameter( | ||
- "string", | ||
- data[hash].return.slice(10) | ||
- ); | ||
- } catch (_) { | ||
- return undefined; | ||
+ if (data[hash].return && data[hash].return.includes(errorStringHash)) { | ||
+ try { | ||
+ return web3.eth.abi.decodeParameter( | ||
+ "string", | ||
+ data[hash].return.slice(10) | ||
+ ); | ||
+ } catch (_) { | ||
+ return undefined; | ||
+ } | ||
+ } | ||
+ } | ||
+ else { | ||
+ if (res.error.message) { | ||
+ return res.error.message; | ||
} | ||
} | ||
} else if (isString && res.result.includes(errorStringHash)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/solidity/suites/staking/patches/@aragon+contract-helpers-test+0.0.3.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/node_modules/@aragon/contract-helpers-test/assertThrow.js b/node_modules/@aragon/contract-helpers-test/assertThrow.js | ||
index 5125356..88a8f63 100644 | ||
--- a/node_modules/@aragon/contract-helpers-test/assertThrow.js | ||
+++ b/node_modules/@aragon/contract-helpers-test/assertThrow.js | ||
@@ -1,5 +1,5 @@ | ||
const REVERT_CODE = 'revert' | ||
-const THROW_ERROR_PREFIX = 'Returned error: VM Exception while processing transaction:' | ||
+const THROW_ERROR_PREFIX = 'VM Exception while processing transaction:' | ||
|
||
function assertError(error, expectedErrorCode) { | ||
assert(error.message.search(expectedErrorCode) > -1, `Expected error code "${expectedErrorCode}" but failed with "${error}" instead.`) | ||
@@ -41,7 +41,9 @@ module.exports = { | ||
} | ||
|
||
if (process.env.SOLIDITY_COVERAGE !== 'true' && reason) { | ||
- assert.equal(error.reason, reason, `Expected revert reason "${reason}" but failed with "${error.reason || 'no reason'}" instead.`) | ||
+ if (!error.reason.includes(reason)) { | ||
+ assert.fail(`Expected revert reason includes "${reason}" but failed with "${error.reason || 'no reason'}" instead.`); | ||
+ } | ||
} | ||
}, | ||
} |
37 changes: 37 additions & 0 deletions
37
tests/solidity/suites/staking/patches/truffle+5.4.14.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
diff --git a/node_modules/truffle/build/459.bundled.js b/node_modules/truffle/build/459.bundled.js | ||
index a206402..72962d6 100644 | ||
--- a/node_modules/truffle/build/459.bundled.js | ||
+++ b/node_modules/truffle/build/459.bundled.js | ||
@@ -19843,16 +19843,23 @@ const reason = { | ||
|
||
if (isObject) { | ||
const data = res.error.data; | ||
- const hash = Object.keys(data)[0]; | ||
+ if (typeof data === "object") { | ||
+ const hash = Object.keys(data)[0]; | ||
|
||
- if (data[hash].return && data[hash].return.includes(errorStringHash)) { | ||
- try { | ||
- return web3.eth.abi.decodeParameter( | ||
- "string", | ||
- data[hash].return.slice(10) | ||
- ); | ||
- } catch (_) { | ||
- return undefined; | ||
+ if (data[hash].return && data[hash].return.includes(errorStringHash)) { | ||
+ try { | ||
+ return web3.eth.abi.decodeParameter( | ||
+ "string", | ||
+ data[hash].return.slice(10) | ||
+ ); | ||
+ } catch (_) { | ||
+ return undefined; | ||
+ } | ||
+ } | ||
+ } | ||
+ else { | ||
+ if (res.error.message) { | ||
+ return res.error.message; | ||
} | ||
} | ||
} else if (isString && res.result.includes(errorStringHash)) { |
Oops, something went wrong.