rules_itestAPI docs @0.0.49

@rules_itest//:itest.bzl

Rules for running services in integration tests.

Functions & Macros

itest_service
Parameters
*name
tags
Default: []
hygienic
Default: True
kwargs
itest_service_group
Parameters
*name
tags
Default: []
hygienic
Default: True
kwargs
itest_task
Parameters
*name
tags
Default: []
hygienic
Default: True
kwargs

Rules

service_test

Brings 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.

AttributeTypeDescription
*namename

A unique name for this target.

testlabel

The underlying test target to execute once the services have been brought up and healthchecked.

Default: None
envdictionary: String → String

The service manager will merge these variables into the environment when spawning the underlying binary.

Default: {}
datalist of labels
Default: []
deferredboolean

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_aliasesdictionary: String → String

Port aliases allow you to 're-export' another service's port as belonging to this service group.
This can be used to create abstractions (such as an itest_service combined with an itest_task) but not leak
their implementation through how client code accesses port names.

Default: {}
serviceslist of labels

Services/tasks that comprise this group. Can be itest_service, itest_task, or itest_service_group.

Default: []