Skip to content

Commit 73036a3

Browse files
committed
test
1 parent 418c7cb commit 73036a3

File tree

9 files changed

+18
-11
lines changed

9 files changed

+18
-11
lines changed

.github/workflows/pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ jobs:
127127

128128
e2e-windows-subset:
129129
# needs: build
130-
runs-on: windows-2025
130+
runs-on: windows-latest
131131
steps:
132132
# Git checkout converts to CRLF by default. This causes the Aspect lock
133133
# files to differ. See: https://github.com/actions/checkout/issues/135.
@@ -153,8 +153,6 @@ jobs:
153153
wsl-conf: |
154154
[interop]
155155
appendWindowsPath=false
156-
[wsl2]
157-
networkingMode=mirrored
158156
wsl-shell-command: bash --login -euo pipefail
159157
additional-packages: |
160158
curl
@@ -213,6 +211,8 @@ jobs:
213211
--test_env="NG_E2E_RUNNER_WINDOWS_NPM=${{steps.wsl_paths.outputs.npm_path}}" \
214212
--test_env="NG_E2E_RUNNER_WINDOWS_TMP_DIR=${{steps.wsl_paths.outputs.tmp_path}}" \
215213
--test_env="NG_E2E_RUNNER_WINDOWS_GIT_BASH_BIN=${{steps.wsl_paths.outputs.git_path}}" \
214+
--test_env="NG_E2E_RUNNER_WSL_HOST_ADDR=$(ip route show | grep -i default | awk '{ print $3}')" \
215+
--test_env="NG_E2E_RUNNER_WSL_VM_ADDR=$(hostname -I)" \
216216
--test_output=streamed \
217217
--strategy=TestRunner=standalone
218218
shell: wsl-bash {0}

packages/angular/build/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { count, debounceTime, finalize, switchMap, take, timeout } from 'rxjs';
1616
import { executeDevServer } from '../../index';
1717
import { describeServeBuilder } from '../jasmine-helpers';
1818
import { BASE_OPTIONS, BUILD_TIMEOUT, DEV_SERVER_BUILDER_INFO } from '../setup';
19+
import { loopbackAddr } from '../../../../../../../../tests/legacy-cli/e2e/utils/env';
1920

2021
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2122
declare const document: any;
@@ -102,7 +103,7 @@ async function createProxy(target: string, secure: boolean, ws = true): Promise<
102103

103104
return {
104105
server,
105-
url: `${secure ? 'https' : 'http'}://localhost:${proxyPort}`,
106+
url: `${secure ? 'https' : 'http'}://${loopbackAddr}:${proxyPort}`,
106107
};
107108
}
108109

packages/angular_devkit/build_angular/src/builders/dev-server/tests/behavior/serve-live-reload-proxies_spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { count, debounceTime, finalize, switchMap, take, timeout } from 'rxjs';
1616
import { executeDevServer } from '../../index';
1717
import { describeServeBuilder } from '../jasmine-helpers';
1818
import { BASE_OPTIONS, BUILD_TIMEOUT, DEV_SERVER_BUILDER_INFO } from '../setup';
19+
import { loopbackAddr } from '../../../../../../../../tests/legacy-cli/e2e/utils/env';
1920

2021
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2122
declare const document: any;
@@ -102,7 +103,7 @@ async function createProxy(target: string, secure: boolean, ws = true): Promise<
102103

103104
return {
104105
server,
105-
url: `${secure ? 'https' : 'http'}://localhost:${proxyPort}`,
106+
url: `${secure ? 'https' : 'http'}://${loopbackAddr}:${proxyPort}`,
106107
};
107108
}
108109

test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ yarn bazel test \
1414
--test_env="NG_E2E_RUNNER_WINDOWS_NPM=C:\Program Files\nodejs\npm" \
1515
--test_env="NG_E2E_RUNNER_WINDOWS_TMP_DIR=/mnt/c/Users/paulg/AppData/Local/Temp" \
1616
--test_env="NG_E2E_RUNNER_WINDOWS_GIT_BASH_BIN=/mnt/c/Program Files/Git/bin/git" \
17+
--test_env="NG_E2E_RUNNER_WSL_HOST_ADDR=$(ip route show | grep -i default | awk '{ print $3}')" \
18+
--test_env="NG_E2E_RUNNER_WSL_VM_ADDR=$(hostname -I)" \
1719
--test_output=streamed \
1820
--flaky_test_attempts=1

tests/legacy-cli/e2e/tests/basic/rebuild.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export default async function () {
6767
]);
6868
{
6969
console.error(`http://localhost:${port}/main.js`);
70-
await setTimeout(1000 * 60 * 20);
70+
// await setTimeout(1000 * 60 * 20);
7171
const response = await fetch(`http://localhost:${port}/main.js`);
7272
const body = await response.text();
7373
if (!body.match(/\$\$_E2E_GOLDEN_VALUE_1/)) {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
const ENV_PREFIX = 'LEGACY_CLI__';
22

3+
export const loopbackAddr = process.env.NG_E2E_RUNNER_WSL_HOST_ADDR?.trim() ?? 'localhost';
4+
export const registryAddr = process.env.NG_E2E_RUNNER_WSL_VM_ADDR?.trim() ?? 'localhost';
5+
36
export function setGlobalVariable(name: string, value: any) {
47
if (value === undefined) {
58
delete process.env[ENV_PREFIX + name];

tests/legacy-cli/e2e_runner.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createConsoleLogger } from '../../packages/angular_devkit/core/node';
33
import colors from 'ansi-colors';
44
import glob from 'fast-glob';
55
import * as path from 'node:path';
6-
import { getGlobalVariable, setGlobalVariable } from './e2e/utils/env';
6+
import { getGlobalVariable, registryAddr, setGlobalVariable } from './e2e/utils/env';
77
import { gitClean } from './e2e/utils/git';
88
import { createNpmRegistry } from './e2e/utils/registry';
99
import { launchTestProcess } from './e2e/utils/process';
@@ -227,8 +227,8 @@ const ports = (async () => {
227227

228228
Promise.all([ports, findPackageTars()])
229229
.then(async ([[httpPort, httpsPort], packageTars]) => {
230-
setGlobalVariable('package-registry', 'http://127.0.0.1:' + httpPort);
231-
setGlobalVariable('package-secure-registry', 'http://127.0.0.1:' + httpsPort);
230+
setGlobalVariable('package-registry', `http://${registryAddr}:${httpPort}`);
231+
setGlobalVariable('package-secure-registry', `http://${registryAddr}:${httpsPort}`);
232232
setGlobalVariable('package-tars', packageTars);
233233

234234
// NPM registries for the lifetime of the test execution

tests/legacy-cli/verdaccio.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ storage: ./storage
33
auth:
44
auth-memory:
55
users: {}
6-
listen: 127.0.0.1:${HTTP_PORT}
6+
listen: 0.0.0.0:${HTTP_PORT}
77
uplinks:
88
npmjs:
99
url: https://registry.npmjs.org/

tests/legacy-cli/verdaccio_auth.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ auth:
55
testing:
66
name: testing
77
password: s3cret
8-
listen: 127.0.0.1:${HTTPS_PORT}
8+
listen: 0.0.0.0:${HTTPS_PORT}
99
uplinks:
1010
local:
1111
url: http://127.0.0.1:${HTTP_PORT}

0 commit comments

Comments
 (0)