diff --git a/tools/src/cts/expectations/validate.go b/tools/src/cts/expectations/validate.go index 6ff805d6b4..8571d553d4 100644 --- a/tools/src/cts/expectations/validate.go +++ b/tools/src/cts/expectations/validate.go @@ -51,6 +51,15 @@ func (c Content) Validate() Diagnostics { var out Diagnostics for _, chunk := range c.Chunks { for _, ex := range chunk.Expectations { + for _, status := range ex.Status { + if status == "Slow" { + out = append(out, Diagnostic{ + Severity: Error, + Line: ex.Line, + Message: fmt.Sprintf("\"Slow\" expectation is not valid here. Use slow_tests.txt instead."), + }) + } + } glob, err := tree.Glob(query.Parse(ex.Query)) if err != nil { out = append(out, Diagnostic{ diff --git a/tools/src/cts/expectations/validate_test.go b/tools/src/cts/expectations/validate_test.go index d9b15b9ff0..55234e1031 100644 --- a/tools/src/cts/expectations/validate_test.go +++ b/tools/src/cts/expectations/validate_test.go @@ -116,6 +116,19 @@ crbug.com/a/123 [ os-a ] a:b,c:d,* [ Failure ] }, }, }, + { ////////////////////////////////////////////////////////////////////// + name: "slow invalid", + expectations: ` +crbug.com/a/123 a:b,c:d,* [ Slow ] +`, + diagnostics: expectations.Diagnostics{ + { + Line: 8, + Severity: expectations.Error, + Message: "\"Slow\" expectation is not valid here. Use slow_tests.txt instead.", + }, + }, + }, } { ex, err := expectations.Parse("expectations.txt", header+test.expectations) if err != nil {