Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dashboard: refactor mechanism for adjusting cmd/dist test policy
Previously, the behavior of ShouldRunDistTest could be overridden by an individual builder by setting a the shouldRunDistTest field to a custom policy implementation. A pitfall of this approach is that it requires each custom policy to reimplement the default cmd/dist test policy as well. If that isn't done when attempting to make a small adjustment to the default policy, the result is that the default policy is ignored. The fasterTrybots policy, as the name suggests, exists to skip some tests in trybot mode. Due to the problem above, it was causing some builders to run more tests in trybot mode than they would if it weren't applied. For example, the freebsd-amd64-12_0 builder should have been skipping the "api" test in trybot mode, but wasn't. This refactor fixes that by modifying the approach for how individual builders can customize the cmd/dist test behavior. Now, a function distTestAdjust is called with the first parameter specifying the default policy decision. That function can adjust the decision as it sees fit, but otherwise it preserves its initial value in situations where no change is intended to be made. For golang/go#38279. Change-Id: I220248f51abfc8e77195ae0c9134a17f7cac9bc2 Reviewed-on: https://go-review.googlesource.com/c/build/+/227777 Reviewed-by: Alexander Rakoczy <[email protected]>
- Loading branch information