Skip to content

Commit

Permalink
CI,windows: create test_suites for Windows tests
Browse files Browse the repository at this point in the history
Add recursive test_suite rules for all tests that
ci.bazel.io runs for Windows, and set the
top-level test_suite as the CI test target.

Doing so shortens the command line and works
around #3742

I verified that the old set of tests are the same
as the new set.

Change-Id: Id8d5da3f0c03c9b8969a9f8e1e9a3096888365aa
PiperOrigin-RevId: 169242858
  • Loading branch information
laszlocsomor committed Sep 19, 2017
1 parent 807a9b2 commit 088f611
Show file tree
Hide file tree
Showing 40 changed files with 693 additions and 12 deletions.
13 changes: 1 addition & 12 deletions scripts/ci/bazel-tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,19 +95,8 @@
// ASSERT_DEATH will try to write to C:/Windows, then fails.
"--test_env=TEMP"
],
"test_tag_filters": [
"-no_windows",
"-slow"
],
"tests": [
"//src/test/py/...",
"//src/test/java/...",
"//src/test/cpp/...",
"//src/test/native:all_tests",
"//src/tools/launcher/util/...",
"//src/test/shell/bazel:bazel_bootstrap_distfile_test",
"//src/test/shell/bazel:bazel_windows_example_test",
"//third_party/def_parser/..."
"//src:all_windows_tests"
],
"targets": ["//src:bazel"]
}
Expand Down
30 changes: 30 additions & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -447,3 +447,33 @@ genrule(
tools = ["combine_derived_java_srcs.sh"],
visibility = ["//:__pkg__"],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
"//src/test/cpp:all_windows_tests",
"//src/test/java/com/google/devtools/build/android:all_windows_tests",
"//src/test/java/com/google/devtools/build/docgen:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib:all_windows_tests",
"//src/test/java/com/google/devtools/build/skyframe:all_windows_tests",
"//src/test/java/com/google/devtools/common/options:all_windows_tests",
"//src/test/native:all_windows_tests",
"//src/test/py/bazel:all_windows_tests",
"//src/test/shell/bazel:bazel_bootstrap_distfile_test",
"//src/test/shell/bazel:bazel_windows_example_test",
"//src/tools/launcher:all_windows_tests",
# TODO(laszlocsomor): uncomment the line below after I added the
# corresponding target to the third_party package on GitHub.
# "//third_party/def_parser:all_windows_tests",
],
)
18 changes: 18 additions & 0 deletions src/test/cpp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,21 @@ cc_test(
)

test_suite(name = "all_tests")

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
"//src/test/cpp/util:all_windows_tests",
],
visibility = ["//src/test:__pkg__"],
)
17 changes: 17 additions & 0 deletions src/test/cpp/util/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,20 @@ cc_library(
)

test_suite(name = "all_tests")

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/cpp:__pkg__"],
)
23 changes: 23 additions & 0 deletions src/test/java/com/google/devtools/build/android/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,26 @@ java_library(
"//third_party:truth",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
"//src/test/java/com/google/devtools/build/android/desugar:all_windows_tests",
"//src/test/java/com/google/devtools/build/android/dexer:all_windows_tests",
"//src/test/java/com/google/devtools/build/android/idlclass:all_windows_tests",
"//src/test/java/com/google/devtools/build/android/junctions:all_windows_tests",
"//src/test/java/com/google/devtools/build/android/resources:all_windows_tests",
"//src/test/java/com/google/devtools/build/android/ziputils:all_windows_tests",
],
visibility = ["//src:__pkg__"],
)
18 changes: 18 additions & 0 deletions src/test/java/com/google/devtools/build/android/desugar/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1774,3 +1774,21 @@ java_binary(
"//third_party:guava",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
"//src/test/java/com/google/devtools/build/android/desugar/runtime:all_windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/android:__pkg__"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,20 @@ java_test(
"//third_party:truth",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/android/desugar:__pkg__"],
)
17 changes: 17 additions & 0 deletions src/test/java/com/google/devtools/build/android/dexer/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,20 @@ java_test(
":tests",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/android:__pkg__"],
)
17 changes: 17 additions & 0 deletions src/test/java/com/google/devtools/build/android/idlclass/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,20 @@ java_test(
"//third_party:truth",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/android:__pkg__"],
)
17 changes: 17 additions & 0 deletions src/test/java/com/google/devtools/build/android/junctions/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,20 @@ java_test(
"//third_party:truth",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/android:__pkg__"],
)
17 changes: 17 additions & 0 deletions src/test/java/com/google/devtools/build/android/resources/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,20 @@ java_test(
"//third_party:truth",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/android:__pkg__"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,20 @@ filegroup(
"merger/AndroidManifest.xml",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/android/testing:__pkg__"],
)
17 changes: 17 additions & 0 deletions src/test/java/com/google/devtools/build/android/ziputils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,20 @@ java_test(
"//third_party:truth",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/android:__pkg__"],
)
17 changes: 17 additions & 0 deletions src/test/java/com/google/devtools/build/docgen/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,20 @@ java_library(
"//src/main/java/com/google/devtools/build/lib:packages-internal",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src:__pkg__"],
)
30 changes: 30 additions & 0 deletions src/test/java/com/google/devtools/build/lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -1387,3 +1387,33 @@ test_suite(
name = "others",
tags = ["-" + n for n in TEST_SUITES],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
"//src/test/java/com/google/devtools/build/lib/analysis/platform:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/analysis/whitelisting:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/bazel/repository:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/buildeventservice:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/buildeventstream/transports:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/buildtool:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/rules/android:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/rules/apple:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/rules/config:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/rules/platform:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/rules/repository:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/skyframe:all_windows_tests",
"//src/test/java/com/google/devtools/build/lib/skylark:all_windows_tests",
],
visibility = ["//src:__pkg__"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,20 @@ java_test(
"//third_party:truth",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,20 @@ java_test(
"//third_party:truth",
],
)

test_suite(
name = "windows_tests",
tags = [
"-no_windows",
"-slow",
],
visibility = ["//visibility:private"],
)

test_suite(
name = "all_windows_tests",
tests = [
":windows_tests",
],
visibility = ["//src/test/java/com/google/devtools/build/lib:__pkg__"],
)
Loading

0 comments on commit 088f611

Please sign in to comment.