bazelbuild / bazelbuild/bazel-skylib
Document how to test a starlark function failure cases
- Dominant language
- Starlark
- Stars
- 444
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Description
Testing `fail()` scenarii in plain starlark functions using the `unittest` library is not supported out of the box and requires wrapping the function into a rule and creating an analysis test for it.
[This post](https://groups.google.com/g/bazel-discuss/c/GbaoLT4Ajac?pli=1) was very helpful in showing how to achieve that, and it would be great to add that somewhere in the docs (e.g. with a link to an example).
Contributor guide
Research direction
Start by reading the linked Bazel discussion and reviewing the existing documentation structure. Document how to test failure cases from plain Starlark functions using unittest, including wrapping the function in a rule and creating an analysis test; link to an example if appropriate.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100