e2e framework: validate test definitions

This checks that the With* label functions are used instead of the previous
inline tags. To catch strings passed to Ginkgo directly instead of the
framework wrapper functions, the final test specs are checked.
This commit is contained in:
Patrick Ohly
2023-07-05 15:44:11 +02:00
parent f2cfbf44b1
commit 338fe7ad55
2 changed files with 79 additions and 0 deletions

View File

@@ -517,6 +517,7 @@ func AfterReadingAllFlags(t *TestContextType) {
// ginkgo.PreviewSpecs will expand all nodes and thus may find new bugs.
report := ginkgo.PreviewSpecs("Kubernetes e2e test statistics")
validateSpecs(report.SpecReports)
if err := FormatBugs(); CheckForBugs && err != nil {
// Refuse to do anything if the E2E suite is buggy.
fmt.Fprint(Output, "ERROR: E2E suite initialization was faulty, these errors must be fixed:")