2022-04-28 00:22:30 +00:00
|
|
|
"""Integration testing that aspect_bazel_lib works when used via bzlmod.
|
|
|
|
|
|
|
|
NB: We don't use yq, so we can confirm that Bazel never fetches it.
|
|
|
|
You can manually verify this after testing this repo with
|
|
|
|
`ls $(bazel info output_base)/external | grep yq`
|
|
|
|
You'll see a aspect_bazel_lib.ext.yq_toolchains repo, but no downloaded yq binary.
|
|
|
|
"""
|
|
|
|
|
2022-04-27 04:07:17 +00:00
|
|
|
load("@aspect_bazel_lib//lib:jq.bzl", "jq")
|
2022-04-28 00:22:30 +00:00
|
|
|
load("@aspect_bazel_lib//lib:docs.bzl", "stardoc_with_diff_test")
|
2022-04-29 07:36:41 +00:00
|
|
|
load("@aspect_bazel_lib//lib:diff_test.bzl", "diff_test")
|
2022-04-28 00:22:30 +00:00
|
|
|
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
|
2022-04-27 04:07:17 +00:00
|
|
|
|
2022-04-28 00:22:30 +00:00
|
|
|
bzl_library(
|
|
|
|
name = "defs",
|
|
|
|
srcs = ["defs.bzl"],
|
|
|
|
)
|
|
|
|
|
|
|
|
# Validate that stardoc dependency works.
|
|
|
|
# Note, stardoc is generally broken under bzlmod, see
|
|
|
|
# https://github.com/bazelbuild/stardoc/issues/117
|
|
|
|
# This happens to work because we don't reference any external repos
|
|
|
|
# from defs.bzl.
|
|
|
|
stardoc_with_diff_test(
|
|
|
|
name = "docs",
|
|
|
|
bzl_library_target = "//:defs",
|
|
|
|
)
|
|
|
|
|
|
|
|
# Validate that JQ works and resolves its toolchain
|
2022-04-27 04:07:17 +00:00
|
|
|
jq(
|
|
|
|
name = "case_no_sources",
|
|
|
|
srcs = [],
|
|
|
|
filter = ".",
|
|
|
|
)
|
|
|
|
|
|
|
|
diff_test(
|
|
|
|
name = "test",
|
|
|
|
file1 = "case_no_sources",
|
|
|
|
file2 = "expected",
|
|
|
|
)
|