Skip to content

Commit c21996d

Browse files
More fixes for BCR (#310)
* More fixes for BCR Fixes for E2e tests for the BCR * updates * version
1 parent 057b663 commit c21996d

File tree

11 files changed

+232
-12
lines changed

11 files changed

+232
-12
lines changed

.bcr/presubmit.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,36 @@ tasks:
88
name: Verify build targets (Debian 10)
99
platform: debian10
1010
bazel: ${{ bazel }}
11+
build_flags:
12+
- '--cxxopt=-std=c++17'
13+
- '--host_cxxopt=-std=c++17'
1114
build_targets:
1215
- '@bazel-diff//:bazel-diff'
1316
verify_targets_ubuntu2004:
1417
name: Verify build targets (Ubuntu 20.04)
1518
platform: ubuntu2004
1619
bazel: ${{ bazel }}
17-
build_targets:
18-
- '@bazel-diff//:bazel-diff'
19-
verify_targets_macos:
20-
name: Verify build targets (macOS)
21-
platform: macos
22-
bazel: ${{ bazel }}
20+
build_flags:
21+
- '--cxxopt=-std=c++17'
22+
- '--host_cxxopt=-std=c++17'
2323
build_targets:
2424
- '@bazel-diff//:bazel-diff'
2525
verify_targets_macos_arm64:
2626
name: Verify build targets (macOS ARM64)
2727
platform: macos_arm64
2828
bazel: ${{ bazel }}
29+
build_flags:
30+
- '--cxxopt=-std=c++17'
31+
- '--host_cxxopt=-std=c++17'
2932
build_targets:
3033
- '@bazel-diff//:bazel-diff'
3134
verify_targets_windows_7x:
3235
name: Verify build targets (Windows, Bazel 7.x)
3336
platform: windows
3437
bazel: "7.x"
38+
build_flags:
39+
- '--cxxopt=-std=c++17'
40+
- '--host_cxxopt=-std=c++17'
3541
build_targets:
3642
- '@bazel-diff//:bazel-diff'
3743
verify_targets_windows_8x:
@@ -40,6 +46,8 @@ tasks:
4046
bazel: "8.x"
4147
build_flags:
4248
- '--legacy_external_runfiles'
49+
- '--cxxopt=-std=c++17'
50+
- '--host_cxxopt=-std=c++17'
4351
build_targets:
4452
- '@bazel-diff//:bazel-diff'
4553
verify_targets_windows_9x:
@@ -48,14 +56,15 @@ tasks:
4856
bazel: "9.x"
4957
build_flags:
5058
- '--legacy_external_runfiles'
59+
- '--cxxopt=-std=c++17'
60+
- '--host_cxxopt=-std=c++17'
5161
build_targets:
5262
- '@bazel-diff//:bazel-diff'
5363
bcr_test_module:
5464
module_path: ""
5565
matrix:
5666
platform:
5767
- ubuntu2004
58-
- macos
5968
- macos_arm64
6069
bazel:
6170
- 8.x
@@ -65,5 +74,8 @@ bcr_test_module:
6574
name: Run test
6675
platform: ${{ platform }}
6776
bazel: ${{ bazel }}
77+
build_flags:
78+
- '--cxxopt=-std=c++17'
79+
- '--host_cxxopt=-std=c++17'
6880
test_targets:
6981
- '//cli/...'

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module(
22
name = "bazel-diff",
3-
version = "15.0.1",
3+
version = "15.0.2",
44
compatibility_level = 0,
55
)
66

MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/src/test/kotlin/com/bazel_diff/e2e/E2ETest.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class E2ETest {
2222
return targets.filter { target ->
2323
// Filter out bazel-diff's own internal test targets
2424
!target.contains("bazel-diff-integration-tests") &&
25+
!target.contains("@@//:BUILD") &&
2526
!target.contains("bazel_diff_maven") // Filter out bazel-diff's maven dependencies
2627
}.toSet()
2728
}
@@ -695,9 +696,13 @@ class E2ETest {
695696
val gson = Gson()
696697
val shape = object : TypeToken<List<Map<String, Any>>>() {}.type
697698
val actual =
698-
gson.fromJson<List<Map<String, Any>>>(impactedTargetsOutput.readText(), shape).sortedBy {
699-
it["label"] as String
700-
}
699+
gson.fromJson<List<Map<String, Any>>>(impactedTargetsOutput.readText(), shape)
700+
.filter { target ->
701+
// Filter out Bazel convenience symlink targets (bazel-*) as they're not reliably
702+
// present across all environments
703+
!(target["label"] as String).contains("//bazel-")
704+
}
705+
.sortedBy { it["label"] as String }
701706
val expected: List<Map<String, Any>> =
702707
listOf(
703708
mapOf("label" to "//A:one", "targetDistance" to 0.0, "packageDistance" to 0.0),
Binary file not shown.
8 Bytes
Binary file not shown.
8 Bytes
Binary file not shown.

cli/src/test/resources/workspaces/distance_metrics/A/BUILD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
2+
load("@rules_shell//shell:sh_library.bzl", "sh_library")
13

24
sh_binary(
35
name = "one",

cli/src/test/resources/workspaces/distance_metrics/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@rules_shell//shell:sh_library.bzl", "sh_library")
12

23
sh_library(
34
name = "lib",
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module(
2+
name = "distance_metrics_integration",
3+
version = "0.0.0",
4+
)
5+
6+
bazel_dep(name = "bazel_skylib", version = "1.9.0")
7+
bazel_dep(name = "rules_shell", version = "0.4.0")

0 commit comments

Comments
 (0)