1
- load ("@bazel_binaries//:defs.bzl" , "bazel_binaries" )
2
- load (
3
- "@rules_bazel_integration_test//bazel_integration_test:defs.bzl" ,
4
- "bazel_integration_tests" ,
5
- )
1
+ load (":integration.bzl" , "derive_metadata" , "example_integration_test_suite" )
6
2
7
3
genrule (
8
4
name = "update_bit_ignore" ,
@@ -21,54 +17,23 @@ genrule(
21
17
executable = True ,
22
18
)
23
19
20
+ SHARD_COUNT = 3
21
+
24
22
[
25
- bazel_integration_tests (
26
- name = "%s_test" % example ,
27
- timeout = "eternal" ,
28
- additional_env_inherit = [
29
- "ANDROID_HOME" ,
30
- "ANDROID_SDK_ROOT" ,
31
- "ANDROID_NDK_HOME" ,
32
- ],
33
- bazel_versions = [
34
- version
35
- for version in bazel_binaries .versions .all
36
- if version in metadata ["only" ] or (not metadata ["only" ] and version not in metadata ["exclude" ])
37
- ],
38
- tags = [],
39
- test_runner = "//src/main/kotlin/io/bazel/kotlin/test:BazelIntegrationTestRunner" ,
40
- workspace_files = glob (
41
- ["%s/**/**" % example ],
42
- # exclude any bazel directories if existing
43
- exclude = ["%s/bazel-*/**" % example ],
44
- ),
45
- workspace_path = example ,
23
+ example_integration_test_suite (
24
+ name = example ,
25
+ metadata = metadata ,
26
+ tags = ["shard_%s" % (idx % SHARD_COUNT )],
46
27
)
47
- for (example , metadata ) in {
48
- example : {
49
- "exclude" : [
50
- # Cut to the file name, and use it as an excluded bazel version. For exclusion to work
51
- # the file name in the `exclude` directory must match the bazel version in `bazel_binaries.versions.all`.
52
- # This is done as a secondary loop for readability and avoiding over-globbing.
53
- version .rpartition ("/" )[2 ]
54
- for version in glob (
55
- ["%s/exclude/*" % example ],
56
- allow_empty = True ,
57
- )
58
- ],
59
- "only" : [
60
- # Cut to the file name, and use it as an only bazel version. For exclusion to work
61
- # the file name in the `only` directory must match the bazel version in `bazel_binaries.versions.all`.
62
- # This is done as a secondary loop for readability and avoiding over-globbing.
63
- version .rpartition ("/" )[2 ]
64
- for version in glob (
65
- ["%s/only/*" % example ],
66
- allow_empty = True ,
67
- )
68
- ],
69
- }
28
+ for (
29
+ idx ,
30
+ (example , metadata ),
31
+ ) in enumerate ({
32
+ example : derive_metadata (
33
+ directory = example ,
34
+ )
70
35
for example in {
71
- # Cut to the directory.
36
+ # Cut to the directory, de-duplicate via dict .
72
37
file .partition ("/" )[0 ]: True
73
38
for file in glob (
74
39
["**/*" ],
@@ -77,10 +42,10 @@ genrule(
77
42
"*" ,
78
43
# Node is currently broken.
79
44
"node/**" ,
80
- # Anvil is broken by a verison upgrade.
45
+ # Anvil is broken by a version upgrade.
81
46
"anvil/**" ,
82
47
],
83
48
)
84
49
}
85
- }.items ()
50
+ }.items ())
86
51
]
0 commit comments