Skip to content

test: move pnpm_lockfiles/cases to isolated test directories #2208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion e2e/pnpm_lockfiles/.bazelignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
node_modules/
cases/node_modules
cases/versionless-patch-v9/node_modules
cases/docusaurus-direct-peer-v9/node_modules
cases/isaacs-cliui-v90/node_modules
cases/override-with-alias-url-v9/node_modules
cases/docusaurus-direct-peer-v6/node_modules
cases/tarball-no-url-v54/node_modules
projects/a/node_modules
projects/a-types/node_modules
projects/b/node_modules
Expand Down
14 changes: 7 additions & 7 deletions e2e/pnpm_lockfiles/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ PNPM_LOCK_VERSIONS = [

# Lockfiles with unique test cases
PNPM_LOCK_TEST_CASES = [
"tarball-no-url-v54.yaml",
"override-with-alias-url-v9.yaml",
"isaacs-cliui-v90.yaml",
"docusaurus-direct-peer-v6.yaml",
"docusaurus-direct-peer-v9.yaml",
"versionless-patch-v9.yaml",
"tarball-no-url-v54",
"override-with-alias-url-v9",
"isaacs-cliui-v90",
"docusaurus-direct-peer-v6",
"docusaurus-direct-peer-v9",
"versionless-patch-v9",
]

bazel_dep(name = "aspect_bazel_lib", version = "2.14.0")
Expand Down Expand Up @@ -94,7 +94,7 @@ npm = use_extension(
[
npm.npm_translate_lock(
name = lockfile.replace(".yaml", ""),
pnpm_lock = "//cases:%s" % lockfile,
pnpm_lock = "//cases/%s:pnpm-lock.yaml" % lockfile,
verify_node_modules_ignored = "//:.bazelignore",
)
for lockfile in PNPM_LOCK_TEST_CASES
Expand Down
14 changes: 7 additions & 7 deletions e2e/pnpm_lockfiles/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ PNPM_LOCK_VERSIONS = [

# Lockfiles with unique test cases
PNPM_LOCK_TEST_CASES = [
"tarball-no-url-v54.yaml",
"override-with-alias-url-v9.yaml",
"isaacs-cliui-v90.yaml",
"docusaurus-direct-peer-v6.yaml",
"docusaurus-direct-peer-v9.yaml",
"versionless-patch-v9.yaml",
"tarball-no-url-v54",
"override-with-alias-url-v9",
"isaacs-cliui-v90",
"docusaurus-direct-peer-v6",
"docusaurus-direct-peer-v9",
"versionless-patch-v9",
]

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")
Expand Down Expand Up @@ -60,7 +60,7 @@ npm_repositories_v90()
[
npm_translate_lock(
name = lockfile.replace(".yaml", ""),
pnpm_lock = "//cases:%s" % lockfile,
pnpm_lock = "//cases/%s:pnpm-lock.yaml" % lockfile,
verify_node_modules_ignored = "//:.bazelignore",
)
for lockfile in PNPM_LOCK_TEST_CASES
Expand Down
74 changes: 0 additions & 74 deletions e2e/pnpm_lockfiles/cases/BUILD.bazel

This file was deleted.

14 changes: 14 additions & 0 deletions e2e/pnpm_lockfiles/cases/docusaurus-direct-peer-v6/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@docusaurus-direct-peer-v6//:defs.bzl", docusaurus_direct_with_peers_v6_link_all = "npm_link_all_packages")

exports_files(["pnpm-lock.yaml"])

docusaurus_direct_with_peers_v6_link_all()

build_test(
name = "docusaurus_direct_with_peers",
targets = [
":node_modules",
":node_modules/@docusaurus/module-type-aliases",
],
)
14 changes: 14 additions & 0 deletions e2e/pnpm_lockfiles/cases/docusaurus-direct-peer-v9/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@docusaurus-direct-peer-v9//:defs.bzl", docusaurus_direct_with_peers_v9_link_all = "npm_link_all_packages")

exports_files(["pnpm-lock.yaml"])

docusaurus_direct_with_peers_v9_link_all()

build_test(
name = "docusaurus_direct_with_peers",
targets = [
":node_modules",
":node_modules/@docusaurus/module-type-aliases",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pnpm": {
"onlyBuiltDependencies": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- '.'
14 changes: 14 additions & 0 deletions e2e/pnpm_lockfiles/cases/isaacs-cliui-v90/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@isaacs-cliui-v90//:defs.bzl", isaacs_cliui_v90_link_all = "npm_link_all_packages")

exports_files(["pnpm-lock.yaml"])

isaacs_cliui_v90_link_all()

build_test(
name = "isaacs_cliui",
targets = [
":node_modules",
":node_modules/@isaacs/cliui",
],
)
5 changes: 5 additions & 0 deletions e2e/pnpm_lockfiles/cases/isaacs-cliui-v90/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pnpm": {
"onlyBuiltDependencies": []
}
}
2 changes: 2 additions & 0 deletions e2e/pnpm_lockfiles/cases/isaacs-cliui-v90/pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- '.'
14 changes: 14 additions & 0 deletions e2e/pnpm_lockfiles/cases/override-with-alias-url-v9/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@override-with-alias-url-v9//:defs.bzl", override_with_alias_link_all = "npm_link_all_packages")

exports_files(["pnpm-lock.yaml"])

override_with_alias_link_all()

build_test(
name = "override-with-alias-url-v9",
targets = [
":node_modules",
"node_modules/lodash.pick",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pnpm": {
"onlyBuiltDependencies": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- '.'
14 changes: 14 additions & 0 deletions e2e/pnpm_lockfiles/cases/tarball-no-url-v54/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@tarball-no-url-v54//:defs.bzl", tarball_no_url_link_all = "npm_link_all_packages")

exports_files(["pnpm-lock.yaml"])

tarball_no_url_link_all()

build_test(
name = "tarball-no-url-v54",
targets = [
":node_modules",
":node_modules/@aspect-build/a",
],
)
5 changes: 5 additions & 0 deletions e2e/pnpm_lockfiles/cases/tarball-no-url-v54/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pnpm": {
"onlyBuiltDependencies": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- '.'
23 changes: 23 additions & 0 deletions e2e/pnpm_lockfiles/cases/versionless-patch-v9/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("@aspect_rules_js//js:defs.bzl", "js_test")
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@versionless-patch-v9//:defs.bzl", versionless_patch_link_all = "npm_link_all_packages")

exports_files(["pnpm-lock.yaml"])

versionless_patch_link_all()

build_test(
name = "versionless_patch_targets",
targets = [
":node_modules",
":node_modules/@aspect-test/e",
],
)

js_test(
name = "versionless_patch_test",
data = [
":node_modules/@aspect-test/e",
],
entry_point = "versionless-patch.spec.js",
)
5 changes: 5 additions & 0 deletions e2e/pnpm_lockfiles/cases/versionless-patch-v9/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pnpm": {
"onlyBuiltDependencies": []
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- '.'