Skip to content

Commit

Permalink
chore: cleanup test targets
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Jun 7, 2024
1 parent 08dde37 commit 1b2c029
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 49 deletions.
12 changes: 10 additions & 2 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ tasks:
platform: ubuntu1804
build_targets:
- "//..."
test_flags:
- "--test_tag_filters=-skip-on-bazelci-ubuntu"
test_targets:
- "//..."
ubuntu1804-smoke:
Expand All @@ -23,6 +25,8 @@ tasks:
working_directory: "e2e/smoke"
build_targets:
- "//..."
test_flags:
- "--test_tag_filters=-skip-on-bazelci-ubuntu"
test_targets:
- "//..."
ubuntu1804-nodejs_host:
Expand All @@ -31,6 +35,8 @@ tasks:
working_directory: "e2e/nodejs_host"
build_targets:
- "//..."
test_flags:
- "--test_tag_filters=-skip-on-bazelci-ubuntu"
test_targets:
- "//..."
macos-smoke:
Expand All @@ -39,6 +45,8 @@ tasks:
working_directory: "e2e/smoke"
build_targets:
- "//..."
test_flags:
- "--test_tag_filters=-skip-on-bazelci-macos"
test_targets:
- "//..."
windows-smoke:
Expand All @@ -48,7 +56,7 @@ tasks:
build_targets:
- "//..."
test_flags:
- "--test_tag_filters=-fix-windows,-no-bazelci-windows"
- "--test_tag_filters=-skip-on-bazelci-windows"
test_targets:
- "//..."
windows-nodejs_host:
Expand All @@ -58,7 +66,7 @@ tasks:
build_targets:
- "//..."
test_flags:
- "--test_tag_filters=-fix-windows,-no-bazelci-windows"
- "--test_tag_filters=-skip-on-bazelci-windows"
test_targets:
- "//..."
# Temporarily disabled RBE CI until cc toolchain failures are resolved
Expand Down
2 changes: 1 addition & 1 deletion .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ bcr_test_module:
test_targets:
- '//...'
test_flags:
- '--test_tag_filters=-no-bazelci-windows'
- '--test_tag_filters=-skip-on-bazelci-windows'
73 changes: 36 additions & 37 deletions e2e/nodejs_host/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,69 +1,68 @@
# Dummy test target that imports various targets from the
# "@nodejs" repository. If a target of the repository is
# misconfigured, Bazel will complain about missing input files.
sh_test(
name = "test_default",
srcs = ["test.sh"],
data = [
"@nodejs//:node",
"@nodejs//:node_bin",
"@nodejs//:node_files",
"@nodejs//:npm",
"@nodejs//:npm_bin",
"@nodejs//:npm_files",
],
)

# Additional targets to test the use of parallel node toolchains
[
sh_test(
name = "test_" + id,
name = "test_%s" % node_toolchain,
srcs = ["test.sh"],
data = [
"@%s_host//:node" % id,
"@%s_host//:node_bin" % id,
"@%s_host//:node_files" % id,
"@%s_host//:npm" % id,
"@%s_host//:npm_bin" % id,
"@%s_host//:npm_files" % id,
"@%s_host//:npx_bin" % id,
"@%s//:node" % node_toolchain,
"@%s//:node_bin" % node_toolchain,
"@%s//:node_files" % node_toolchain,
"@%s//:npm" % node_toolchain,
"@%s//:npm_bin" % node_toolchain,
"@%s//:npm_files" % node_toolchain,
"@%s//:npx" % node_toolchain,
"@%s//:npx_bin" % node_toolchain,
],
)
for id in [
for node_toolchain in [
"nodejs",
"node16",
"node16_nvmrc",
]
]

[
sh_test(
name = "test_node_version_%s_%s" % (bin, id),
name = "test_%s_node_version_%s" % (node_toolchain, tool),
srcs = ["version_test.sh"],
args = select({
"@bazel_tools//src/conditions:linux_x86_64": [
"%s_linux_amd64/bin" % id,
bin,
"%s_linux_amd64/bin" % node_toolchain,
tool,
],
"@bazel_tools//src/conditions:darwin": [
"%s_darwin_arm64/bin" % id,
bin,
"%s_darwin_arm64/bin" % node_toolchain,
tool,
],
"@bazel_tools//src/conditions:windows": [
"%s_windows_amd64/bin" % id,
bin,
"%s_windows_amd64/bin" % node_toolchain,
tool,
".cmd",
],
}),
data = [
"@%s_host//:%s" % (id, bin),
"@%s_host//:node" % id,
"@%s//:%s" % (node_toolchain, tool),
"@%s//:node" % node_toolchain,
"@bazel_tools//tools/bash/runfiles",
],
tags = tags,
)
for (id, bin) in [
("node16", "npm"),
("node16", "npx"),
("node16_nvmrc", "npm"),
("node16_nvmrc", "npx"),
for (node_toolchain, tool, tags) in [
(
"nodejs",
"npm",
["skip-on-bazelci-ubuntu"],
),
(
"nodejs",
"npx",
["skip-on-bazelci-ubuntu"],
),
("node16", "npm", []),
("node16", "npx", []),
("node16_nvmrc", "npm", []),
("node16_nvmrc", "npx", []),
]
]
12 changes: 3 additions & 9 deletions e2e/smoke/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,8 @@ diff_test(
file1 = "expected",
file2 = "actual1",
tags = [
# no need to run on more than one platform
"no-bazelci-windows",
# diff_test has line endings issues on Windows
"fix-windows",
"skip-on-bazelci-windows",
],
)

Expand Down Expand Up @@ -132,10 +130,8 @@ diff_test(
file1 = "actual2",
file2 = "expected_ast.json",
tags = [
# no need to run on more than one platform
"no-bazelci-windows",
# diff_test has line endings issues on Windows
"fix-windows",
"skip-on-bazelci-windows",
],
)

Expand Down Expand Up @@ -182,10 +178,8 @@ diff_test(
file1 = "actual3",
file2 = "expected_ast.json",
tags = [
# no need to run on more than one platform
"no-bazelci-windows",
# diff_test has line endings issues on Windows
"fix-windows",
"skip-on-bazelci-windows",
],
)

Expand Down
1 change: 1 addition & 0 deletions nodejs/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ def nodejs_register_toolchains(name = DEFAULT_NODE_REPOSITORY, register = True,
name = name + "_host",
user_node_repository_name = name,
)

nodejs_toolchains_repo(
name = name + "_toolchains",
user_node_repository_name = name,
Expand Down

0 comments on commit 1b2c029

Please sign in to comment.