Skip to content

Commit

Permalink
test: add rules_nodejs to integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Dec 21, 2021
1 parent 341a9d8 commit 5875623
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 74 deletions.
26 changes: 13 additions & 13 deletions e2e/core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ write_file(
# alias(
# name = "node_bin",
# actual = select({
# "@rules_nodejs//nodejs:is_darwin_arm64": "@node16_darwin_arm64//:node_bin",
# "@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_bin",
# "@rules_nodejs//nodejs:is_linux_arm64": "@node16_linux_arm64//:node_bin",
# "@rules_nodejs//nodejs:is_linux_s390x": "@node16_linux_s390x//:node_bin",
# "@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_bin",
# "@rules_nodejs//nodejs:is_linux_ppc64le": "@node16_linux_ppc64le//:node_bin",
# "@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_bin",
# "@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": "@node16_darwin_arm64//:node_bin",
# "@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_bin",
# "@build_bazel_rules_nodejs//nodejs:is_linux_arm64": "@node16_linux_arm64//:node_bin",
# "@build_bazel_rules_nodejs//nodejs:is_linux_s390x": "@node16_linux_s390x//:node_bin",
# "@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_bin",
# "@build_bazel_rules_nodejs//nodejs:is_linux_ppc64le": "@node16_linux_ppc64le//:node_bin",
# "@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_bin",
# "//conditions:default": "@node16_linux_amd64//:node_bin",
# }),
# )
Expand Down Expand Up @@ -213,9 +213,9 @@ my_nodejs(
# using the select statement will download toolchains for all three platforms
# you can also just provide an individual toolchain if you don't want to download them all
toolchain = select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
}),
)

Expand All @@ -233,9 +233,9 @@ my_nodejs(
# using the select statement will download toolchains for all three platforms
# you can also just provide an individual toolchain if you don't want to download them all
toolchain = select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
}),
)

Expand Down
2 changes: 1 addition & 1 deletion internal/common/copy_to_bin.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def copy_to_bin(name, srcs, **kwargs):
name = name,
srcs = srcs,
is_windows = select({
"@rules_nodejs//nodejs:is_windows_amd64": True,
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": True,
"//conditions:default": False,
}),
**kwargs
Expand Down
2 changes: 1 addition & 1 deletion internal/common/params_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def params_file(
data = data,
newline = newline or "auto",
is_windows = select({
"@rules_nodejs//nodejs:is_windows_amd64": True,
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": True,
"//conditions:default": False,
}),
**kwargs
Expand Down
2 changes: 1 addition & 1 deletion internal/js_library/js_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ def js_library(
# TODO: remove once legacy module_mapping is removed
module_name = package_name if package_name != "$node_modules$" and package_name != "$node_modules_dir$" else None,
is_windows = select({
"@rules_nodejs//nodejs:is_windows_amd64": True,
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": True,
"//conditions:default": False,
}),
**kwargs
Expand Down
2 changes: 1 addition & 1 deletion internal/linker/npm_link.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ set to the target's package & the files provided from the targets DefaultInfo.
package_name = package_name,
package_path = package_path,
is_windows = select({
"@rules_nodejs//nodejs:is_windows_amd64": True,
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": True,
"//conditions:default": False,
}),
**kwargs
Expand Down
60 changes: 30 additions & 30 deletions internal/node/test/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,9 @@ nodejs_binary(
# using the select statement will download toolchains for all three platforms
# you can also just provide an individual toolchain if you don't want to download them all
toolchain = select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
}),
)

Expand All @@ -570,9 +570,9 @@ nodejs_binary(
# using the select statement will download toolchains for all three platforms
# you can also just provide an individual toolchain if you don't want to download them all
toolchain = select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
}),
)

Expand All @@ -587,9 +587,9 @@ nodejs_test(
# using the select statement will download toolchains for all three platforms
# you can also just provide an individual toolchain if you don't want to download them all
toolchain = select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
}),
)

