Skip to content

Commit 25ef9d6

Browse files
authored
test: refactor folder structure and minor tweaks (#904)
* test: refactor folder structure and minor tweaks (#904) Signed-off-by: Tomás Migone <[email protected]>
1 parent 8210a6f commit 25ef9d6

File tree

91 files changed

+125
-133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+125
-133
lines changed

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
paths:
1010
- packages/contracts/contracts/**
1111
- packages/contracts/config/**
12-
- packages/contracts/e2e/**
12+
- packages/contracts/test/e2e/**
1313
- packages/contracts/tasks/**
1414
- packages/contracts/scripts/**
1515
- packages/contracts/hardhat.config.ts
@@ -18,7 +18,7 @@ on:
1818
paths:
1919
- packages/contracts/contracts/**
2020
- packages/contracts/config/**
21-
- packages/contracts/e2e/**
21+
- packages/contracts/test/e2e/**
2222
- packages/contracts/tasks/**
2323
- packages/contracts/scripts/**
2424
- packages/contracts/hardhat.config.ts

packages/contracts/TESTING.md

Lines changed: 2 additions & 2 deletions

packages/contracts/hardhat.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const DEFAULT_L2_TEST_MNEMONIC =
119119
const config: HardhatUserConfig = {
120120
paths: {
121121
sources: './contracts',
122-
tests: './test',
122+
tests: './test/unit',
123123
artifacts: './build/contracts',
124124
},
125125
solidity: {

packages/contracts/tasks/e2e/e2e.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { runScriptWithHardhat } from 'hardhat/internal/util/scripts-runner'
77
import { isGraphL1ChainId } from '@graphprotocol/sdk'
88
import { GRE_TASK_PARAMS } from '@graphprotocol/sdk/gre'
99

10-
const CONFIG_TESTS = 'e2e/deployment/config/**/*.test.ts'
11-
const INIT_TESTS = 'e2e/deployment/init/**/*.test.ts'
10+
const CONFIG_TESTS = 'test/e2e/deployment/config/**/*.test.ts'
11+
const INIT_TESTS = 'test/e2e/deployment/init/**/*.test.ts'
1212

1313
// Built-in test & run tasks don't support GRE arguments
1414
// so we pass them by overriding GRE config object
@@ -47,7 +47,7 @@ task('e2e', 'Run all e2e tests')
4747
]
4848

4949
if (args.skipBridge) {
50-
testFiles = testFiles.filter((file) => !['l1', 'l2'].includes(file.split('/')[3]))
50+
testFiles = testFiles.filter((file) => !/l1|l2/.test(file))
5151
}
5252

5353
// Disable secure accounts, we don't need them for this task
@@ -104,8 +104,8 @@ task('e2e:scenario', 'Run scenario scripts and e2e tests')
104104
.setAction(async (args, hre: HardhatRuntimeEnvironment) => {
105105
setGraphConfig(args, hre)
106106

107-
const script = `e2e/scenarios/${args.scenario}.ts`
108-
const test = `e2e/scenarios/${args.scenario}.test.ts`
107+
const script = `test/e2e/scenarios/${args.scenario}.ts`
108+
const test = `test/e2e/scenarios/${args.scenario}.test.ts`
109109

110110
console.log(`> Running scenario: ${args.scenario}`)
111111
console.log(`- script file: ${script}`)
@@ -149,8 +149,8 @@ task('e2e:upgrade', 'Run upgrade tests')
149149
})
150150

151151
async function runUpgrade(args: any, hre: HardhatRuntimeEnvironment, type: 'pre' | 'post') {
152-
const script = `e2e/upgrades/${args.upgrade}/${type}-upgrade.ts`
153-
const test = `e2e/upgrades/${args.upgrade}/${type}-upgrade.test.ts`
152+
const script = `test/e2e/upgrades/${args.upgrade}/${type}-upgrade.ts`
153+
const test = `test/e2e/upgrades/${args.upgrade}/${type}-upgrade.test.ts`
154154

155155
console.log(`> Running ${type}-upgrade: ${args.upgrade}`)
156156
console.log(`- script file: ${script}`)

0 commit comments

Comments
 (0)