docs: update test/README, document skylib - #323
Conversation
fe127a2 to
03f71b4
Compare
03f71b4 to
17fb58f
Compare
| ### Create a skylib test | ||
|
|
||
| With skylib we can test anything that does not use the output of | ||
| `ctx.actions.run` actions (i.e. anything known at analysis time). |
There was a problem hiding this comment.
Analysis time of bazel, not static analysis time.
There was a problem hiding this comment.
Fair, I have pointed that out!
| | Function | Purpose | | ||
| |---|---| | ||
| | `asserts.true(env, cond, msg)` | Condition is true | | ||
| | `asserts.false(env, cond, msg)` | Condition is false | | ||
| | `asserts.equals(env, expected, actual)` | Equality check | | ||
| | `asserts.new_set_equals(env, expected, actual)` | Set equality | |
There was a problem hiding this comment.
There is a fine line in between describing how we do skylib tests here, and essentially duplicating the documentation of another tool here. This might be overkill, also considering that these functions are kind of trivial.
There was a problem hiding this comment.
I have trimmed it a lot and left the original doc links to fill these gaps.
I'm not sure if the section about aspects should stay, since it is documented in Skylib. Whats your thoughts on this?
I left in custom_attributes, since this is not something that necessarily needs documentation; it's more for giving ideas on what can be done when writing tests.
As you know I also prefer slim or better very slim documentation. |
Why:
We want contributors to have an easy time writing tests.
What:
Addresses:
Fixes: #321