Skip to content

Commit

Permalink
[tools][cts] Remove old CTS roller codepath
Browse files Browse the repository at this point in the history
Removes the old CTS roller codepath and all related code that is now
unused. There may be a bit of dead code remaining, but this should
remove the vast majority of it.

Bug: 372730248
Change-Id: I1f87e8139b9104f90680ef7f043e4819bf037f12
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/219374
Commit-Queue: Brian Sheedy <[email protected]>
Commit-Queue: Antonio Maiorano <[email protected]>
Reviewed-by: Antonio Maiorano <[email protected]>
Auto-Submit: Brian Sheedy <[email protected]>
  • Loading branch information
bsheedy-work authored and Dawn LUCI CQ committed Dec 16, 2024
1 parent c07449b commit a1dc897
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 3,144 deletions.
34 changes: 10 additions & 24 deletions tools/src/cmd/cts/roll/roll.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ func (c *cmd) RegisterFlags(ctx context.Context, cfg common.Config) ([]string, e
flag.BoolVar(&c.flags.preserve, "preserve", false, "do not abandon existing rolls")
flag.BoolVar(&c.flags.sendToGardener, "send-to-gardener", false, "send the CL to the WebGPU gardener for review")
flag.BoolVar(&c.flags.verbose, "verbose", false, "emit additional logging")
// Deprecated.
// TODO(crbug.com/372730248): Remove this flag once the roller stops passing it in.
flag.BoolVar(&c.flags.useSimplifiedCodepath, "use-simplified-codepath", false, "use the simplified codepath that only looks at unexpected failures")
flag.StringVar(&c.flags.parentSwarmingRunID, "parent-swarming-run-id", "", "parent swarming run id. All triggered tasks will be children of this task and will be canceled if the parent is canceled.")
flag.IntVar(&c.flags.maxAttempts, "max-attempts", 3, "number of update attempts before giving up")
Expand Down Expand Up @@ -414,11 +416,7 @@ func (r *roller) roll(ctx context.Context) error {

// Gather the build results
log.Println("gathering results...")
if r.flags.useSimplifiedCodepath {
psResultsByExecutionMode, err = common.CacheUnsuppressedFailingResults(ctx, r.cfg, ps, r.flags.cacheDir, r.client, builds)
} else {
psResultsByExecutionMode, err = common.CacheResults(ctx, r.cfg, ps, r.flags.cacheDir, r.client, builds)
}
psResultsByExecutionMode, err = common.CacheUnsuppressedFailingResults(ctx, r.cfg, ps, r.flags.cacheDir, r.client, builds)
if err != nil {
return err
}
Expand All @@ -431,26 +429,14 @@ func (r *roller) roll(ctx context.Context) error {
// Rebuild the expectations with the accumulated results
log.Println("building new expectations...")
for _, exInfo := range exInfos {
if r.flags.useSimplifiedCodepath {
// TODO(crbug.com/372730248): Modify exInfo.expectations in place once
// the old code path is removed.
exInfo.newExpectations = exInfo.expectations.Clone()
err := exInfo.newExpectations.AddExpectationsForFailingResults(psResultsByExecutionMode[exInfo.executionMode], testlist, r.flags.verbose)
if err != nil {
return err
}
exInfo.expectations = exInfo.newExpectations
} else {
// Merge the new results into the accumulated results
log.Printf("merging results for %s ...\n", exInfo.executionMode)
exInfo.results = result.Merge(exInfo.results, psResultsByExecutionMode[exInfo.executionMode])

exInfo.newExpectations = exInfo.expectations.Clone()
_, err := exInfo.newExpectations.Update(exInfo.results, testlist, r.flags.verbose)
if err != nil {
return err
}
// TODO(crbug.com/372730248): Modify exInfo.expectations in place once
// the old code path is removed.
exInfo.newExpectations = exInfo.expectations.Clone()
err := exInfo.newExpectations.AddExpectationsForFailingResults(psResultsByExecutionMode[exInfo.executionMode], testlist, r.flags.verbose)
if err != nil {
return err
}
exInfo.expectations = exInfo.newExpectations
}

// Otherwise, push the updated expectations, and try again
Expand Down
20 changes: 6 additions & 14 deletions tools/src/cmd/cts/update/expectations/expectations.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ func (c *cmd) RegisterFlags(ctx context.Context, cfg common.Config) ([]string, e
c.flags.results.RegisterFlags(cfg)
c.flags.auth.Register(flag.CommandLine, auth.DefaultAuthOptions())
flag.BoolVar(&c.flags.verbose, "verbose", false, "emit additional logging")
// Deprecated.
// TODO(crbug.com/372730248): Remove this flag once the roller stops passing it in.
flag.BoolVar(&c.flags.useSimplifiedCodepath, "use-simplified-codepath", false, "use the simplified codepath that only looks at unexpected failures")
flag.Var(&c.flags.expectations, "expectations", "path to CTS expectations file(s) to update")
return nil, nil
Expand Down Expand Up @@ -111,12 +113,7 @@ func (c *cmd) Run(ctx context.Context, cfg common.Config) error {

// Fetch the results
log.Println("fetching results...")
var resultsByExecutionMode result.ResultsByExecutionMode
if c.flags.useSimplifiedCodepath {
resultsByExecutionMode, err = c.flags.results.GetUnsuppressedFailingResults(ctx, cfg, auth)
} else {
resultsByExecutionMode, err = c.flags.results.GetResults(ctx, cfg, auth)
}
resultsByExecutionMode, err := c.flags.results.GetUnsuppressedFailingResults(ctx, cfg, auth)
if err != nil {
return err
}
Expand Down Expand Up @@ -154,14 +151,9 @@ func (c *cmd) Run(ctx context.Context, cfg common.Config) error {
name = "compat"
}

var diag expectations.Diagnostics
if c.flags.useSimplifiedCodepath {
err = ex.AddExpectationsForFailingResults(resultsByExecutionMode[name], testlist, c.flags.verbose)
// TODO(crbug.com/372730248): Report actual diagnostics.
diag = expectations.Diagnostics{}
} else {
diag, err = ex.Update(resultsByExecutionMode[name], testlist, c.flags.verbose)
}
err = ex.AddExpectationsForFailingResults(resultsByExecutionMode[name], testlist, c.flags.verbose)
// TODO(crbug.com/372730248): Report actual diagnostics.
diag := expectations.Diagnostics{}
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit a1dc897

Please sign in to comment.