@rules_itest//:itest.bzl
Rules for running services in integration tests.
Functions & Macros
itest_serviceParameters
*name | |
tags | Default: [] |
hygienic | Default: True |
kwargs |
itest_service_groupParameters
*name | |
tags | Default: [] |
hygienic | Default: True |
kwargs |
itest_taskParameters
*name | |
tags | Default: [] |
hygienic | Default: True |
kwargs |
Rules
service_testBrings up a set of services/tasks and runs a test target against them.
This can be used to customize which services a particular test needs while being able to bring them up in an easy and consistent way.
Example usage:
go_test(
name = "_example_test_no_services",
srcs = [..],
tags = ["manual"],
)
service_test(
name = "example_test",
test = ":_example_test_no_services",
services = [
"//services/mysql",
...
],
)
Typically this would be wrapped into a macro.
All common binary attributes are supported including args.
| Attribute | Type | Description |
|---|---|---|
*name | name | A unique name for this target. |
test | label | The underlying test target to execute once the services have been brought up and healthchecked. Default: None |
env | dictionary: String → String | The service manager will merge these variables into the environment when spawning the underlying binary. Default: {} |
data | list of labels | Default: [] |
deferred | boolean | If set, the group will not be started on boot up. It can be started using the service manager's control API. Default: False |
port_aliases | dictionary: String → String | Port aliases allow you to 're-export' another service's port as belonging to this service group. Default: {} |
services | list of labels | Services/tasks that comprise this group. Can be Default: [] |