Skip to content

Commit f8434b6

Browse files
jbedardclydin
authored andcommitted
test: ensure saucelabs tests are not excluded in CI
(cherry picked from commit 4c330b0)
1 parent e1c93b2 commit f8434b6

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

.circleci/dynamic_config.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ jobs:
237237
- run:
238238
name: Execute CLI E2E Tests with NPM
239239
command: |
240-
node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.snapshots >>--ng-snapshots<</ parameters.snapshots >> --tmpdir=/mnt/ramdisk/e2e
240+
node ./tests/legacy-cli/run_e2e --nb-shards=${CIRCLE_NODE_TOTAL} --shard=${CIRCLE_NODE_INDEX} <<# parameters.snapshots >>--ng-snapshots<</ parameters.snapshots >> --tmpdir=/mnt/ramdisk/e2e --ignore="tests/misc/browsers.ts"
241241
- when:
242242
condition:
243243
equal: ['esbuild', << parameters.subset >>]
@@ -259,8 +259,6 @@ jobs:
259259
test-browsers:
260260
executor:
261261
name: test-executor
262-
environment:
263-
E2E_BROWSERS: true
264262
resource_class: medium
265263
steps:
266264
- custom_attach_workspace
@@ -355,7 +353,7 @@ jobs:
355353
name: Execute E2E Tests
356354
command: |
357355
mkdir X:/ramdisk/e2e-main
358-
node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX --tmpdir=X:/ramdisk/e2e-main
356+
node tests\legacy-cli\run_e2e.js --nb-shards=$env:CIRCLE_NODE_TOTAL --shard=$env:CIRCLE_NODE_INDEX --tmpdir=X:/ramdisk/e2e-main --ignore="tests/misc/browsers.ts"
359357
- fail_fast
360358

361359
workflows:

tests/legacy-cli/e2e/tests/misc/browsers.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import { replaceInFile } from '../../utils/fs';
55
import { ng } from '../../utils/process';
66

77
export default async function () {
8-
if (!process.env['E2E_BROWSERS']) {
9-
return;
10-
}
11-
128
// Ensure SauceLabs configuration
139
if (!process.env['SAUCE_USERNAME'] || !process.env['SAUCE_ACCESS_KEY']) {
1410
throw new Error('SauceLabs is not configured.');

tests/legacy-cli/e2e/utils/process.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,15 @@ export function extractNpmEnv() {
169169
}, {});
170170
}
171171

172+
function extractCIEnv(): NodeJS.ProcessEnv {
173+
return Object.keys(process.env)
174+
.filter((v) => v.startsWith('SAUCE_') || v === 'CI' || v === 'CIRCLECI')
175+
.reduce<NodeJS.ProcessEnv>((vars, n) => {
176+
vars[n] = process.env[n];
177+
return vars;
178+
}, {});
179+
}
180+
172181
export function waitForAnyProcessOutputToMatch(
173182
match: RegExp,
174183
timeout = 30000,
@@ -372,6 +381,7 @@ export async function launchTestProcess(entry: string, ...args: any[]) {
372381
// Extract explicit environment variables for the test process.
373382
const env: NodeJS.ProcessEnv = {
374383
...extractNpmEnv(),
384+
...extractCIEnv(),
375385
...getGlobalVariablesEnv(),
376386
};
377387

0 commit comments

Comments
 (0)