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:
parent
32b6746cd9
commit
6c5f683802
|
@ -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
|
||||
}
|
||||
|
|
|
@ -204,55 +204,61 @@ func GetResults(
|
|||
}
|
||||
|
||||
results := result.List{}
|
||||
err := rdb.QueryTestResults(ctx, builds.ids(), cfg.Test.Prefix+".*", func(rpb *rdbpb.TestResult) error {
|
||||
if time.Since(lastPrintedDot) > 5*time.Second {
|
||||
lastPrintedDot = time.Now()
|
||||
fmt.Printf(".")
|
||||
}
|
||||
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(), prefix) {
|
||||
return nil
|
||||
}
|
||||
|
||||
testName := rpb.GetTestId()[len(prefix):]
|
||||
status := toStatus(rpb.Status)
|
||||
tags := result.NewTags()
|
||||
|
||||
duration := rpb.GetDuration().AsDuration()
|
||||
mayExonerate := false
|
||||
|
||||
for _, sp := range rpb.Tags {
|
||||
if sp.Key == "typ_tag" {
|
||||
tags.Add(sp.Value)
|
||||
}
|
||||
if sp.Key == "javascript_duration" {
|
||||
var err error
|
||||
if duration, err = time.ParseDuration(sp.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if sp.Key == "may_exonerate" {
|
||||
var err error
|
||||
if mayExonerate, err = strconv.ParseBool(sp.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if status == result.Pass && duration > cfg.Test.SlowThreshold {
|
||||
status = result.Slow
|
||||
}
|
||||
|
||||
results = append(results, result.Result{
|
||||
Query: query.Parse(testName),
|
||||
Status: status,
|
||||
Tags: tags,
|
||||
Duration: duration,
|
||||
MayExonerate: mayExonerate,
|
||||
})
|
||||
|
||||
if !strings.HasPrefix(rpb.GetTestId(), cfg.Test.Prefix) {
|
||||
return nil
|
||||
}
|
||||
|
||||
testName := rpb.GetTestId()[len(cfg.Test.Prefix):]
|
||||
status := toStatus(rpb.Status)
|
||||
tags := result.NewTags()
|
||||
|
||||
duration := rpb.GetDuration().AsDuration()
|
||||
mayExonerate := false
|
||||
|
||||
for _, sp := range rpb.Tags {
|
||||
if sp.Key == "typ_tag" {
|
||||
tags.Add(sp.Value)
|
||||
}
|
||||
if sp.Key == "javascript_duration" {
|
||||
var err error
|
||||
if duration, err = time.ParseDuration(sp.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if sp.Key == "may_exonerate" {
|
||||
var err error
|
||||
if mayExonerate, err = strconv.ParseBool(sp.Value); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if status == result.Pass && duration > cfg.Test.SlowThreshold {
|
||||
status = result.Slow
|
||||
}
|
||||
|
||||
results = append(results, result.Result{
|
||||
Query: query.Parse(testName),
|
||||
Status: status,
|
||||
Tags: tags,
|
||||
Duration: duration,
|
||||
MayExonerate: mayExonerate,
|
||||
})
|
||||
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println(" done")
|
||||
|
||||
|
|
|
@ -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": {
|
||||
|
|
Loading…
Reference in New Issue