rules_testing is a collection of utilities, libraries, and frameworks to make testing Starlark and Bazel rules easy and pleasant.
version |version|
To use rules_testing, you need to modify WORKSPACE
or MODULE.bazel
to depend on rules_testing. We recommend using bzlmod because it's simpler.
For bzlmod, add this to your MODULE.bazel
:
bazel_dep(name = "rules_testing", version = "<VERSION>", dev_dependency=True)
See the GitHub releases page for available versions.
For WORKSPACE
, see the GitHub releases page for the necessary config to copy and paste.
Analysis testing means testing something during the analysis phase of Bazel execution -- this is when rule logic is run.
See Analysis tests for how to write analysis tests.
Included in rules_testing is a fluent, truth-style asserts library.
See Truth docs for how to use it.
:glob: :hidden: self * api/index