Skip to content

Commit 472129e

Browse files
committed
test: Add new test job for dist tests
Add a new test workflow for E2E tests using `dist` builds. Currently this workflow has just one test suite in it, the vault decryption test. More will be added in later PRs. This was split out from #31435
1 parent 26e1b08 commit 472129e

File tree

7 files changed

+25
-5
lines changed

7 files changed

+25
-5
lines changed

.github/workflows/e2e-chrome.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ jobs:
7171
matrix-index: ${{ matrix.index }}
7272
matrix-total: ${{ strategy.job-total }}
7373

74-
test-e2e-chrome-vault-decryption:
74+
test-e2e-chrome-dist:
7575
# This if statement is equivalent to IS_FORK
7676
if: ${{ !(github.event.pull_request.head.repo.fork || github.event.repository.fork) }}
7777
uses: ./.github/workflows/run-e2e.yml
7878
with:
79-
test-suite-name: test-e2e-chrome-vault-decryption
79+
test-suite-name: test-e2e-chrome-dist
8080
build-artifact: build-dist-browserify
81-
test-command: yarn test:e2e:single test/e2e/vault-decryption-chrome.spec.ts --browser chrome
81+
test-command: yarn test:e2e:chrome:dist
8282

8383
test-e2e-chrome-api-specs:
8484
uses: ./.github/workflows/run-e2e.yml
@@ -169,7 +169,7 @@ jobs:
169169
- test-e2e-chrome-multiple-providers
170170
- test-e2e-chrome-rpc
171171
- test-e2e-chrome-flask
172-
- test-e2e-chrome-vault-decryption
172+
- test-e2e-chrome-dist
173173
- test-e2e-chrome-api-specs
174174
- test-e2e-chrome-api-specs-multichain
175175
runs-on: ubuntu-latest

.github/workflows/e2e-firefox.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,18 @@ jobs:
3636
matrix-index: ${{ matrix.index }}
3737
matrix-total: ${{ strategy.job-total }}
3838

39+
test-e2e-firefox-dist:
40+
uses: ./.github/workflows/run-e2e.yml
41+
with:
42+
test-suite-name: test-e2e-firefox-dist
43+
build-artifact: build-dist-mv2-browserify
44+
test-command: yarn test:e2e:firefox:dist
45+
3946
test-e2e-firefox-report:
4047
needs:
4148
- test-e2e-firefox-browserify
4249
- test-e2e-firefox-flask
50+
- test-e2e-firefox-dist
4351
runs-on: ubuntu-latest
4452
if: ${{ !cancelled() }}
4553
env:

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ jobs:
277277
e2e-firefox:
278278
needs:
279279
- needs-e2e
280+
- build-dist-mv2-browserify
280281
- build-test-mv2-browserify
281282
- build-test-flask-mv2-browserify
282283
if: ${{ needs.needs-e2e.outputs.needs-e2e == 'true' }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ app/.DS_Store
3333
storybook-build/
3434
coverage/
3535
jest-coverage/
36-
dist
36+
/dist
3737
builds*/
3838
builds.zip
3939
development/ts-migration-dashboard/build

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"test:integration": "yarn webpack-cli build --config ./development/webpack/webpack.integration.tests.config.ts && jest --config jest.integration.config.js",
5353
"test:integration:coverage": "yarn test:integration --coverage",
5454
"test:e2e:chrome": "SELENIUM_BROWSER=chrome tsx test/e2e/run-all.ts",
55+
"test:e2e:chrome:dist": "SELENIUM_BROWSER=chrome tsx test/e2e/run-all.ts --dist",
5556
"test:e2e:chrome:flask": "SELENIUM_BROWSER=chrome tsx test/e2e/run-all.ts --build-type flask",
5657
"test:e2e:chrome:webpack": "SELENIUM_BROWSER=chrome tsx test/e2e/run-all.ts",
5758
"test:api-specs": "SELENIUM_BROWSER=chrome tsx test/e2e/run-openrpc-api-test-coverage.ts",
@@ -63,6 +64,7 @@
6364
"test:e2e:chrome:rpc": "SELENIUM_BROWSER=chrome tsx test/e2e/run-all.ts --rpc",
6465
"test:e2e:chrome:multi-provider": "MULTIPROVIDER=true SELENIUM_BROWSER=chrome tsx test/e2e/run-all.ts --multi-provider",
6566
"test:e2e:firefox": "SELENIUM_BROWSER=firefox tsx test/e2e/run-all.ts",
67+
"test:e2e:firefox:dist": "SELENIUM_BROWSER=firefox tsx test/e2e/run-all.ts --dist",
6668
"test:e2e:firefox:flask": "SELENIUM_BROWSER=firefox tsx test/e2e/run-all.ts --build-type flask",
6769
"test:e2e:single": "node test/e2e/run-e2e-test.js",
6870
"ganache:start": "./development/run-ganache.sh",
File renamed without changes.

test/e2e/run-all.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ async function main(): Promise<void> {
9595
description: `run json-rpc specific e2e tests`,
9696
type: 'boolean',
9797
})
98+
.option('dist', {
99+
description: `run e2e tests for production-like builds`,
100+
type: 'boolean',
101+
})
98102
.option('multi-provider', {
99103
description: `run multi injected provider e2e tests`,
100104
type: 'boolean',
@@ -128,6 +132,7 @@ async function main(): Promise<void> {
128132
const {
129133
browser,
130134
debug,
135+
dist,
131136
retries,
132137
rpc,
133138
buildType,
@@ -137,6 +142,7 @@ async function main(): Promise<void> {
137142
} = argv as {
138143
browser?: 'chrome' | 'firefox';
139144
debug?: boolean;
145+
dist?: boolean;
140146
retries?: number;
141147
rpc?: boolean;
142148
buildType?: string;
@@ -161,6 +167,9 @@ async function main(): Promise<void> {
161167
...(await getTestPathsForTestDir(path.join(__dirname, 'flask'))),
162168
...featureTestsOnMain,
163169
];
170+
} else if (dist) {
171+
const testDir = path.join(__dirname, 'dist');
172+
testPaths = await getTestPathsForTestDir(testDir);
164173
} else if (rpc) {
165174
const testDir = path.join(__dirname, 'json-rpc');
166175
testPaths = await getTestPathsForTestDir(testDir);

0 commit comments

Comments
 (0)