CTS expectations: support multiple test prefixes

For some reason Android uses a different test prefix

Bug: chromium:1363409
Change-Id: I6f43b2f35e440f26842779fff58e2e9e3d36bd87
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/134346
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Austin Eng <enga@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng 2023-05-25 16:04:51 +00:00 committed by Dawn LUCI CQ
parent 32b6746cd9
commit 6c5f683802
3 changed files with 57 additions and 48 deletions

View File

@ -32,7 +32,7 @@ type Config struct {
// Test holds configuration data for test results. // Test holds configuration data for test results.
Test struct { Test struct {
// The ResultDB string prefix for CTS tests. // The ResultDB string prefix for CTS tests.
Prefix string Prefixes []string
// The time threshold used to classify tests as slow. // The time threshold used to classify tests as slow.
SlowThreshold time.Duration SlowThreshold time.Duration
} }

View File

@ -204,17 +204,19 @@ func GetResults(
} }
results := result.List{} results := result.List{}
err := rdb.QueryTestResults(ctx, builds.ids(), cfg.Test.Prefix+".*", func(rpb *rdbpb.TestResult) error { var err error = nil
for _, prefix := range cfg.Test.Prefixes {
err = rdb.QueryTestResults(ctx, builds.ids(), prefix+".*", func(rpb *rdbpb.TestResult) error {
if time.Since(lastPrintedDot) > 5*time.Second { if time.Since(lastPrintedDot) > 5*time.Second {
lastPrintedDot = time.Now() lastPrintedDot = time.Now()
fmt.Printf(".") fmt.Printf(".")
} }
if !strings.HasPrefix(rpb.GetTestId(), cfg.Test.Prefix) { if !strings.HasPrefix(rpb.GetTestId(), prefix) {
return nil return nil
} }
testName := rpb.GetTestId()[len(cfg.Test.Prefix):] testName := rpb.GetTestId()[len(prefix):]
status := toStatus(rpb.Status) status := toStatus(rpb.Status)
tags := result.NewTags() tags := result.NewTags()
@ -253,6 +255,10 @@ func GetResults(
return nil return nil
}) })
if err != nil {
break
}
}
fmt.Println(" done") fmt.Println(" done")

View File

@ -1,6 +1,9 @@
{ {
"Test": { "Test": {
"Prefix": "ninja://chrome/test:telemetry_gpu_integration_test/gpu_tests.webgpu_cts_integration_test.WebGpuCtsIntegrationTest.", "Prefixes": [
"ninja://chrome/test:telemetry_gpu_integration_test/gpu_tests.webgpu_cts_integration_test.WebGpuCtsIntegrationTest.",
"ninja://chrome/test:telemetry_gpu_integration_test_android_chrome/gpu_tests.webgpu_cts_integration_test.WebGpuCtsIntegrationTest."
],
"SlowThreshold": 45000000000 // 45 seconds "SlowThreshold": 45000000000 // 45 seconds
}, },
"Gerrit": { "Gerrit": {