forked from bazel-contrib/rules_nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.bzl
26 lines (22 loc) · 930 Bytes
/
test.bzl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"Define a convenience macro for e2e integration testing"
load("@build_bazel_rules_nodejs//internal/bazel_integration_test:bazel_integration_test.bzl", "rules_nodejs_integration_test")
def e2e_integration_test(name, **kwargs):
"Set defaults for the bazel_integration_test common to our e2e"
workspace_root = kwargs.pop("workspace_root", name[len("e2e_"):])
native.filegroup(
name = "_%s_sources" % name,
srcs = native.glob(
[
"%s/*" % workspace_root,
"%s/**/*" % workspace_root,
],
exclude = ["%s/node_modules/**" % workspace_root],
),
)
rules_nodejs_integration_test(
name = name,
tags = kwargs.pop("tags", []) + ["e2e"],
workspace_files = kwargs.pop("workspace_files", "_%s_sources" % name),
resolutions = {"//packages/worker:npm_package": "@bazel/worker"},
**kwargs
)