Expand All @@ -599,9 +599,9 @@ nodejs_test(
# using the select statement will download toolchains for all three platforms
# you can also just provide an individual toolchain if you don't want to download them all
toolchain = select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
}),
)

Expand All @@ -626,14 +626,14 @@ nodejs_test(
# using the select statement will download toolchains for all platforms
# you can also just provide an individual toolchain if you don't want to download them all
select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
}),
select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
}),
],
)
Expand Down Expand Up @@ -661,14 +661,14 @@ nodejs_test(
# using the select statement will download toolchains for all platforms
# you can also just provide an individual toolchain if you don't want to download them all
select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
}),
select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
}),
],
)
Expand Down Expand Up @@ -697,14 +697,14 @@ nodejs_test(
# using the select statement will download toolchains for all platforms
# you can also just provide an individual toolchain if you don't want to download them all
select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node16_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node16_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node16_windows_amd64//:node_toolchain",
}),
select({
"@rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@node15_linux_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@node15_darwin_amd64//:node_toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@node15_windows_amd64//:node_toolchain",
}),
],
)
Expand Down
4 changes: 2 additions & 2 deletions internal/pkg_npm/pkg_npm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@ def pkg_npm_macro(name, tgz = None, **kwargs):
native.alias(
name = name + ".pack",
actual = select({
"@rules_nodejs//nodejs:is_windows_amd64": name + ".pack.bat",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": name + ".pack.bat",
"//conditions:default": name + ".pack.sh",
}),
)

