-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ethers wrapped provider data collection / re-enable independent n…
…ode tests (#30)
- Loading branch information
Showing
7 changed files
with
93 additions
and
8 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 |
---|---|---|
@@ -1,9 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
trap cleanup EXIT | ||
|
||
# Truffle tests | ||
cleanup() { | ||
if [ -n "$ganache_pid" ] && ps -p $ganache_pid > /dev/null; then | ||
echo "Killing ganache." | ||
kill -9 $ganache_pid | ||
fi | ||
|
||
if [ -n "$buidlerevm_pid" ] && ps -p $buidlerevm_pid > /dev/null; then | ||
echo "Killing buidlerevm." | ||
kill -9 $buidlerevm_pid | ||
fi | ||
} | ||
|
||
start_ganache() { | ||
echo "Launching ganache..." | ||
node_modules/.bin/ganache-cli > /dev/null & | ||
ganache_pid=$! | ||
sleep 4 | ||
} | ||
|
||
start_buidlerevm() { | ||
echo "Launching buidlerevm..." | ||
node_modules/.bin/buidler node > /dev/null & | ||
buidlerevm_pid=$! | ||
sleep 4 | ||
} | ||
|
||
|
||
# Truffle + BuidlerEVM | ||
npx mocha test/truffle.ts --timeout 100000 --exit | ||
|
||
# Ethers tests | ||
# Ethers + BuidlerEVM | ||
npx mocha test/ethers.ts --timeout 100000 --exit | ||
|
||
# Ethers + Buidler Node | ||
start_buidlerevm | ||
npx mocha test/buidlerevm.node.ts --timeout 100000 --exit | ||
cleanup | ||
|
||
# Truffle + Ganache | ||
start_ganache | ||
npx mocha test/ganache.node.ts --timeout 100000 --exit |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { TASK_TEST } from "@nomiclabs/buidler/builtin-tasks/task-names"; | ||
// tslint:disable-next-line no-implicit-dependencies | ||
import { assert } from "chai"; | ||
import { useEnvironment } from "./helpers"; | ||
|
||
describe("Ethers plugin", function() { | ||
useEnvironment(__dirname + "/buidler-ethers-project", "localhost"); | ||
|
||
it("no options", async function() { | ||
await this.env.run(TASK_TEST, { testFiles: [] }); | ||
}); | ||
}); |
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,14 @@ | ||
import { TASK_TEST } from "@nomiclabs/buidler/builtin-tasks/task-names"; | ||
// tslint:disable-next-line no-implicit-dependencies | ||
import { assert } from "chai"; | ||
|
||
import { useEnvironment } from "./helpers"; | ||
|
||
describe("Truffle plugin", function() { | ||
useEnvironment(__dirname + "/buidler-truffle-project", "development"); | ||
|
||
it("default", async function() { | ||
this.env.config.gasReporter.onlyCalledMethods = true; | ||
await this.env.run(TASK_TEST, { testFiles: [] }); | ||
}); | ||
}); |
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