Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9dd0bd7

Browse files
erock2112Skia Commit-Bot
authored andcommitted
[recipes] Compute DM flags in gen_tasks
Change-Id: I3d82d78161373ec0536cbe6df196c753547501a8 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274200 Commit-Queue: Eric Boren <borenet@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
1 parent cd45dd2 commit 9dd0bd7

File tree

64 files changed

+349
-37419
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+349
-37419
lines changed

infra/bots/gen_tasks_logic/gen_tasks_logic.go

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"fmt"
1414
"io/ioutil"
1515
"os"
16+
"os/exec"
1617
"path"
1718
"path/filepath"
1819
"regexp"
@@ -1420,8 +1421,34 @@ func (b *builder) test(name string, parts map[string]string, compileTaskName str
14201421
extraProps[k] = v
14211422
}
14221423
iid := b.internalHardwareLabel(parts)
1424+
iidStr := ""
14231425
if iid != nil {
1424-
extraProps["internal_hardware_label"] = strconv.Itoa(*iid)
1426+
iidStr = strconv.Itoa(*iid)
1427+
}
1428+
if recipe == "test" {
1429+
partsJson, err := json.Marshal(parts)
1430+
if err != nil {
1431+
glog.Fatal(err)
1432+
}
1433+
dmFlagsScript := filepath.Join(CheckoutRoot(), "infra", "bots", "recipe_modules", "vars", "resources", "dm_flags.py")
1434+
out, err := exec.Command(
1435+
"python", dmFlagsScript,
1436+
"--bot", name,
1437+
"--parts", string(partsJson),
1438+
"--task_id", specs.PLACEHOLDER_TASK_ID,
1439+
"--revision", specs.PLACEHOLDER_REVISION,
1440+
"--issue", specs.PLACEHOLDER_ISSUE,
1441+
"--patchset", specs.PLACEHOLDER_PATCHSET,
1442+
"--patch_storage", specs.PLACEHOLDER_PATCH_STORAGE,
1443+
"--buildbucket_build_id", specs.PLACEHOLDER_BUILDBUCKET_BUILD_ID,
1444+
"--swarming_bot_id", "${SWARMING_BOT_ID}",
1445+
"--swarming_task_id", "${SWARMING_TASK_ID}",
1446+
"--internal_hardware_label", iidStr,
1447+
).CombinedOutput()
1448+
if err != nil {
1449+
glog.Fatal(err)
1450+
}
1451+
extraProps["dm_flags"] = strings.TrimSpace(string(out))
14251452
}
14261453
task := b.kitchenTask(name, recipe, isolate, "", b.swarmDimensions(parts), extraProps, OUTPUT_TEST)
14271454
task.CipdPackages = append(task.CipdPackages, pkgs...)

infra/bots/recipe_modules/vars/resources/dm_flags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,4 +859,4 @@ def remove_from_args(arg):
859859
swarming_task_id=args.swarming_task_id,
860860
internal_hardware_label=args.internal_hardware_label,
861861
)
862-
print json.dumps(f)
862+
print json.dumps(f, separators=(',', ':'))

0 commit comments

Comments
 (0)