load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file") load("@io_bazel_rules_go//go:def.bzl", "go_test") genrule( name = "hey", outs = ["hey.txt"], cmd = """(echo "created by write_source_file rule") > $@""", visibility = ["//visibility:public"], ) write_source_file( name = "create", in_file = ":hey", out_file = "testdata/hey.txt", ) go_test( name = "writesourcefiledata_test", srcs = ["write_test.go"], data = glob(["testdata/**"]), embedsrcs = ["testdata/hey.txt"], tags = [ "f2-example", # dont use outside f2/examples, stops deps test from failing "integration", ], visibility = ["//visibility:public"], deps = [ "//test/f2", "@tools_gotest_v3//assert", ], )