FR: allow loading phase failures to be caught in Starlark tests
Open
P4
team-Starlark-Integration
type: feature request
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
Currently Skylib has [loadingtest.equals](https://github.com/bazelbuild/bazel-skylib/blob/main/lib/unittest.bzl#L636) to verify that a macro has expected output. However, we have no way to verify that a macro *fails* as expected: a loading phase failure cannot be caught, it causes the build to fail. Thus there is no loading phase analogue of `analysistest.make(..., expect_failure = True)`.
It would be useful if we had a mechanism similar to `--allow_analysis_failures` to make it possible to write a Starlark test framework that can catch and verify loading phase tests.
Potentially interested parties: @murali42
Contributor guide
Assessment
This issue has not been assessed yet.