Skip to content

Commit f1c59d5

Browse files
committed
test: update e2e/npm_translate_lock_auth to not change lockfile during test
1 parent 5329e92 commit f1c59d5

5 files changed

Lines changed: 37 additions & 5 deletions

File tree

e2e/npm_translate_lock_auth/.aspect/rules/external_repository_action_cache/npm_translate_lock_LTE4Nzc1MDcwNjU=

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# Input hashes for repository rule npm_translate_lock(name = "npm", pnpm_lock = "@@//:pnpm-lock.yaml").
33
# This file should be checked into version control along with the pnpm-lock.yaml file.
44
.npmrc=490827635
5-
package.json=297721563
6-
pnpm-lock.yaml=271467844
5+
package.json=-404196952
6+
pnpm-lock.yaml=1768813175

e2e/npm_translate_lock_auth/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"onlyBuiltDependencies": []
44
},
55
"private": true,
6+
"devDependencies": {
7+
"@types/node": "22.18.13"
8+
},
69
"dependencies": {
710
"@aspect-build/a": "1.0.0",
811
"@aspect-priv-npm/a": "1.0.0"

e2e/npm_translate_lock_auth/pnpm-lock.yaml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

e2e/npm_translate_lock_auth/test.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,32 @@ _sedi() {
1414
sed "${sedi[@]}" "$@"
1515
}
1616

17+
# Move the local .npmrc to ~/ and update MODULE.bazel to use_home_npmrc=True
1718
cp -f .npmrc ~/.npmrc
1819
rm .npmrc
20+
_sedi 's#npmrc = "//:.npmrc",#use_home_npmrc = True,#' MODULE.bazel
21+
22+
# Have to make another change to package.json to invalidate the repository rule
23+
_sedi 's#"@types/node": "22.18.13"#"@types/node": "22"#' package.json
1924

20-
# update .aspect/rules/external_repository_action_cache/npm_translate_lock_<HASH>
25+
# Allow updating the lockfile for this test
2126
unset ASPECT_RULES_JS_FROZEN_PNPM_LOCK
22-
_sedi 's#npmrc = "//:.npmrc",#use_home_npmrc = True,#' MODULE.bazel
2327

2428
# Trigger the update of the pnpm lockfile which should exit non-zero
2529
if bazel run @npm//:sync; then
2630
echo "ERROR: expected 'update_pnpm_lock' to exit with non-zero exit code on update"
2731
exit 1
2832
fi
2933

34+
if ! git status --porcelain | grep -q "\.aspect/rules/external_repository_action_cache/npm_translate_lock_"; then
35+
echo "ERROR: expected .aspect/rules/external_repository_action_cache/npm_translate_lock_* to be updated by sync"
36+
exit 1
37+
fi
38+
if ! git status --porcelain | grep -q "pnpm-lock.yaml"; then
39+
echo "ERROR: expected pnpm-lock.yaml to be updated by sync"
40+
exit 1
41+
fi
42+
3043
# The lockfile has been updated and sync should now exit 0
3144
if ! bazel run @npm//:sync; then
3245
echo "ERROR: expected 'update_pnpm_lock' to exit zero once the lockfile is up to date"

e2e/update_pnpm_lock/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ ASPECT_RULES_JS_FROZEN_PNPM_LOCK=
4949
ASPECT_RULES_JS_DISABLE_UPDATE_PNPM_LOCK=
5050

5151
# Have to make another change to package.json to invalidate the repository rule
52-
_sedi 's#"@types/node": "20"#"@types/node": "18"#' package.json
52+
_sedi 's#"@types/node": "22.18.13"#"@types/node": "22"#' package.json
5353

5454
# Trigger the update of the pnpm lockfile which should exit non-zero
5555
if bazel run @npm//:sync; then

0 commit comments

Comments
 (0)