Skip to content

Commit 0163318

Browse files
committed
Full run e2e on every branch
1 parent 7cccb24 commit 0163318

8 files changed

Lines changed: 16 additions & 54 deletions

File tree

.github/workflows/build-lint-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ jobs:
2020
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
node-version: [18.x, 20.x, 22.x]
23+
node-version: [20.x, 22.x]
2424
steps:
2525
- name: Checkout and setup environment
2626
uses: MetaMask/action-checkout-and-setup@v1
2727
with:
2828
is-high-risk-environment: false
29-
cache-node-modules: ${{ matrix.node-version == '22.x' }}
29+
cache-node-modules: true
3030
submodules: 'recursive'
3131

3232
- name: Install Foundry

.github/workflows/end-to-end-tests.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,21 @@ on:
1313
NPM_CLIENT:
1414
type: string
1515
default: 'yarn'
16-
RUN_FULL_TESTS:
17-
type: boolean
18-
default: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') }}
1916
workflow_dispatch:
20-
inputs:
21-
RUN_FULL_TESTS:
22-
type: boolean
23-
default: true
2417

2518
jobs:
2619
pipeline:
2720
name: Turbo Pipeline
2821
runs-on: ubuntu-latest
2922
strategy:
3023
matrix:
31-
node-version: [18.x, 20.x]
24+
node-version: [20.x, 22.x]
3225
steps:
3326
- name: Checkout and setup environment
3427
uses: MetaMask/action-checkout-and-setup@v1
3528
with:
3629
is-high-risk-environment: false
37-
cache-node-modules: ${{ matrix.node-version == '22.x' }}
30+
cache-node-modules: true
3831
submodules: 'recursive'
3932

4033
- name: Install Foundry
@@ -60,9 +53,4 @@ jobs:
6053
NODE_ENV: production
6154

6255
- name: Run end-to-end tests
63-
run: |
64-
if [[ "${{ inputs.RUN_FULL_TESTS }}" == "true" ]]; then
65-
yarn e2etest:full
66-
else
67-
yarn e2etest:smoketest
68-
fi
56+
run: yarn test:e2e

.github/workflows/main.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ jobs:
8383
with:
8484
commit-starts-with: 'Release [version],Release v[version],Release/[version],Release/v[version],Release `[version]`'
8585

86-
8786
publish-release:
8887
needs: is-release
8988
if: needs.is-release.outputs.IS_RELEASE == 'true'

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ yarn test
4242
Run the `delegator-e2e` integration test suite:
4343

4444
```sh
45-
yarn e2etest:full
45+
yarn e2etest
4646
```
4747

4848
# Contributing

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"generate:abi": "cd ./shared/abi/scripts && ./generate-abi.sh",
2424
"lint": "turbo lint",
2525
"test": "turbo run test --filter='!./packages/delegator-e2e'",
26-
"e2etest:full": "turbo run e2etest:full --filter='./packages/delegator-e2e'",
27-
"e2etest:smoketest": "turbo run e2etest:smoketest --filter='./packages/delegator-e2e'",
26+
"test:e2e": "turbo run test:e2e --filter='./packages/delegator-e2e'",
2827
"test:watch": "turbo run test:watch"
2928
},
3029
"devDependencies": {

packages/delegator-e2e/README.md

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ When developing end-to-end tests, you can run step 2 repeatedly without having t
2020

2121
### Test Types
2222

23-
There are two types of test suites available:
24-
25-
- **Full Tests** (`yarn e2etest:full`): Runs the complete test suite including all test cases. This is used in the main branch and release branches to ensure comprehensive testing.
26-
- **Smoke Tests** (`yarn e2etest:smoketest`): Runs only the main test cases, skipping edge cases and alternative scenarios. This is used in feature branches for faster feedback during development.
23+
The end-to-end test suite runs the complete test suite including all test cases using `yarn test:e2e`.
2724

2825
## Adding tests
2926

@@ -42,7 +39,7 @@ Some guidelines for creating tests:
4239

4340
### Test Structure
4441

45-
When creating a test file, follow this structure to support both full and smoke test runs:
42+
When creating a test file, follow this structure:
4643

4744
```typescript
4845
import { beforeEach, expect, test } from 'vitest';
@@ -63,12 +60,10 @@ beforeEach(async () => {
6360
- Any important context
6461
*/
6562

66-
// Main test case that will run in both full and smoke tests
67-
test('maincase: Description of the main functionality', async () => {
63+
test('Description of the main functionality', async () => {
6864
...
6965
});
7066

71-
// Additional test cases that will only run in full test suite
7267
test('Description of edge case or alternative scenario', async () => {
7368
...
7469
});
@@ -80,29 +75,15 @@ test('Description of failure case', async () => {
8075

8176
Key points about test structure:
8277

83-
1. **Main Test Case**:
84-
- Prefix the main test case with `maincase:` in the test description
85-
- This test will run in both full and smoke test suites
86-
- Should cover the primary happy path functionality
87-
88-
2. **Additional Test Cases**:
89-
- These will only run in the full test suite
90-
- Can include:
91-
- Edge cases
92-
- Alternative scenarios
93-
- Failure cases
94-
95-
3. **Test Organization**:
78+
1. **Test Organization**:
9679
- Use `beforeEach` for common setup
9780
- Group related assertions together
9881
- Use descriptive test names that explain the scenario
9982
- Include a block comment describing the user story
10083

101-
4. **Common Patterns**:
84+
2. **Common Patterns**:
10285
- Use helper functions from `utils/helpers.ts` for common operations
10386
- Use assertion functions from `utils/assertions.ts` for consistent validation
10487
- Generate unique addresses and keys for each test
10588
- Clean up state in `beforeEach` to ensure test isolation
106-
- `runTest_expectSuccess` and `runTest_expectFailure` to abstract common functionality out of each test within the file
107-
108-
The smoke test runner will only execute tests with `maincase:` in their description, while the full test runner will execute all test cases. This allows for quick feedback during development while maintaining comprehensive testing in the main and release branches.
89+
- `runTest_expectSuccess` and `runTest_expectFailure` to abstract common functionality out of each test within the file

packages/delegator-e2e/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@
1414
"scripts": {
1515
"build": "cd contracts && forge build && cd ..",
1616
"setup": "yarn build && docker compose up -d && npx tsx src/await-dependencies.ts",
17-
"run-test:full": "npx vitest run",
18-
"run-test:smoketest": "npx vitest run --testNamePattern maincase",
19-
"e2etest:full": "yarn setup && yarn run-test:full; EXIT_CODE=$?; yarn teardown; exit $EXIT_CODE",
20-
"e2etest:smoketest": "yarn setup && yarn run-test:smoketest; EXIT_CODE=$?; yarn teardown; exit $EXIT_CODE",
17+
"test": "npx vitest run",
18+
"test:e2e": "yarn setup && yarn test; EXIT_CODE=$?; yarn teardown; exit $EXIT_CODE",
2119
"teardown": "docker compose down"
2220
},
2321
"peerDependencies": {

turbo.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@
1313
"test": {
1414
"dependsOn": ["^build", "^test"]
1515
},
16-
"e2etest:full": {
17-
"dependsOn": ["^build"]
18-
},
19-
"e2etest:smoketest": {
16+
"test:e2e": {
2017
"dependsOn": ["^build"]
2118
},
2219
"test:watch": {

0 commit comments

Comments
 (0)