Helpers for making test assertions
Generates a test target which fails if the file doesn't contain the string.
Depends on bash, as it creates an sh_test target.
PARAMETERS
Name | Description | Default Value |
---|---|---|
name | target to create | none |
actual | Label of a file | none |
expected | a string which should appear in the file | none |
size | the size attribute of the test target | None |
timeout | the timeout attribute of the test target | None |
Assert that the given json files have the same semantic content.
Uses jq to filter each file. The default value of "."
as the filter means to compare the whole file.
See the jq rule for more about the filter expressions as well as setup notes for the jq
toolchain.
PARAMETERS
Name | Description | Default Value |
---|---|---|
name | name of resulting diff_test target | none |
file1 | a json file | none |
file2 | another json file | none |
filter1 | a jq filter to apply to file1 | “.” |
filter2 | a jq filter to apply to file2 | “.” |
Assert that the default outputs of a target are the expected ones.
PARAMETERS
Name | Description | Default Value |
---|---|---|
name | name of the resulting diff_test | none |
actual | string of the label to check the outputs | none |
expected | a list of rootpaths of expected outputs, as they would appear in a runfiles manifest | none |