Skip to content

rename fork tests #2095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
14 changes: 11 additions & 3 deletions contracts/fork-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,21 @@ main()

if [ -z "$1" ]; then
if [[ $FORK_NETWORK_NAME == "holesky" ]]; then
# Run all files with `.holesky.fork-test.js` suffix when no file name param is given
# Run all files with `.holesky.fork.js` suffix when no file name param is given
# pass all other params along
params+="test/**/*.holesky.fork-test.js"
params+="test/**/*.holesky.fork.js"
elif [[ $FORK_NETWORK_NAME == "arbitrumOne" ]]; then
# Run all files with `.arb.fork.js` suffix when no file name param is given
# pass all other params along
params+="test/**/*.arb.fork.js"
elif [[ $FORK_NETWORK_NAME == "base" ]]; then
# Run all files with `.base.fork.js` suffix when no file name param is given
# pass all other params along
params+="test/**/*.base.fork.js"
else
# Run all files with `.fork-test.js` suffix when no file name param is given
# pass all other params along
params+="test/**/*.fork-test.js"
params+="test/**/*.fork.js"
fi
else
# Run specifc files when a param is given
Expand Down
10 changes: 5 additions & 5 deletions contracts/test/_global-hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ mocha.before(function () {
// If you are running unit tests, scrape out all fork tests.
// For fork tests, scrape out all unit tests.
root.suites = root.suites.filter((s) => {
const isMainnetForkTestFile = s.file.endsWith("mainnet.fork-test.js");
const isHoleskyTestFile = s.file.endsWith(".holesky.fork-test.js");
const isArbTestFile = s.file.endsWith(".arb.fork-test.js");
const isBaseTestFile = s.file.endsWith(".base.fork-test.js");
const unitTest = !s.file.endsWith(".fork-test.js");
const isMainnetForkTestFile = s.file.endsWith("mainnet.fork.js");
const isHoleskyTestFile = s.file.endsWith(".holesky.fork.js");
const isArbTestFile = s.file.endsWith(".arb.fork.js");
const isBaseTestFile = s.file.endsWith(".base.fork.js");
const unitTest = !s.file.endsWith(".fork.js");

if (isArbFork) {
return isArbTestFile;
Expand Down