Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspect.build/llms.txt

Use this file to discover all available pages before exploring further.

Documentation for @bazel_lib@v3.2.0 View source
Helpers for making test assertions

Function: assert_contains

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
name
required
target to create
actual
name
required
Label of a file
expected
name
required
a string which should appear in the file
size
name
default:"small"
standard attribute for tests
kwargs
string_list
additional named arguments for the resulting sh_test

Function: assert_outputs

Assert that the default outputs of a target are the expected ones.

Parameters

name
name
required
name of the resulting diff_test
actual
name
required
string of the label to check the outputs
expected
name
required
a list of rootpaths of expected outputs, as they would appear in a runfiles manifest
kwargs
string_list
additional named arguments for the resulting diff_test

Function: assert_archive_contains

Assert that an archive file contains at least the given file entries.

Parameters

name
name
required
name of the resulting sh_test target
archive
name
required
Label of the the .tar or .zip file
expected
name
required
a (partial) file listing, either as a Label of a file containing it, or a list of strings
type
name
default:"None"
“tar” or “zip”. If None, a type will be inferred from the filename.
kwargs
string_list
additional named arguments for the resulting sh_test

Function: assert_directory_contains

Assert that a directory contains at least the given file entries.

Parameters

name
name
required
name of the resulting sh_test target
directory
name
required
Label of the directory artifact
expected
name
required
a (partial) file listing, either as a Label of a file containing it, or a list of strings
kwargs
string_list
additional named arguments for the resulting sh_test