[canvaskit] Fix gm test runner on non-tryjobs

Bug: skia:10812
Change-Id: I5e859fe96bb0f0f78f5da658a2fa4f77324bb439
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/328896
Reviewed-by: Eric Boren <borenet@google.com>
This commit is contained in:
Kevin Lubick 2020-10-21 06:58:01 -04:00
parent b432d0b757
commit ffad5d3b2d

View File

@ -38,9 +38,11 @@ func main() {
workPath = flag.String("work_path", "", "The directory to use to store temporary files (e.g. pngs and JSON)")
// Provided for tryjobs
changelistID = flag.String("changelist_id", "", "The id the Gerrit CL. Omit for primary branch.")
tryjobID = flag.String("tryjob_id", "", "The id of the Buildbucket job for tryjobs. Omit for primary branch.")
patchsetOrder = flag.Int("patchset_order", 0, "Represents if this is the nth patchset")
changelistID = flag.String("changelist_id", "", "The id the Gerrit CL. Omit for primary branch.")
tryjobID = flag.String("tryjob_id", "", "The id of the Buildbucket job for tryjobs. Omit for primary branch.")
// Because we pass in patchset_order via a placeholder, it can be empty string. As such, we
// cannot use flag.Int, because that errors on "" being passed in.
patchsetOrder = flag.String("patchset_order", "0", "Represents if this is the nth patchset")
// Debugging flags.
local = flag.Bool("local", false, "True if running locally (as opposed to on the bots)")
@ -67,6 +69,15 @@ func main() {
td.Fatal(ctx, err)
}
patchset := 0
if *patchsetOrder != "" {
p, err := strconv.Atoi(*patchsetOrder)
if err != nil {
td.Fatalf(ctx, "Invalid patchset_order %q", *patchsetOrder)
}
patchset = p
}
keys := *goldKeys
switch *webGLVersion {
case 0:
@ -81,7 +92,7 @@ func main() {
// initialize goldctl
if err := setupGoldctl(ctx, *local, *gitCommit, *changelistID, *tryjobID, goldctlAbsPath, goldctlWorkPath,
*serviceAccountPath, keys, *patchsetOrder); err != nil {
*serviceAccountPath, keys, patchset); err != nil {
td.Fatal(ctx, err)
}