load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") load("//test/snapshot:snapshot.bzl", "generate_snapshots") go_test( name = "examples_test", srcs = ["examples_test.go"], data = glob(["testdata/**"]), embed = [":examples"], deps = [ "//test/snapshot", "@com_github_stretchr_testify//assert", ], ) go_library( name = "examples", srcs = ["examples.go"], importpath = "edge-infra.dev/test/snapshot/examples", visibility = ["//visibility:public"], ) generate_snapshots( name = "example_snapshots", testonly = True, srcs = glob(["testdata/**"]), snapshot_path = "test/snapshot/examples/testdata/snapshots", snapshot_test = ":examples_test", ) write_source_files( name = "update_snapshots_example", testonly = True, files = { "testdata/snapshots": ":example_snapshots", }, )