...
1load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
2load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
3load("//test/snapshot:snapshot.bzl", "generate_snapshots")
4
5go_test(
6 name = "examples_test",
7 srcs = ["examples_test.go"],
8 data = glob(["testdata/**"]),
9 embed = [":examples"],
10 deps = [
11 "//test/snapshot",
12 "@com_github_stretchr_testify//assert",
13 ],
14)
15
16go_library(
17 name = "examples",
18 srcs = ["examples.go"],
19 importpath = "edge-infra.dev/test/snapshot/examples",
20 visibility = ["//visibility:public"],
21)
22
23generate_snapshots(
24 name = "example_snapshots",
25 testonly = True,
26 srcs = glob(["testdata/**"]),
27 snapshot_path = "test/snapshot/examples/testdata/snapshots",
28 snapshot_test = ":examples_test",
29)
30
31write_source_files(
32 name = "update_snapshots_example",
33 testonly = True,
34 files = {
35 "testdata/snapshots": ":example_snapshots",
36 },
37)
View as plain text