Skip to content

Commit 783e649

Browse files
committed
Test revert verdaccio change
1 parent a066701 commit 783e649

File tree

15 files changed

+136
-165
lines changed

15 files changed

+136
-165
lines changed

.github/shared-actions/windows-bazel-test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ runs:
2222

2323
- name: Initialize WSL
2424
id: init_wsl
25-
uses: angular/dev-infra/github-actions/setup-wsl@10c9ccde0b22c30eefc13adc5a5121b5898902d1
25+
uses: angular/dev-infra/github-actions/setup-wsl@9a3e28a515bf51cd2ecfd5f4d5b17613845e6f44
2626
with:
2727
wsl_firewall_interface: 'vEthernet (WSL (Hyper-V firewall))'
2828

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
- name: Setup Bazel RBE
9696
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
9797
- name: Run CLI E2E tests
98-
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
98+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
9999

100100
e2e-package-managers:
101101
needs: test
@@ -117,7 +117,7 @@ jobs:
117117
- name: Setup Bazel RBE
118118
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
119119
- name: Run CLI E2E tests
120-
run: yarn bazel test --define=E2E_SHARD_TOTAL=3 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
120+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
121121

122122
e2e-snapshots:
123123
needs: test
@@ -139,7 +139,7 @@ jobs:
139139
- name: Setup Bazel RBE
140140
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
141141
- name: Run CLI E2E tests
142-
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
142+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
143143

144144
browsers:
145145
needs: build

.github/workflows/pr.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
- name: Setup Bazel RBE
124124
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
125125
- name: Run CLI E2E tests
126-
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
126+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
127127

128128
e2e-windows-subset:
129129
# needs: build
@@ -137,25 +137,25 @@ jobs:
137137
test_target_name: e2e_node22
138138
test_args: --esbuild --glob "tests/basic/{build,rebuild}.ts"
139139

140-
# e2e_windows:
141-
# strategy:
142-
# fail-fast: false
143-
# matrix:
144-
# os: [windows-2025]
145-
# node: [22]
146-
# subset: [npm, esbuild]
147-
# shard: [0, 1, 2, 3, 4, 5]
148-
# runs-on: ${{ matrix.os }}
149-
# steps:
150-
# - name: Initialize environment
151-
# uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@d16848fd2ed19fce59488b540fa26a3353c72ad4
152-
# - name: Run CLI E2E tests
153-
# uses: ./.github/shared-actions/windows-bazel-test
154-
# with:
155-
# command: |
156-
# yarn bazel test \
157-
# --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} \
158-
# --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }} \
140+
e2e_windows:
141+
strategy:
142+
fail-fast: false
143+
matrix:
144+
os: [windows-2025]
145+
node: [22]
146+
subset: [npm, esbuild]
147+
shard: [0, 1, 2, 3, 4, 5]
148+
runs-on: ${{ matrix.os }}
149+
steps:
150+
- name: Initialize environment
151+
uses: angular/dev-infra/github-actions/npm/checkout-and-setup-node@0000d926624b2fd918e93f1c6b5e2defba9af91f
152+
- name: Run CLI E2E tests
153+
uses: ./.github/shared-actions/windows-bazel-test
154+
with:
155+
test_target_name: e2e.${{ matrix.subset }}_node${{ matrix.node }}
156+
env:
157+
E2E_SHARD_TOTAL: 6
158+
E2E_SHARD_INDEX: ${{ matrix.shard }}
159159

160160
e2e-package-managers:
161161
needs: build
@@ -177,7 +177,7 @@ jobs:
177177
- name: Setup Bazel RBE
178178
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
179179
- name: Run CLI E2E tests
180-
run: yarn bazel test --define=E2E_SHARD_TOTAL=3 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
180+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=3 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.${{ matrix.subset }}_node${{ matrix.node }}
181181

182182
e2e-snapshots:
183183
needs: [analyze, build]
@@ -200,4 +200,4 @@ jobs:
200200
- name: Setup Bazel RBE
201201
uses: angular/dev-infra/github-actions/bazel/configure-remote@836bdd0543d15904c469f5a0ce869d30a8029971
202202
- name: Run CLI E2E tests
203-
run: yarn bazel test --define=E2E_SHARD_TOTAL=6 --define=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}
203+
run: yarn bazel test --test_env=E2E_SHARD_TOTAL=6 --test_env=E2E_SHARD_INDEX=${{ matrix.shard }} --config=e2e //tests/legacy-cli:e2e.snapshots.${{ matrix.subset }}_node${{ matrix.node }}

