• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pantsbuild / pants / 33814013709
93%

Build:
DEFAULT BRANCH: main
Ran 03 Sep 2026 10:46PM UTC
Jobs 11
Files 1782
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Sep 2026 10:38PM UTC coverage: 92.894% (-0.001%) from 92.895%
33814013709

push

github

web-flow
Honor `[go-test].force_race` and the `test_race`/`test_msan`/`test_asan` fields (#23640)

`prepare_go_test_binary` builds its `GoBuildOptionsFromTargetRequest`
without `for_tests=True`:

```python
go_extract_build_options_from_target(
    GoBuildOptionsFromTargetRequest(request.field_set.address), **implicitly()
),
```

`go_extract_build_options_from_target` only populates
`test_target_fields` when that flag is set:

```python
if request.for_tests and GoTestBuildOptionsFieldSet.is_applicable(target):
    test_target_fields = GoTestBuildOptionsFieldSet.create(target)
```

and `test_target_fields` gates both the `[go-test].force_race` branch
and the `go_package(test_race=...)` field (likewise `test_msan` /
`test_asan`).

`go_package` also does not carry the non-test `race` / `cgo_enabled`
fields, so `GoBuildOptionsFieldSet` does not apply to it either and that
fallback misses as well. The net effect is that the only field the
resolution chain can still reach is `race` on the owning `go_mod`, so
**both documented ways to enable the race detector for a test are
silently ignored** — tests keep passing while no longer detecting races.

Introduced in #17825, which split test-binary production from running
it.

The existing coverage in `build_opts_test.py` passes `for_tests=True`
explicitly, which is why it never caught the buggy caller.

## Fix

Pass `for_tests=True`. One line.

## Tests

Three tests in `test_test.py`, exercising `[go-test].force_race`,
`go_package(test_race=True)`, and a default-off control so the probe
cannot pass for the wrong reason.

They use a real unsynchronised write rather than a `//go:build race`
file. That was my first attempt, and it does not work: package analysis
passes `CGO_ENABLED` and `EXTRA_BUILD_TAGS` but never the `race` build
tag, so `//go:build race` files are not selected even when `-race` does
reach the compiler. That looks like a separate gap and I have
deliberately left it alone here — happy to file it separately if... (continued)

22 of 23 new or added lines in 1 file covered. (95.65%)

44 existing lines in 4 files now uncovered.

95561 of 102871 relevant lines covered (92.89%)

3.66 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
96.36
0.0% src/python/pants/backend/go/goals/test_test.py

Coverage Regressions

Lines Coverage ∆ File
23
90.49
0.0% src/python/pants/backend/go/util_rules/third_party_pkg.py
13
92.47
0.0% src/python/pants/backend/go/goals/test.py
4
96.36
0.0% src/python/pants/backend/go/goals/test_test.py
4
94.92
-0.64% src/python/pants/backend/go/util_rules/third_party_pkg_test.py
Jobs
ID Job ID Ran Files Coverage
1 test_python_linux_x86_64_7/10 - 33814013709.1 03 Sep 2026 10:50PM UTC 1219
50.46
GitHub Action Run
2 test_python_linux_x86_64_6/10 - 33814013709.2 03 Sep 2026 10:48PM UTC 1212
50.04
GitHub Action Run
3 test_python_linux_x86_64_3/10 - 33814013709.3 03 Sep 2026 10:47PM UTC 1213
52.35
GitHub Action Run
4 test_python_linux_x86_64_8/10 - 33814013709.4 03 Sep 2026 10:50PM UTC 1214
52.73
GitHub Action Run
5 test_python_linux_x86_64_2/10 - 33814013709.5 03 Sep 2026 10:50PM UTC 1215
58.58
GitHub Action Run
6 test_python_linux_x86_64_4/10 - 33814013709.6 03 Sep 2026 10:51PM UTC 1245
59.04
GitHub Action Run
7 test_python_linux_x86_64_5/10 - 33814013709.7 03 Sep 2026 10:47PM UTC 1230
60.27
GitHub Action Run
8 test_python_linux_arm64 - 33814013709.8 03 Sep 2026 10:46PM UTC 1196
52.67
GitHub Action Run
9 test_python_linux_x86_64_1/10 - 33814013709.9 03 Sep 2026 10:47PM UTC 1215
48.87
GitHub Action Run
10 test_python_linux_x86_64_0/10 - 33814013709.10 03 Sep 2026 10:47PM UTC 1236
57.46
GitHub Action Run
11 test_python_linux_x86_64_9/10 - 33814013709.11 03 Sep 2026 10:48PM UTC 1225
53.97
GitHub Action Run
Source Files on build 33814013709
  • Tree
  • List 1782
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #33814013709
  • 2a3f7f10 on github
  • Prev Build on main (#33814103561)
  • Next Build on main (#34389402470)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc