
The existing walk.go and conformance.txt have a few shortcomings which we'd like to resolve: - difficult to get the full test name due to test context nesting - complicated AST logic and understanding necessary due to the different ways a test can be invoked and written This changes the AST parsing logic to be much more simple and simply looks for the comments at/around a specific line. This file/line information (and the full test name) is gathered by a custom ginkgo reporter which dumps the SpecSummary data to a file. Also, the SpecSummary dump can, itself, be potentially useful for other post-processing and debugging tasks. Signed-off-by: John Schnake <jschnake@vmware.com>
94 lines
2.3 KiB
Python
94 lines
2.3 KiB
Python
load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
|
|
|
|
go_library(
|
|
name = "go_default_library",
|
|
srcs = [
|
|
"doc.go",
|
|
"walk.go",
|
|
],
|
|
importpath = "k8s.io/kubernetes/test/conformance",
|
|
visibility = ["//visibility:private"],
|
|
deps = [
|
|
"//vendor/github.com/onsi/ginkgo/types:go_default_library",
|
|
"//vendor/gopkg.in/yaml.v2:go_default_library",
|
|
],
|
|
)
|
|
|
|
go_binary(
|
|
name = "conformance",
|
|
embed = [":go_default_library"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "package-srcs",
|
|
srcs = glob(["**"]),
|
|
tags = ["automanaged"],
|
|
visibility = ["//visibility:private"],
|
|
)
|
|
|
|
filegroup(
|
|
name = "all-srcs",
|
|
srcs = [
|
|
":package-srcs",
|
|
"//test/conformance/behaviors:all-srcs",
|
|
"//test/conformance/kubetestgen:all-srcs",
|
|
],
|
|
tags = ["automanaged"],
|
|
visibility = ["//visibility:public"],
|
|
)
|
|
|
|
genrule(
|
|
name = "list_conformance_specs",
|
|
srcs = [
|
|
"//test/e2e:all-srcs",
|
|
"//test/e2e_node:all-srcs",
|
|
"//test/e2e:e2e.test_binary",
|
|
"//vendor/github.com/onsi/ginkgo/ginkgo",
|
|
],
|
|
outs = ["specsummaries.json"],
|
|
cmd = "$(location //vendor/github.com/onsi/ginkgo/ginkgo) --dryRun=true --focus=[Conformance] $(location //test/e2e:e2e.test_binary) -- --spec-dump $$(pwd)/$@ > /dev/null",
|
|
message = "Getting all conformance spec summaries.",
|
|
)
|
|
|
|
genrule(
|
|
name = "list_conformance_tests",
|
|
srcs = [
|
|
":list_conformance_specs",
|
|
":conformance",
|
|
"//test/e2e:all-srcs",
|
|
],
|
|
outs = ["conformance.yaml"],
|
|
cmd = "$(location :conformance) $(location :list_conformance_specs) > $@",
|
|
message = "Listing all conformance tests.",
|
|
)
|
|
|
|
sh_test(
|
|
name = "conformance_test",
|
|
srcs = ["conformance_test.sh"],
|
|
data = [
|
|
"testdata/conformance.yaml",
|
|
":list_conformance_tests",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "go_default_test",
|
|
srcs = ["walk_test.go"],
|
|
data = glob(["testdata/**"]),
|
|
embed = [":go_default_library"],
|
|
)
|
|
|
|
genrule(
|
|
name = "gen_conformance_docs",
|
|
srcs = [
|
|
":list_conformance_specs",
|
|
":conformance",
|
|
"//test/e2e:all-srcs",
|
|
":package-srcs",
|
|
],
|
|
outs = ["conformance.md"],
|
|
cmd = "$(location :conformance) --docs $(location :list_conformance_specs) > $@",
|
|
message = "Listing all conformance tests.",
|
|
)
|