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 struct {
// The ResultDB string prefix for CTS tests.
Prefix string
Prefixes []string
// The time threshold used to classify tests as slow.
SlowThreshold time.Duration
}

View File

@ -204,17 +204,19 @@ func GetResults(
}
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 {
lastPrintedDot = time.Now()
fmt.Printf(".")
}
if !strings.HasPrefix(rpb.GetTestId(), cfg.Test.Prefix) {
if !strings.HasPrefix(rpb.GetTestId(), prefix) {
return nil
}
testName := rpb.GetTestId()[len(cfg.Test.Prefix):]
testName := rpb.GetTestId()[len(prefix):]
status := toStatus(rpb.Status)
tags := result.NewTags()
@ -253,6 +255,10 @@ func GetResults(
return nil
})
if err != nil {
break
}
}
fmt.Println(" done")

View File

@ -1,6 +1,9 @@
{
"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
},
"Gerrit": {