Skip to content

Commit 47b5773

Browse files
authored
CI: sync BCR and presubmit tests (#2218)
**What type of PR is this?** Test **What package or component does this PR mostly affect?** > all **What does this PR do? Why is it needed?** - BCR: Drop support for Debian 10. It's old, we don't test it in presubmit, and protoc has compile errors there. - BCR: test both go_work and go_mod since we test both in presubmit. - Presubmit: squash windows and non-windows tests. They're not separated on BCR, and they're nearly identical. **Which issues(s) does this PR fix?** For #2208 **Other notes for review**
1 parent 855be08 commit 47b5773

File tree

2 files changed

+34
-58
lines changed

2 files changed

+34
-58
lines changed

.bazelci/presubmit.yml

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ matrix:
33
platform:
44
- ubuntu2204
55
- macos
6+
- windows
67
bazel: [6.*, 7.*, 8.*]
78
bcr_variant:
89
- tests/bcr/go_work
@@ -39,6 +40,7 @@ tasks:
3940
- "-//internal:bazel_test"
4041
- "-//cmd/gazelle:gazelle_test"
4142
bcr_tests:
43+
# Keep in sync with .bcr/presubmit.yml
4244
name: BCR test module
4345
platform: ${{ platform }}
4446
bazel: ${{ bazel }}
@@ -61,34 +63,6 @@ tasks:
6163
- "//proto:proto_test"
6264
- "//..."
6365
- "@test_dep//..."
64-
bcr_test_windows:
65-
name: BCR test on Windows
66-
platform: windows
67-
bazel: ${{ bazel }}
68-
working_directory: ${{ bcr_variant }}
69-
shell_commands:
70-
# Regenerate the BUILD file for the test module using Gazelle.
71-
# Also verify -repo_config are generated correctly in gazelle.bash
72-
- rm pkg/BUILD.bazel
73-
- bazel run //:gazelle -- pkg
74-
- bazel run //:gazelle -- update pkg
75-
# Verify that bazel mod tidy doesn't remove use_repos required to build and test.
76-
- bazel mod tidy || true # Unsupported on Bazel 6
77-
build_flags:
78-
# Since go_sdk is platform-dependent, the lockfile will differ between
79-
# platforms. We will skip the check on windows.
80-
- "--lockfile_mode=update"
81-
test_flags:
82-
# See above.
83-
- "--lockfile_mode=update"
84-
build_targets:
85-
- "//..."
86-
- "//:gazelle"
87-
test_targets:
88-
# Specify this target explicitly to verify that Gazelle generated it correctly.
89-
- "//pkg:pkg_test"
90-
- "//..."
91-
- "@test_dep//..."
9266
macos_arm64_bzlmod:
9367
name: Mac OS Arm 64 with Bzlmod
9468
platform: macos_arm64

.bcr/presubmit.yml

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
1-
bcr_test_module:
2-
module_path: tests/bcr/go_mod
3-
matrix:
4-
platform:
5-
- debian10
6-
- ubuntu2004
7-
- macos
8-
- windows
9-
bazel: [6.*, 7.*, 8.*]
10-
tasks:
11-
run_test_module:
12-
name: Run test module
13-
platform: ${{ platform }}
14-
bazel: ${{ bazel }}
15-
shell_commands:
16-
# Regenerate the BUILD files for the test module using Gazelle.
17-
- rm pkg/BUILD.bazel proto/BUILD.bazel
18-
- bazel run //:gazelle -- update pkg proto
19-
- bazel run //:gazelle -- pkg proto
20-
# Verify that bazel mod tidy doesn't remove use_repos required to build and test.
21-
- bazel mod tidy || true # Unsupported on Bazel 6
22-
build_targets:
23-
- //...
24-
- //:gazelle
25-
test_targets:
26-
# Specify these targets explicitly to verify that Gazelle generates them correctly.
27-
- "//pkg:pkg_test"
28-
- "//proto:proto_test"
29-
- "//..."
30-
- "@test_dep//..."
1+
matrix:
2+
platform:
3+
- ubuntu2004
4+
- macos
5+
- windows
6+
bazel: [6.*, 7.*, 8.*]
7+
bcr_variant:
8+
- tests/bcr/go_work
9+
- tests/bcr/go_mod
10+
tasks:
11+
run_test_module:
12+
# Keep in sync with .bazelci/presubmit.yml
13+
name: Run test module
14+
platform: ${{ platform }}
15+
bazel: ${{ bazel }}
16+
working_directory: ${{ bcr_variant }}
17+
shell_commands:
18+
# Regenerate the BUILD files for the test module using Gazelle.
19+
- rm pkg/BUILD.bazel proto/BUILD.bazel
20+
- bazel run //:gazelle -- pkg proto
21+
- bazel run //:gazelle -- update pkg proto
22+
# Verify that bazel mod tidy doesn't remove use_repos required to build and test.
23+
- bazel mod tidy || true # Unsupported on Bazel 6
24+
build_targets:
25+
- //...
26+
- //:gazelle
27+
test_targets:
28+
# Specify these targets explicitly to verify that Gazelle generates them correctly.
29+
- "//pkg:pkg_test"
30+
- "//proto:proto_test"
31+
- "//..."
32+
- "@test_dep//..."

0 commit comments

Comments
 (0)