Skip to content

Commit ffad5d3

Browse files
committed
[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>
1 parent b432d0b commit ffad5d3

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

infra/bots/task_drivers/run_wasm_gm_tests/run_wasm_gm_tests.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ func main() {
3838
workPath = flag.String("work_path", "", "The directory to use to store temporary files (e.g. pngs and JSON)")
3939

4040
// Provided for tryjobs
41-
changelistID = flag.String("changelist_id", "", "The id the Gerrit CL. Omit for primary branch.")
42-
tryjobID = flag.String("tryjob_id", "", "The id of the Buildbucket job for tryjobs. Omit for primary branch.")
43-
patchsetOrder = flag.Int("patchset_order", 0, "Represents if this is the nth patchset")
41+
changelistID = flag.String("changelist_id", "", "The id the Gerrit CL. Omit for primary branch.")
42+
tryjobID = flag.String("tryjob_id", "", "The id of the Buildbucket job for tryjobs. Omit for primary branch.")
43+
// Because we pass in patchset_order via a placeholder, it can be empty string. As such, we
44+
// cannot use flag.Int, because that errors on "" being passed in.
45+
patchsetOrder = flag.String("patchset_order", "0", "Represents if this is the nth patchset")
4446

4547
// Debugging flags.
4648
local = flag.Bool("local", false, "True if running locally (as opposed to on the bots)")
@@ -67,6 +69,15 @@ func main() {
6769
td.Fatal(ctx, err)
6870
}
6971

72+
patchset := 0
73+
if *patchsetOrder != "" {
74+
p, err := strconv.Atoi(*patchsetOrder)
75+
if err != nil {
76+
td.Fatalf(ctx, "Invalid patchset_order %q", *patchsetOrder)
77+
}
78+
patchset = p
79+
}
80+
7081
keys := *goldKeys
7182
switch *webGLVersion {
7283
case 0:
@@ -81,7 +92,7 @@ func main() {
8192

8293
// initialize goldctl
8394
if err := setupGoldctl(ctx, *local, *gitCommit, *changelistID, *tryjobID, goldctlAbsPath, goldctlWorkPath,
84-
*serviceAccountPath, keys, *patchsetOrder); err != nil {
95+
*serviceAccountPath, keys, patchset); err != nil {
8596
td.Fatal(ctx, err)
8697
}
8798

0 commit comments

Comments
 (0)