1load("@aspect_rules_js//js:defs.bzl", "js_test")
2load("//:typescript.bzl", "flatbuffer_ts_library")
3
4package(default_visibility = ["//visibility:private"])
5
6flatbuffer_ts_library(
7 name = "typescript_ts_fbs",
8 srcs = ["typescript_keywords.fbs"],
9 deps = [
10 "//tests/ts/test_dir:include_ts_fbs",
11 "//tests/ts/test_dir:typescript_transitive_ts_fbs",
12 ],
13)
14
15TEST_DATA = glob([
16 "my-game/*.js",
17 "my-game/example/*.js",
18 "my-game/example2/*.js",
19])
20
21TEST_UNION_VECTOR_DATA = glob([
22 "union_vector/*.js",
23])
24
25TEST_COMPLEX_ARRAYS_DATA = glob([
26 "arrays_test_complex/**/*.js",
27])
28
29# Here we're running the tests against the checked-in generated files. These
30# are kept up-to-date with a CI-based mechanism. The intent of running these
31# tests here via bazel is not to validate that they're up-to-date. Instead, we
32# just want to make it easy to run these tests while making other changes. For
33# example, this is useful when making changes to the rules_js setup to validate
34# that the basic infrastructure is still working.
35[js_test(
36 name = "%s_test" % test,
37 chdir = package_name(),
38 data = data + [
39 "package.json",
40 "//:node_modules/flatbuffers",
41 "//tests:test_data_copied_to_bin",
42 ],
43 entry_point = "%s.js" % test,
44) for test, data in (
45 ("JavaScriptTest", TEST_DATA),
46 ("JavaScriptUnionVectorTest", TEST_UNION_VECTOR_DATA),
47 # TODO(philsc): Figure out how to run this test with flexbuffers available.
48 # At the moment the flexbuffer library is not exposed as a bazel target.
49 #("JavaScriptFlexBuffersTest", TBD_DATA)
50 ("JavaScriptComplexArraysTest", TEST_COMPLEX_ARRAYS_DATA),
51)]
52
53sh_test(
54 name = "bazel_repository_test",
55 srcs = ["bazel_repository_test.sh"],
56 data = [
57 "//:distribution",
58 "@bazel_linux_x86_64//file",
59 ] + glob(
60 [
61 "bazel_repository_test_dir/**/*",
62 ],
63 exclude = [
64 "bazel_repository_test_dir/bazel-*/**",
65 ],
66 ),
67 tags = [
68 # Since we have bazel downloading external repositories inside this
69 # test, we need to give it access to the internet.
70 "requires-network",
71 ],
72 # We only have x86_64 Linux bazel exposed so restrict the test to that.
73 target_compatible_with = [
74 "@platforms//cpu:x86_64",
75 "@platforms//os:linux",
76 ],
77 deps = ["@bazel_tools//tools/bash/runfiles"],
78)
View as plain text