build_test_doc.md

January 24, 2025 ยท View on GitHub

A test verifying other targets build as part of a bazel test

build_test

load("@bazel_skylib//rules:build_test.bzl", "build_test")

build_test(name, targets, **kwargs)

Test rule checking that other targets build.

This works not by an instance of this test failing, but instead by the targets it depends on failing to build, and hence failing the attempt to run this test.

Typical usage:

  load("@bazel_skylib//rules:build_test.bzl", "build_test")
  build_test(
      name = "my_build_test",
      targets = [
          "//some/package:rule",
      ],
  )

PARAMETERS

NameDescriptionDefault Value
nameThe name of the test rule.none
targetsA list of targets to ensure build.none
kwargsThe common attributes for tests.none