WORKSPACE

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,8 @@ npm_translate_lock(
193193
},
194194
pnpm_lock = "//:pnpm-lock.yaml",
195195
public_hoist_packages = {
196-
# Pino of Verdaccio can't be bundled, so we make it loadable as runtime dep.
197-
# Similarly, logger-prettify is dynamically loaded at runtime.
198-
"pino": [""],
196+
# TODO: Remove when https://github.com/verdaccio/verdaccio/commit/bf0e09a509e8e0a74167b0307d129202bc3f40d2 is available.
199197
"@verdaccio/config": [""],
200-
"@verdaccio/logger-prettify": [""],
201198
},
202199
update_pnpm_lock = True,
203200
verify_node_modules_ignored = "//:.bazelignore",

scripts/windows-testing/convert-symlinks.mjs

Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ const skipDirectories = [
2626
const workspaceRootPaths = [/.*\.runfiles\/angular_cli\//, /^.*-fastbuild\/bin\//];
2727

2828
async function transformDir(p) {
29+
const tasks = [];
30+
2931
for (const file of await fs.readdir(p, { withFileTypes: true })) {
3032
const subPath = path.join(p, file.name);
3133

@@ -34,62 +36,78 @@ async function transformDir(p) {
3436
}
3537

3638
if (file.isDirectory()) {
37-
await transformDir(subPath);
39+
// Allow for parallel processing of directory entries.
40+
tasks.push(transformDir(subPath));
3841
} else if (file.isSymbolicLink()) {
39-
let target = '';
40-
try {
41-
target = await fs.realpath(subPath);
42-
} catch (e) {
43-
if (debug) {
44-
console.error('Skipping', subPath);
42+
// Allow for parallel processing of directory entries.
43+
tasks.push(async () => {
44+
let target = '';
45+
try {
46+
target = await fs.realpath(subPath);
47+
} catch (e) {
48+
if (debug) {
49+
console.error('Skipping', subPath);
50+
}
51+
return;
4552
}
46-
continue;
47-
}
4853

49-
await fs.rm(subPath);
54+
await fs.rm(subPath);
5055

51-
const subPathId = relativizeForSimilarWorkspacePaths(subPath);
52-
const targetPathId = relativizeForSimilarWorkspacePaths(target);
53-
const isSelfLink = subPathId === targetPathId;
56+
const subPathId = relativizeForSimilarWorkspacePaths(subPath);
57+
const targetPathId = relativizeForSimilarWorkspacePaths(target);
58+
const isSelfLink = subPathId === targetPathId;
5459

55-
// This is an actual file that needs to be copied. Copy contents.
56-
// - the target path is outside any of our workspace roots.
57-
// - the target path is equivalent to the link. This is a self-link from `.runfiles` to `bin/`.
58-
if (isSelfLink || targetPathId.startsWith('..')) {
59-
exec(`cp -Rf ${target} ${subPath}`);
60-
continue;
61-
}
60+
// This is an actual file that needs to be copied. Copy contents.
61+
// - the target path is outside any of our workspace roots.
62+
// - the target path is equivalent to the link. This is a self-link from `.runfiles` to `bin/`.
63+
if (isSelfLink || targetPathId.startsWith('..')) {
64+
await exec(`cp -Rf ${target} ${subPath}`);
65+
return;
66+
}
6267

63-
const relativeSubPath = relativizeToRoot(subPath);
64-
const targetAtDestination = path.relative(path.dirname(subPathId), targetPathId);
65-
const targetAtDestinationWindowsPath = targetAtDestination.replace(/\//g, '\\');
66-
67-
const wslSubPath = relativeSubPath.replace(/\//g, '\\');
68-
69-
if (debug) {
70-
console.log({
71-
targetAtDestination,
72-
subPath,
73-
relativeSubPath,
74-
target,
75-
targetPathId,
76-
subPathId,
77-
});
78-
}
68+
const relativeSubPath = relativizeToRoot(subPath);
69+
const targetAtDestination = path.relative(path.dirname(subPathId), targetPathId);
70+
const targetAtDestinationWindowsPath = targetAtDestination.replace(/\//g, '\\');
7971

80-
if ((await fs.stat(target)).isDirectory()) {
81-
// A symlink to a directory, create a dir junction.
82-
exec(`${cmdPath} /c mklink /d "${wslSubPath}" "${targetAtDestinationWindowsPath}"`);
83-
} else {
84-
// A symlink to a file, create a file junction.
85-
exec(`${cmdPath} /c mklink "${wslSubPath}" "${targetAtDestinationWindowsPath}"`);
86-
}
72+
const wslSubPath = relativeSubPath.replace(/\//g, '\\');
73+
74+
if (debug) {
75+
console.log({
76+
targetAtDestination,
77+
subPath,
78+
relativeSubPath,
79+
target,
80+
targetPathId,
81+
subPathId,
82+
});
83+
}
84+
85+
if ((await fs.stat(target)).isDirectory()) {
86+
// A symlink to a directory, create a dir junction.
87+
await exec(`${cmdPath} /c mklink /d "${wslSubPath}" "${targetAtDestinationWindowsPath}"`);
88+
} else {
89+
// A symlink to a file, create a file junction.
90+
await exec(`${cmdPath} /c mklink "${wslSubPath}" "${targetAtDestinationWindowsPath}"`);
91+
}
92+
});
8793
}
94+
95+
await Promise.all(tasks);
8896
}
8997
}
9098

9199
function exec(cmd) {
92-
childProcess.execSync(cmd, { cwd: rootDir });
100+
return new Promise((resolve, reject) => {
101+
const proc = childProcess.exec(cmd, { cwd: rootDir });
102+
proc.on('error', (err) => reject(err));
103+
proc.on('close', (code, signal) => {
104+
if (code === 0 && signal === null) {
105+
resolve();
106+
} else {
107+
reject(`Executing ${cmd} failed ${{ code, signal }}`);
108+
}
109+
});
110+
});
93111
}
94112

95113
function relativizeForSimilarWorkspacePaths(p) {

test.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

test2.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

tests/legacy-cli/BUILD.bazel

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,10 @@
11
load("@aspect_bazel_lib//lib:directory_path.bzl", "directory_path")
2-
load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
32
load("@npm2//:rollup/package_json.bzl", rollup = "bin")
43
load("//tools:interop.bzl", "ts_project")
54
load(":e2e.bzl", "e2e_suites")
65

76
package(default_visibility = ["//visibility:public"])
87

9-
bool_flag(
10-
name = "enable_native_windows_testing",
11-
build_setting_default = False,
12-
)
13-
14-
config_setting(
15-
name = "native_windows_testing",
16-
flag_values = {
17-
":enable_native_windows_testing": "true",
18-
},
19-
)
20-
218
ts_project(
229
name = "runner",
2310
testonly = True,
@@ -72,16 +59,16 @@ e2e_suites(
7259
":runner_bundled",
7360
"verdaccio.yaml",
7461
"verdaccio_auth.yaml",
75-
"package.json",
7662

7763
# Dynamically loaded.
78-
"//:node_modules/verdaccio-auth-memory",
7964
"//tests/legacy-cli/e2e/assets",
65+
"//:node_modules/verdaccio",
66+
"//:node_modules/verdaccio-auth-memory",
8067

81-
# Runtime deps due to bundling issues
68+
# Extra runtime deps due to bundling issues.
69+
# TODO: Clean this up.
8270
"//:node_modules/@verdaccio/config",
83-
"//:node_modules/@verdaccio/logger-prettify",
84-
"//:node_modules/pino",
71+
"//:node_modules/express",
8572
],
8673
runner = ":runner_entrypoint",
8774
)

tests/legacy-cli/e2e/tests/commands/analytics/analytics-info.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ export default async function () {
55
// Should be disabled by default.
66
await configureTest(undefined /** analytics */);
77
await execAndWaitForOutputToMatch('ng', ['analytics', 'info'], /Effective status: disabled/, {
8+
...process.env,
89
NG_FORCE_TTY: '0', // Disable prompts
910
});
1011

1112
await configureTest('1dba0835-38a3-4957-bf34-9974e2df0df3' /** analytics */);
1213
await execAndWaitForOutputToMatch('ng', ['analytics', 'info'], /Effective status: enabled/, {
14+
...process.env,
1315
NG_FORCE_TTY: '0', // Disable prompts
1416
});
1517

1618
await configureTest(false /** analytics */);
1719
await execAndWaitForOutputToMatch('ng', ['analytics', 'info'], /Effective status: disabled/, {
20+
...process.env,
1821
NG_FORCE_TTY: '0', // Disable prompts
1922
});
2023
}

0 commit comments

Comments
 (0)