native.alias(
name = name + ".publish",
actual = select({
"@rules_nodejs//nodejs:is_windows_amd64": name + ".publish.bat",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": name + ".publish.bat",
"//conditions:default": name + ".publish.sh",
}),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def copy_file(name, src, out, is_directory = False, is_executable = False, allow
src = src,
out = out,
is_windows = select({
"@rules_nodejs//nodejs:is_windows_amd64": True,
"@bazel_tools//src/conditions:host_windows": True,
"//conditions:default": False,
}),
is_executable = is_executable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def write_file(
out = out,
newline = newline or "auto",
is_windows = select({
"@rules_nodejs//nodejs:is_windows_amd64": True,
"@bazel_tools//src/conditions:host_windows": True,
"//conditions:default": False,
}),
**kwargs
Expand All @@ -107,7 +107,7 @@ def write_file(
out = out,
newline = newline or "auto",
is_windows = select({
"@rules_nodejs//nodejs:is_windows_amd64": True,
"@bazel_tools//src/conditions:host_windows": True,
"//conditions:default": False,
}),
**kwargs
Expand Down
16 changes: 8 additions & 8 deletions toolchains/cypress/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ toolchain_type(name = "toolchain_type")
alias(
name = "toolchain",
actual = select({
"@rules_nodejs//nodejs:is_darwin_amd64": ":cypress_darwin_toolchain_config",
"@rules_nodejs//nodejs:is_darwin_arm64": ":cypress_darwin_arm64_toolchain_config",
"@rules_nodejs//nodejs:is_linux_amd64": ":cypress_linux_toolchain_config",
"@rules_nodejs//nodejs:is_windows_amd64": ":cypress_windows_toolchain_config",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": ":cypress_darwin_toolchain_config",
"@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": ":cypress_darwin_arm64_toolchain_config",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": ":cypress_linux_toolchain_config",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": ":cypress_windows_toolchain_config",
"//conditions:default": ":cypress_linux_toolchain_config",
}),
visibility = ["//visibility:public"],
Expand All @@ -51,10 +51,10 @@ alias(
alias(
name = "cypress_bin",
actual = select({
"@rules_nodejs//nodejs:is_darwin_amd64": "@cypress_darwin//:bin",
"@rules_nodejs//nodejs:is_darwin_arm64": "@cypress_darwin_arm64//:bin",
"@rules_nodejs//nodejs:is_linux_amd64": "@cypress_linux//:bin",
"@rules_nodejs//nodejs:is_windows_amd64": "@cypress_windows//:bin",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@cypress_darwin//:bin",
"@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": "@cypress_darwin_arm64//:bin",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@cypress_linux//:bin",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@cypress_windows//:bin",
"//conditions:default": "@cypress_linux//:bin",
}),
visibility = ["//visibility:public"],
Expand Down
28 changes: 14 additions & 14 deletions toolchains/node/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ toolchain_type(
alias(
name = "toolchain",
actual = select({
"@rules_nodejs//nodejs:is_darwin_arm64": "@nodejs_darwin_arm64_config//:toolchain",
"@rules_nodejs//nodejs:is_darwin_amd64": "@nodejs_darwin_amd64_config//:toolchain",
"@rules_nodejs//nodejs:is_linux_arm64": "@nodejs_linux_arm64_config//:toolchain",
"@rules_nodejs//nodejs:is_linux_s390x": "@nodejs_linux_s390x_config//:toolchain",
"@rules_nodejs//nodejs:is_linux_amd64": "@nodejs_linux_amd64_config//:toolchain",
"@rules_nodejs//nodejs:is_windows_amd64": "@nodejs_windows_amd64_config//:toolchain",
"@rules_nodejs//nodejs:is_linux_ppc64le": "@nodejs_linux_ppc64le_config//:toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": "@nodejs_darwin_arm64_config//:toolchain",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@nodejs_darwin_amd64_config//:toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_arm64": "@nodejs_linux_arm64_config//:toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_s390x": "@nodejs_linux_s390x_config//:toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@nodejs_linux_amd64_config//:toolchain",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@nodejs_windows_amd64_config//:toolchain",
"@build_bazel_rules_nodejs//nodejs:is_linux_ppc64le": "@nodejs_linux_ppc64le_config//:toolchain",
"//conditions:default": "@nodejs_linux_amd64_config//:toolchain",
}),
visibility = ["//visibility:public"],
Expand All @@ -56,13 +56,13 @@ alias(
alias(
name = "node_bin",
actual = select({
"@rules_nodejs//nodejs:is_darwin_arm64": "@nodejs_darwin_arm64//:node_bin",
"@rules_nodejs//nodejs:is_darwin_amd64": "@nodejs_darwin_amd64//:node_bin",
"@rules_nodejs//nodejs:is_linux_arm64": "@nodejs_linux_arm64//:node_bin",
"@rules_nodejs//nodejs:is_linux_s390x": "@nodejs_linux_s390x//:node_bin",
"@rules_nodejs//nodejs:is_linux_amd64": "@nodejs_linux_amd64//:node_bin",
"@rules_nodejs//nodejs:is_linux_ppc64le": "@nodejs_linux_ppc64le//:node_bin",
"@rules_nodejs//nodejs:is_windows_amd64": "@nodejs_windows_amd64//:node_bin",
"@build_bazel_rules_nodejs//nodejs:is_darwin_arm64": "@nodejs_darwin_arm64//:node_bin",
"@build_bazel_rules_nodejs//nodejs:is_darwin_amd64": "@nodejs_darwin_amd64//:node_bin",
"@build_bazel_rules_nodejs//nodejs:is_linux_arm64": "@nodejs_linux_arm64//:node_bin",
"@build_bazel_rules_nodejs//nodejs:is_linux_s390x": "@nodejs_linux_s390x//:node_bin",
"@build_bazel_rules_nodejs//nodejs:is_linux_amd64": "@nodejs_linux_amd64//:node_bin",
"@build_bazel_rules_nodejs//nodejs:is_linux_ppc64le": "@nodejs_linux_ppc64le//:node_bin",
"@build_bazel_rules_nodejs//nodejs:is_windows_amd64": "@nodejs_windows_amd64//:node_bin",
"//conditions:default": "@nodejs_linux_amd64//:node_bin",
}),
visibility = ["//visibility:public"],
Expand Down

0 comments on commit 5875623

Please sign in to comment.