Skip to content

Commit

Permalink
fix(e2e): allow skipping bridge tests
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Migone <[email protected]>
  • Loading branch information
tmigone committed Nov 2, 2022
1 parent e9cab36 commit 7eb7ba2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 10 additions & 3 deletions scripts/e2e
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ function test_e2e () {
local NETWORK=$1
local GRAPH_CONFIG=$2
local ADDRESS_BOOK=$3
local SKIP_BRIDGE_TESTS=$4

npx hardhat e2e --network "$NETWORK" --graph-config "$GRAPH_CONFIG" --address-book "$ADDRESS_BOOK"
if [[ -z "$SKIP_BRIDGE_TESTS" ]]; then
npx hardhat e2e --network "$NETWORK" --graph-config "$GRAPH_CONFIG" --address-book "$ADDRESS_BOOK"
else
npx hardhat e2e --network "$NETWORK" --graph-config "$GRAPH_CONFIG" --address-book "$ADDRESS_BOOK" --skip-bridge
fi
}

function test_e2e_scenarios () {
Expand Down Expand Up @@ -177,8 +182,10 @@ fi

## TEST
# Run e2e tests
test_e2e "$L1_NETWORK" "$L1_GRAPH_CONFIG" "$ADDRESS_BOOK"
if [[ -n "$L2_NETWORK" ]]; then
if [[ -z "$L2_NETWORK" ]]; then
test_e2e "$L1_NETWORK" "$L1_GRAPH_CONFIG" "$ADDRESS_BOOK" true
else
test_e2e "$L1_NETWORK" "$L1_GRAPH_CONFIG" "$ADDRESS_BOOK"
test_e2e "$L2_NETWORK" "$L2_GRAPH_CONFIG" "$ADDRESS_BOOK"
fi

Expand Down
7 changes: 6 additions & 1 deletion tasks/e2e/e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ const setGraphConfig = async (args: TaskArguments, hre: HardhatRuntimeEnvironmen
task('e2e', 'Run all e2e tests')
.addOptionalParam('graphConfig', cliOpts.graphConfig.description)
.addOptionalParam('addressBook', cliOpts.addressBook.description)
.addFlag('skipBridge', 'Skip bridge tests')
.setAction(async (args, hre: HardhatRuntimeEnvironment) => {
const testFiles = [
let testFiles = [
...new glob.GlobSync(CONFIG_TESTS).found,
...new glob.GlobSync(INIT_TESTS).found,
]

if (args.skipBridge) {
testFiles = testFiles.filter((file) => !['l1', 'l2'].includes(file.split('/')[3]))
}

setGraphConfig(args, hre)
await hre.run(TASK_TEST, {
testFiles: testFiles,
Expand Down

0 comments on commit 7eb7ba2

Please sign in to comment.