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

pantsbuild / pants / 18857275271

27 Oct 2025 10:06PM UTC coverage: 80.287% (+0.005%) from 80.282%
18857275271

push

github

web-flow
test_shell_command: use correct default cache scope for a test's environment (#22804)

Fix `test_shell_command` to use the correct default process cache scope
for the environment in which the test is running. The existing code was
always using the "success" cache scope.

For workspace environments (i.e., `experimental_workspace_environment`)
however, the default is "session" scope and not the "success" scope used
for other environments. "Session" scope is used for in-workspace
execution because Pants does not know how underlying tools cache and
invalidate their results. Thus always running a tool each session makes
sure Pants does not inadvertently cache a result which the tool would
have recomputed.

Also add `cache_scope` as a field on `test_shell_command` so users may
override the caches scope as needed.

29 of 31 new or added lines in 2 files covered. (93.55%)

77902 of 97030 relevant lines covered (80.29%)

3.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.71
/src/python/pants/backend/shell/goals/test.py


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc