Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing tests on CI #1317

Merged
merged 10 commits into from
Dec 12, 2024
7 changes: 3 additions & 4 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ buildifier:
version: latest
warnings: "default"
platforms:
ubuntu1804:
test_targets:
- "//..."
skip_in_bazel_downstream_pipeline: "Newer abseil-cpp introduced no longer works on this old platform"
ubuntu2004:
test_targets:
- "//..."
Expand All @@ -25,3 +21,6 @@ platforms:
test_targets:
- "--"
- "//:tests"
- "-//warn/docs:docs_test"
- "-//build:build_test"
- "-//buildifier:buildifier_integration_test"
16 changes: 8 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ module(
version = "0.0.0",
)

bazel_dep(name = "aspect_bazel_lib", version = "2.7.9")
bazel_dep(name = "aspect_rules_js", version = "2.0.1")
bazel_dep(name = "bazel_features", version = "1.14.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.9.4")
bazel_dep(name = "aspect_rules_js", version = "2.1.2")
bazel_dep(name = "bazel_features", version = "1.22.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "gazelle", version = "0.37.0", repo_name = "bazel_gazelle")
bazel_dep(name = "protobuf", version = "28.0-rc1", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_go", version = "0.49.0", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_nodejs", version = "6.2.0")
bazel_dep(name = "rules_proto", version = "6.0.2")
bazel_dep(name = "gazelle", version = "0.40.0", repo_name = "bazel_gazelle")
bazel_dep(name = "protobuf", version = "29.1", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_go", version = "0.50.1", repo_name = "io_bazel_rules_go")
bazel_dep(name = "rules_nodejs", version = "6.3.2")
bazel_dep(name = "rules_proto", version = "7.0.2")
# -- bazel_dep definitions -- #

go_sdk = use_extension("@io_bazel_rules_go//go:extensions.bzl", "go_sdk")
Expand Down
2 changes: 1 addition & 1 deletion api_proto/api.gen.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build_proto/build.gen.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deps_proto/deps.gen.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion extra_actions_base_proto/extra_actions_base.gen.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions warn/docs/docs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ package main

import (
"os"
"path"
"path/filepath"
"testing"

"github.com/bazelbuild/buildtools/testutils"
"github.com/bazelbuild/buildtools/warn"
)

func TestAllWarningsAreDocumented(t *testing.T) {
testdata := path.Join(os.Getenv("TEST_SRCDIR"), os.Getenv("TEST_WORKSPACE"))
testdata := filepath.Join(
filepath.FromSlash(os.Getenv("TEST_SRCDIR")),
filepath.FromSlash(os.Getenv("TEST_WORKSPACE")))

textprotoPath := path.Join(testdata, "warn", "docs", "warnings.textproto")
textprotoPath := filepath.Join(testdata, "warn", "docs", "warnings.textproto")
warnings, err := readWarningsFromFile(textprotoPath)
if err != nil {
t.Fatalf("getWarnings(%q) = %v", textprotoPath, err)
Expand All @@ -49,15 +51,17 @@ func TestAllWarningsAreDocumented(t *testing.T) {
}

func TestFilesMatch(t *testing.T) {
testdata := path.Join(os.Getenv("TEST_SRCDIR"), os.Getenv("TEST_WORKSPACE"))
testdata := filepath.Join(
filepath.FromSlash(os.Getenv("TEST_SRCDIR")),
filepath.FromSlash(os.Getenv("TEST_WORKSPACE")))

generatedPath := path.Join(testdata, "warn", "docs", "WARNINGS.md")
generatedPath := filepath.Join(testdata, "warn", "docs", "WARNINGS.md")
generated, err := os.ReadFile(generatedPath)
if err != nil {
t.Fatalf("ReadFile(%q) = %v", generatedPath, err)
}

checkedInPath := path.Join(testdata, "WARNINGS.md")
checkedInPath := filepath.Join(testdata, "WARNINGS.md")
checkedIn, err := os.ReadFile(checkedInPath)
if err != nil {
t.Fatalf("ReadFile(%q) = %v", checkedInPath, err)
Expand Down