Skip to content

Commit bb5b094

Browse files
committed
Test revert verdaccio change
1 parent a066701 commit bb5b094

File tree

16 files changed

+177
-177
lines changed

16 files changed

+177
-177
lines changed

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

Lines changed: 9 additions & 2 deletions
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

@@ -72,4 +72,11 @@ runs:
7272
working-directory: "C:\\test"
7373
run: |
7474
cd dist/bin/tests/legacy-cli/${{inputs.test_target_name}}_/${{inputs.test_target_name}}.bat.runfiles/angular_cli
75-
../../${{inputs.test_target_name}} ${{inputs.test_args}}
75+
76+
export TEST_TOTAL_SHARDS=4
77+
78+
npx --yes concurrently@9 --group --restart-tries=1 \
79+
"set TEST_SHARD_INDEX=0 && bash '$PWD/../../${{inputs.test_target_name}} ${{inputs.test_args}}'" \
80+
"set TEST_SHARD_INDEX=1 && bash '$PWD/../../${{inputs.test_target_name}} ${{inputs.test_args}}'" \
81+
"set TEST_SHARD_INDEX=2 && bash '$PWD/../../${{inputs.test_target_name}} ${{inputs.test_args}}'" \
82+
"set TEST_SHARD_INDEX=3 && bash '$PWD/../../${{inputs.test_target_name}} ${{inputs.test_args}}'"

.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: 2 additions & 5 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",
@@ -245,7 +242,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
245242

246243
git_repository(
247244
name = "devinfra",
248-
commit = "0f920f422b8bbf1ca96a72cf01e18b95e266dc98",
245+
commit = "836bdd0543d15904c469f5a0ce869d30a8029971",
249246
remote = "https://github.com/angular/dev-infra.git",
250247
)
251248

packages/angular_devkit/core/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ api_golden_test_npm_package(
9393
golden_dir = "goldens/public-api/angular_devkit/core",
9494
npm_package = "packages/angular_devkit/core/npm_package",
9595
types = {
96-
"node": "//:node_modules/@types/node",
96+
"//:node_modules/@types/node": "node",
9797
},
9898
)
9999
# @external_end

scripts/windows-testing/convert-symlinks.mjs

Lines changed: 93 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -20,76 +20,110 @@ const [rootDir, cmdPath] = process.argv.slice(2);
2020
const debug = process.env.DEBUG === '1';
2121
const skipDirectories = [
2222
// Modules that we don't need and would unnecessarily slow-down this.
23-
'node22_windows_amd64/bin/nodejs/node_modules',
23+
'_windows_amd64/bin/nodejs/node_modules',
2424
];
2525

2626
const workspaceRootPaths = [/.*\.runfiles\/angular_cli\//, /^.*-fastbuild\/bin\//];
2727

28+
const executedCommands = [];
29+
2830
async function transformDir(p) {
31+
// We perform all command executions in parallel here to speed up.
32+
// Note that we can't parallelize for the full recursive directory,
33+
// as WSL and its interop would otherwise end up with some flaky errors.
34+
// See: https://github.com/microsoft/WSL/issues/8677.
35+
const tasks = [];
36+
// We explore directories after all files were checked at this level.
37+
const directoriesToVisit = [];
38+
2939
for (const file of await fs.readdir(p, { withFileTypes: true })) {
3040
const subPath = path.join(p, file.name);
3141

3242
if (skipDirectories.some((d) => subPath.endsWith(d))) {
3343
continue;
3444
}
3545

36-
if (file.isDirectory()) {
37-
await transformDir(subPath);
38-
} 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);
45-
}
46-
continue;
47-
}
48-
49-
await fs.rm(subPath);
50-
51-
const subPathId = relativizeForSimilarWorkspacePaths(subPath);
52-
const targetPathId = relativizeForSimilarWorkspacePaths(target);
53-
const isSelfLink = subPathId === targetPathId;
54-
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-
}
46+
if (file.isSymbolicLink()) {
47+
// Allow for parallel processing of directory entries.
48+
tasks.push(
49+
(async () => {
50+
let target = '';
51+
try {
52+
target = await fs.realpath(subPath);
53+
} catch (e) {
54+
if (debug) {
55+
console.error('Skipping', subPath);
56+
}
57+
return;
58+
}
59+
60+
await fs.rm(subPath);
61+
62+
const subPathId = relativizeForSimilarWorkspacePaths(subPath);
63+
const targetPathId = relativizeForSimilarWorkspacePaths(target);
64+
const isSelfLink = subPathId === targetPathId;
65+
66+
// This is an actual file that needs to be copied. Copy contents.
67+
// - the target path is equivalent to the link. This is a self-link from `.runfiles` to `bin/`.
68+
// - the target path is outside any of our workspace roots.
69+
if (isSelfLink || targetPathId.startsWith('..')) {
70+
await exec(`cp -Rf ${target} ${subPath}`);
71+
return;
72+
}
73+
74+
const relativeSubPath = relativizeToRoot(subPath);
75+
const targetAtDestination = path.relative(path.dirname(subPathId), targetPathId);
76+
const targetAtDestinationWindowsPath = targetAtDestination.replace(/\//g, '\\');
77+
78+
const wslSubPath = relativeSubPath.replace(/\//g, '\\');
79+
80+
if (debug) {
81+
console.log({
82+
targetAtDestination,
83+
subPath,
84+
relativeSubPath,
85+
target,
86+
targetPathId,
87+
subPathId,
88+
});
89+
}
90+
91+
if ((await fs.stat(target)).isDirectory()) {
92+
// A symlink to a directory, create a dir junction.
93+
await exec(
94+
`${cmdPath} /c mklink /d "${wslSubPath}" "${targetAtDestinationWindowsPath}"`,
95+
);
96+
} else {
97+
// A symlink to a file, create a file junction.
98+
await exec(`${cmdPath} /c mklink "${wslSubPath}" "${targetAtDestinationWindowsPath}"`);
99+
}
100+
})(),
101+
);
102+
} else if (file.isDirectory()) {
103+
directoriesToVisit.push(subPath);
104+
}
105+
}
62106

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-
}
107+
// Wait for all commands/tasks to complete, executed in parallel.
108+
await Promise.all(tasks);
79109

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-
}
87-
}
110+
// Descend into other directories, sequentially to avoid WSL interop errors.
111+
for (const d of directoriesToVisit) {
112+
await transformDir(d);
88113
}
89114
}
90115

91116
function exec(cmd) {
92-
childProcess.execSync(cmd, { cwd: rootDir });
117+
return new Promise((resolve, reject) => {
118+
childProcess.exec(cmd, { cwd: rootDir }, (error) => {
119+
if (error !== null) {
120+
reject(error);
121+
} else {
122+
executedCommands.push(cmd);
123+
resolve();
124+
}
125+
});
126+
});
93127
}
94128

95129
function relativizeForSimilarWorkspacePaths(p) {
@@ -110,4 +144,10 @@ function relativizeToRoot(p) {
110144
throw new Error('Could not relativize to root: ' + p);
111145
}
112146

113-
await transformDir(rootDir);
147+
try {
148+
await transformDir(rootDir);
149+
console.error('Executed commands', executedCommands);
150+
} catch (err) {
151+
console.error('Could not convert symlinks:', err);
152+
process.exitCode = 1;
153+
}

test.sh

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

test2.sh

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

0 commit comments

Comments
 (0)