Skip to content

Commit 35012b4

Browse files
committed
test: re-enable rebuild-symlink and browser-webdriverio E2E tests
(cherry picked from commit 412b9c4)
1 parent 261c411 commit 35012b4

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

‎packages/angular/build/src/builders/unit-test/runners/vitest/browser-provider.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,12 @@ export async function setupBrowserConfiguration(
192192
if (instance.browser === 'chrome' || instance.browser === 'chromium') {
193193
instance.provider = providerFactory({
194194
capabilities: {
195-
'goog:chromeOptions': { binary: executablePath },
195+
'goog:chromeOptions': {
196+
binary: executablePath,
197+
args: executablePath.includes('rules_browsers')
198+
? ['--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu']
199+
: undefined,
200+
},
196201
},
197202
});
198203
}

‎tests/e2e/tests/build/rebuild-symlink.ts‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { symlink } from 'node:fs/promises';
22
import { resolve } from 'node:path';
3+
import { setTimeout } from 'node:timers/promises';
34
import { appendToFile, expectFileToMatch, writeMultipleFiles } from '../../utils/fs';
45
import { execAndWaitForOutputToMatch, waitForAnyProcessOutputToMatch } from '../../utils/process';
56
import { updateJsonFile } from '../../utils/project';
@@ -10,11 +11,6 @@ const buildReadyRegEx = getGlobalVariable('argv')['esbuild']
1011
: /Build at: /;
1112

1213
export default async function () {
13-
// TODO: Disabled pending investigation. Steps work outside of test
14-
if (getGlobalVariable('argv')['esbuild']) {
15-
return;
16-
}
17-
1814
await updateJsonFile('angular.json', (configJson) => {
1915
configJson.projects['test-project'].architect.build.options.preserveSymlinks = true;
2016
});
@@ -32,10 +28,15 @@ export default async function () {
3228
buildReadyRegEx,
3329
);
3430

31+
await setTimeout(200);
32+
3533
// Trigger a rebuild
3634
await Promise.all([
3735
waitForAnyProcessOutputToMatch(buildReadyRegEx),
3836
appendToFile('src/link-source.ts', `\nconsole.log('foo-bar');`),
3937
]);
40-
await expectFileToMatch('dist/test-project/browser/main.js', `console.log('foo-bar')`);
38+
39+
await setTimeout(200);
40+
41+
await expectFileToMatch('dist/test-project/browser/main.js', /console\.log\(["']foo-bar["']\);/);
4142
}

‎tests/e2e/tests/vitest/browser-webdriverio.ts‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import { writeFile } from '../../utils/fs';
55
import { updateJsonFile } from '../../utils/project';
66

77
export default async function (): Promise<void> {
8-
// TODO: investigate why this test hangs in CI but works locally.
9-
return;
10-
118
await applyVitestBuilder({
129
webdriver: true,
1310
});

0 commit comments

Comments
 (0)