diff options
author | 2017-04-18 15:49:27 -0400 | |
---|---|---|
committer | 2017-04-19 11:24:24 +0000 | |
commit | e16fb7584a15802949d1eb8b4ad60952619da7d4 (patch) | |
tree | 948e2e2d4c9caf2a2994249559f9ba1680d48a97 /infra/bots/recipe_modules/swarming | |
parent | c1e9617e82a2d573c890ee17e69a3d4699800f05 (diff) |
Recipes: Use strict coverage, part 1
Shouldn't change any behavior.
Bug: skia:
Change-Id: I953e0da886a6d61096eba7915101f245a6cec741
Reviewed-on: https://skia-review.googlesource.com/13765
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Diffstat (limited to 'infra/bots/recipe_modules/swarming')
-rw-r--r-- | infra/bots/recipe_modules/swarming/__init__.py | 4 | ||||
-rw-r--r-- | infra/bots/recipe_modules/swarming/example.expected/test.json | 863 | ||||
-rw-r--r-- | infra/bots/recipe_modules/swarming/example.py | 30 |
3 files changed, 893 insertions, 4 deletions
diff --git a/infra/bots/recipe_modules/swarming/__init__.py b/infra/bots/recipe_modules/swarming/__init__.py index cc099f61c0..3e05b02b1f 100644 --- a/infra/bots/recipe_modules/swarming/__init__.py +++ b/infra/bots/recipe_modules/swarming/__init__.py @@ -16,7 +16,3 @@ DEPS = [ 'recipe_engine/step', 'run', ] - - -# TODO(borenet): Add coverage -DISABLE_STRICT_COVERAGE = True diff --git a/infra/bots/recipe_modules/swarming/example.expected/test.json b/infra/bots/recipe_modules/swarming/example.expected/test.json new file mode 100644 index 0000000000..310d828435 --- /dev/null +++ b/infra/bots/recipe_modules/swarming/example.expected/test.json @@ -0,0 +1,863 @@ +[ + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[depot_tools::git]/resources/git_setup.py", + "--path", + "[START_DIR]/swarming.client", + "--url", + "https://chromium.googlesource.com/external/swarming.client.git" + ], + "name": "git setup (swarming_client)" + }, + { + "cmd": [ + "git", + "retry", + "fetch", + "origin", + "abc123" + ], + "cwd": "[START_DIR]/swarming.client", + "env": { + "PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s" + }, + "infra_step": true, + "name": "git fetch (swarming_client)" + }, + { + "cmd": [ + "git", + "checkout", + "-f", + "FETCH_HEAD" + ], + "cwd": "[START_DIR]/swarming.client", + "infra_step": true, + "name": "git checkout (swarming_client)" + }, + { + "cmd": [ + "git", + "rev-parse", + "HEAD" + ], + "cwd": "[START_DIR]/swarming.client", + "infra_step": true, + "name": "read revision", + "stdout": "/path/to/tmp/", + "~followup_annotations": [ + "@@@STEP_TEXT@<br/>checked out 'deadbeef'<br/>@@@" + ] + }, + { + "cmd": [ + "git", + "clean", + "-f", + "-d", + "-x" + ], + "cwd": "[START_DIR]/swarming.client", + "infra_step": true, + "name": "git clean (swarming_client)" + }, + { + "cmd": [ + "git", + "submodule", + "sync" + ], + "cwd": "[START_DIR]/swarming.client", + "infra_step": true, + "name": "submodule sync (swarming_client)" + }, + { + "cmd": [ + "git", + "submodule", + "update", + "--init", + "--recursive" + ], + "cwd": "[START_DIR]/swarming.client", + "infra_step": true, + "name": "submodule update (swarming_client)" + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "--version" + ], + "name": "swarming.py --version", + "stdout": "/path/to/tmp/", + "~followup_annotations": [ + "@@@STEP_TEXT@0.8.6@@@" + ] + }, + { + "cmd": [ + "download_from_google_storage", + "--no_resume", + "--platform=linux*", + "--no_auth", + "--bucket", + "chromium-luci", + "-d", + "lmydirimydirnmydirumydirxmydir6mydir4" + ], + "env": { + "PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s" + }, + "name": "download luci-go linux" + }, + { + "cmd": [ + "download_from_google_storage", + "--no_resume", + "--platform=darwin", + "--no_auth", + "--bucket", + "chromium-luci", + "-d", + "mmydiramydircmydir6mydir4" + ], + "env": { + "PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s" + }, + "name": "download luci-go mac" + }, + { + "cmd": [ + "download_from_google_storage", + "--no_resume", + "--platform=win32", + "--no_auth", + "--bucket", + "chromium-luci", + "-d", + "wmydirimydirnmydir6mydir4" + ], + "env": { + "PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s" + }, + "name": "download luci-go win" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[build::file]/resources/fileutil.py", + "rmtree", + "[START_DIR]/luci-go" + ], + "env": { + "PYTHONPATH": "[START_DIR]/skia/infra/bots/.recipe_deps/build/scripts" + }, + "infra_step": true, + "name": "rmtree luci-go" + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copytree(sys.argv[1], sys.argv[2], symlinks=bool(sys.argv[3]))\n", + "mydir", + "[START_DIR]/luci-go", + "0" + ], + "name": "Copy Go binary" + }, + { + "cmd": [ + "python", + "-u", + "\nimport sys, os\npath = sys.argv[1]\nmode = int(sys.argv[2])\nif not os.path.isdir(path):\n if os.path.exists(path):\n print \"%s exists but is not a dir\" % path\n sys.exit(1)\n os.makedirs(path, mode)\n", + "[START_DIR]/swarming_temp_dir", + "511" + ], + "name": "makedirs swarming tmp dir", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@import sys, os@@@", + "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@", + "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@", + "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@", + "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@", + "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", + "{\n \"args\": [\n \"--isolate\", \n \"isolate_path\", \n \"--isolated\", \n \"[START_DIR]/swarming_temp_dir/skia-task-task.isolated\", \n \"--config-variable\", \n \"OS\", \n \"linux\", \n \"--extra-variable\", \n \"myvar\", \n \"myval\"\n ], \n \"dir\": \"isolate_dir\", \n \"version\": 1\n}", + "[START_DIR]/swarming_temp_dir/task.isolated.gen.json" + ], + "name": "Write task.isolated.gen.json" + }, + { + "cmd": [ + "python", + "-u", + "RECIPE_MODULE[build::isolate]/resources/isolate.py", + "[START_DIR]/swarming.client", + "batcharchive", + "--dump-json", + "/path/to/tmp/json", + "--isolate-server", + "https://isolateserver.appspot.com", + "--verbose", + "[START_DIR]/swarming_temp_dir/task-0.isolated.gen.json", + "[START_DIR]/swarming_temp_dir/task-1.isolated.gen.json", + "[START_DIR]/swarming_temp_dir/task-2.isolated.gen.json", + "[START_DIR]/swarming_temp_dir/task-3.isolated.gen.json", + "[START_DIR]/swarming_temp_dir/task-4.isolated.gen.json" + ], + "name": "isolate tests", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@json.output@{@@@", + "@@@STEP_LOG_LINE@json.output@ \"task-0\": \"[dummy hash for task-0]\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"task-1\": \"[dummy hash for task-1]\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"task-2\": \"[dummy hash for task-2]\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"task-3\": \"[dummy hash for task-3]\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"task-4\": \"[dummy hash for task-4]\"@@@", + "@@@STEP_LOG_LINE@json.output@}@@@", + "@@@STEP_LOG_END@json.output@@@", + "@@@SET_BUILD_PROPERTY@swarm_hashes@{\"task-0\": \"[dummy hash for task-0]\", \"task-1\": \"[dummy hash for task-1]\", \"task-2\": \"[dummy hash for task-2]\", \"task-3\": \"[dummy hash for task-3]\", \"task-4\": \"[dummy hash for task-4]\"}@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "trigger", + "--swarming", + "https://chromium-swarm.appspot.com", + "--isolate-server", + "https://isolateserver.appspot.com", + "--priority", + "90", + "--shards", + "1", + "--task-name", + "task-4/Linux/[dummy has", + "--dump-json", + "/path/to/tmp/json", + "--expiration", + "72000", + "--io-timeout", + "2400", + "--hard-timeout", + "14400", + "--dimension", + "os", + "Linux", + "--tag", + "allow_milo:1", + "--tag", + "data:[dummy hash for task-4]", + "--tag", + "name:task-4", + "--tag", + "os:Linux", + "--tag", + "revision:abc123", + "--tag", + "stepname:task-4", + "[dummy hash for task-4]" + ], + "infra_step": true, + "name": "[trigger] task-4", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'@@@", + "@@@STEP_LOG_LINE@json.output@{@@@", + "@@@STEP_LOG_LINE@json.output@ \"base_task_name\": \"task-4/Linux/[dummy has\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"tasks\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"task-4/Linux/[dummy has\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"shard_index\": 0, @@@", + "@@@STEP_LOG_LINE@json.output@ \"task_id\": \"10000\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@}@@@", + "@@@STEP_LOG_END@json.output@@@", + "@@@STEP_LINK@shard #0@https://chromium-swarm.appspot.com/user/task/10000@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "trigger", + "--swarming", + "https://chromium-swarm.appspot.com", + "--isolate-server", + "https://isolateserver.appspot.com", + "--priority", + "90", + "--shards", + "1", + "--task-name", + "task-2/Linux/[dummy has", + "--dump-json", + "/path/to/tmp/json", + "--expiration", + "72000", + "--io-timeout", + "2400", + "--hard-timeout", + "14400", + "--dimension", + "os", + "Linux", + "--tag", + "allow_milo:1", + "--tag", + "data:[dummy hash for task-2]", + "--tag", + "name:task-2", + "--tag", + "os:Linux", + "--tag", + "revision:abc123", + "--tag", + "stepname:task-2", + "[dummy hash for task-2]" + ], + "infra_step": true, + "name": "[trigger] task-2", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'@@@", + "@@@STEP_LOG_LINE@json.output@{@@@", + "@@@STEP_LOG_LINE@json.output@ \"base_task_name\": \"task-2/Linux/[dummy has\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"tasks\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"task-2/Linux/[dummy has\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"shard_index\": 0, @@@", + "@@@STEP_LOG_LINE@json.output@ \"task_id\": \"10000\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@}@@@", + "@@@STEP_LOG_END@json.output@@@", + "@@@STEP_LINK@shard #0@https://chromium-swarm.appspot.com/user/task/10000@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "trigger", + "--swarming", + "https://chromium-swarm.appspot.com", + "--isolate-server", + "https://isolateserver.appspot.com", + "--priority", + "90", + "--shards", + "1", + "--task-name", + "task-3/Linux/[dummy has", + "--dump-json", + "/path/to/tmp/json", + "--expiration", + "72000", + "--io-timeout", + "2400", + "--hard-timeout", + "14400", + "--dimension", + "os", + "Linux", + "--tag", + "allow_milo:1", + "--tag", + "data:[dummy hash for task-3]", + "--tag", + "name:task-3", + "--tag", + "os:Linux", + "--tag", + "revision:abc123", + "--tag", + "stepname:task-3", + "[dummy hash for task-3]" + ], + "infra_step": true, + "name": "[trigger] task-3", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'@@@", + "@@@STEP_LOG_LINE@json.output@{@@@", + "@@@STEP_LOG_LINE@json.output@ \"base_task_name\": \"task-3/Linux/[dummy has\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"tasks\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"task-3/Linux/[dummy has\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"shard_index\": 0, @@@", + "@@@STEP_LOG_LINE@json.output@ \"task_id\": \"10000\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@}@@@", + "@@@STEP_LOG_END@json.output@@@", + "@@@STEP_LINK@shard #0@https://chromium-swarm.appspot.com/user/task/10000@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "trigger", + "--swarming", + "https://chromium-swarm.appspot.com", + "--isolate-server", + "https://isolateserver.appspot.com", + "--priority", + "90", + "--shards", + "1", + "--task-name", + "task-0/Linux/[dummy has", + "--dump-json", + "/path/to/tmp/json", + "--expiration", + "72000", + "--io-timeout", + "2400", + "--hard-timeout", + "14400", + "--dimension", + "os", + "Linux", + "--tag", + "allow_milo:1", + "--tag", + "data:[dummy hash for task-0]", + "--tag", + "name:task-0", + "--tag", + "os:Linux", + "--tag", + "revision:abc123", + "--tag", + "stepname:task-0", + "[dummy hash for task-0]" + ], + "infra_step": true, + "name": "[trigger] task-0", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'@@@", + "@@@STEP_LOG_LINE@json.output@{@@@", + "@@@STEP_LOG_LINE@json.output@ \"base_task_name\": \"task-0/Linux/[dummy has\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"tasks\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"task-0/Linux/[dummy has\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"shard_index\": 0, @@@", + "@@@STEP_LOG_LINE@json.output@ \"task_id\": \"10000\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@}@@@", + "@@@STEP_LOG_END@json.output@@@", + "@@@STEP_LINK@shard #0@https://chromium-swarm.appspot.com/user/task/10000@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "trigger", + "--swarming", + "https://chromium-swarm.appspot.com", + "--isolate-server", + "https://isolateserver.appspot.com", + "--priority", + "90", + "--shards", + "1", + "--task-name", + "task-1/Linux/[dummy has", + "--dump-json", + "/path/to/tmp/json", + "--expiration", + "72000", + "--io-timeout", + "2400", + "--hard-timeout", + "14400", + "--dimension", + "os", + "Linux", + "--tag", + "allow_milo:1", + "--tag", + "data:[dummy hash for task-1]", + "--tag", + "name:task-1", + "--tag", + "os:Linux", + "--tag", + "revision:abc123", + "--tag", + "stepname:task-1", + "[dummy hash for task-1]" + ], + "infra_step": true, + "name": "[trigger] task-1", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'@@@", + "@@@STEP_LOG_LINE@json.output@{@@@", + "@@@STEP_LOG_LINE@json.output@ \"base_task_name\": \"task-1/Linux/[dummy has\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"tasks\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"task-1/Linux/[dummy has\": {@@@", + "@@@STEP_LOG_LINE@json.output@ \"shard_index\": 0, @@@", + "@@@STEP_LOG_LINE@json.output@ \"task_id\": \"10000\", @@@", + "@@@STEP_LOG_LINE@json.output@ \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@ }@@@", + "@@@STEP_LOG_LINE@json.output@}@@@", + "@@@STEP_LOG_END@json.output@@@", + "@@@STEP_LINK@shard #0@https://chromium-swarm.appspot.com/user/task/10000@@@", + "@@@STEP_LINK@view steps on Milo@https://luci-milo.appspot.com/swarming/task/10000@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "collect", + "--swarming", + "https://chromium-swarm.appspot.com", + "--decorate", + "--print-status-updates", + "--json", + "{\"base_task_name\": \"task-4/Linux/[dummy has\", \"tasks\": {\"task-4/Linux/[dummy has\": {\"shard_index\": 0, \"task_id\": \"10000\", \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"}}}", + "--task-summary-json", + "/path/to/tmp/json", + "--task-output-dir", + "[START_DIR]/swarming_temp_dir/outputs/task-4" + ], + "name": "task-4", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'<br>swarming pending 71s@@@", + "@@@STEP_LOG_LINE@swarming.summary@{@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"shards\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"abandoned_ts\": null, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"bot_id\": \"vm30\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"completed_ts\": \"2014-09-25T01:42:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"created_ts\": \"2014-09-25T01:41:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"durations\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 5.7, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 31.5@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"exit_codes\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"id\": \"148aa78d7aa0000\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"internal_failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated_out\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated\": \"abc123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolatedserver\": \"https://isolateserver.appspot.com\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"namespace\": \"default-gzip\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"modified_ts\": \"2014-09-25 01:42:00\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"name\": \"heartbeat-canary-2014-09-25_01:41:55-os=Windows\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Heart beat succeeded on win32.\\n\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Foo\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs_ref\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"started_ts\": \"2014-09-25T01:42:11.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"state\": 112, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"try_number\": 1, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"user\": \"unknown\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ]@@@", + "@@@STEP_LOG_LINE@swarming.summary@}@@@", + "@@@STEP_LOG_END@swarming.summary@@@", + "@@@STEP_LINK@shard #0 isolated out@blah@@@", + "@@@STEP_LINK@view steps on Milo@https://luci-milo.appspot.com/swarming/task/148aa78d7aa0000@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "collect", + "--swarming", + "https://chromium-swarm.appspot.com", + "--decorate", + "--print-status-updates", + "--json", + "{\"base_task_name\": \"task-2/Linux/[dummy has\", \"tasks\": {\"task-2/Linux/[dummy has\": {\"shard_index\": 0, \"task_id\": \"10000\", \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"}}}", + "--task-summary-json", + "/path/to/tmp/json", + "--task-output-dir", + "[START_DIR]/swarming_temp_dir/outputs/task-2" + ], + "name": "task-2", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'<br>swarming pending 71s@@@", + "@@@STEP_LOG_LINE@swarming.summary@{@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"shards\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"abandoned_ts\": null, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"bot_id\": \"vm30\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"completed_ts\": \"2014-09-25T01:42:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"created_ts\": \"2014-09-25T01:41:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"durations\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 5.7, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 31.5@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"exit_codes\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"id\": \"148aa78d7aa0000\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"internal_failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated_out\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated\": \"abc123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolatedserver\": \"https://isolateserver.appspot.com\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"namespace\": \"default-gzip\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"modified_ts\": \"2014-09-25 01:42:00\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"name\": \"heartbeat-canary-2014-09-25_01:41:55-os=Windows\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Heart beat succeeded on win32.\\n\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Foo\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs_ref\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"started_ts\": \"2014-09-25T01:42:11.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"state\": 112, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"try_number\": 1, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"user\": \"unknown\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ]@@@", + "@@@STEP_LOG_LINE@swarming.summary@}@@@", + "@@@STEP_LOG_END@swarming.summary@@@", + "@@@STEP_LINK@shard #0 isolated out@blah@@@", + "@@@STEP_LINK@view steps on Milo@https://luci-milo.appspot.com/swarming/task/148aa78d7aa0000@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "collect", + "--swarming", + "https://chromium-swarm.appspot.com", + "--decorate", + "--print-status-updates", + "--json", + "{\"base_task_name\": \"task-3/Linux/[dummy has\", \"tasks\": {\"task-3/Linux/[dummy has\": {\"shard_index\": 0, \"task_id\": \"10000\", \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"}}}", + "--task-summary-json", + "/path/to/tmp/json", + "--task-output-dir", + "[START_DIR]/swarming_temp_dir/outputs/task-3" + ], + "name": "task-3", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'<br>swarming pending 71s@@@", + "@@@STEP_LOG_LINE@swarming.summary@{@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"shards\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"abandoned_ts\": null, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"bot_id\": \"vm30\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"completed_ts\": \"2014-09-25T01:42:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"created_ts\": \"2014-09-25T01:41:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"durations\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 5.7, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 31.5@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"exit_codes\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"id\": \"148aa78d7aa0000\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"internal_failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated_out\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated\": \"abc123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolatedserver\": \"https://isolateserver.appspot.com\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"namespace\": \"default-gzip\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"modified_ts\": \"2014-09-25 01:42:00\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"name\": \"heartbeat-canary-2014-09-25_01:41:55-os=Windows\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Heart beat succeeded on win32.\\n\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Foo\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs_ref\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"started_ts\": \"2014-09-25T01:42:11.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"state\": 112, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"try_number\": 1, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"user\": \"unknown\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ]@@@", + "@@@STEP_LOG_LINE@swarming.summary@}@@@", + "@@@STEP_LOG_END@swarming.summary@@@", + "@@@STEP_LINK@shard #0 isolated out@blah@@@", + "@@@STEP_LINK@view steps on Milo@https://luci-milo.appspot.com/swarming/task/148aa78d7aa0000@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "collect", + "--swarming", + "https://chromium-swarm.appspot.com", + "--decorate", + "--print-status-updates", + "--json", + "{\"base_task_name\": \"task-0/Linux/[dummy has\", \"tasks\": {\"task-0/Linux/[dummy has\": {\"shard_index\": 0, \"task_id\": \"10000\", \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"}}}", + "--task-summary-json", + "/path/to/tmp/json", + "--task-output-dir", + "[START_DIR]/swarming_temp_dir/outputs/task-0" + ], + "name": "task-0", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'<br>swarming pending 71s@@@", + "@@@STEP_LOG_LINE@swarming.summary@{@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"shards\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"abandoned_ts\": null, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"bot_id\": \"vm30\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"completed_ts\": \"2014-09-25T01:42:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"created_ts\": \"2014-09-25T01:41:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"durations\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 5.7, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 31.5@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"exit_codes\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"id\": \"148aa78d7aa0000\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"internal_failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated_out\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated\": \"abc123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolatedserver\": \"https://isolateserver.appspot.com\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"namespace\": \"default-gzip\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"modified_ts\": \"2014-09-25 01:42:00\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"name\": \"heartbeat-canary-2014-09-25_01:41:55-os=Windows\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Heart beat succeeded on win32.\\n\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Foo\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs_ref\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"started_ts\": \"2014-09-25T01:42:11.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"state\": 112, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"try_number\": 1, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"user\": \"unknown\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ]@@@", + "@@@STEP_LOG_LINE@swarming.summary@}@@@", + "@@@STEP_LOG_END@swarming.summary@@@", + "@@@STEP_LINK@shard #0 isolated out@blah@@@", + "@@@STEP_LINK@view steps on Milo@https://luci-milo.appspot.com/swarming/task/148aa78d7aa0000@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/swarming.client/swarming.py", + "collect", + "--swarming", + "https://chromium-swarm.appspot.com", + "--decorate", + "--print-status-updates", + "--json", + "{\"base_task_name\": \"task-1/Linux/[dummy has\", \"tasks\": {\"task-1/Linux/[dummy has\": {\"shard_index\": 0, \"task_id\": \"10000\", \"view_url\": \"https://chromium-swarm.appspot.com/user/task/10000\"}}}", + "--task-summary-json", + "/path/to/tmp/json", + "--task-output-dir", + "[START_DIR]/swarming_temp_dir/outputs/task-1" + ], + "name": "task-1", + "~followup_annotations": [ + "@@@STEP_TEXT@Run on OS: 'Linux'<br>swarming pending 71s@@@", + "@@@STEP_LOG_LINE@swarming.summary@{@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"shards\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"abandoned_ts\": null, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"bot_id\": \"vm30\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"completed_ts\": \"2014-09-25T01:42:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"created_ts\": \"2014-09-25T01:41:00.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"durations\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 5.7, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 31.5@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"exit_codes\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ 0@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"id\": \"148aa78d7aa0000\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"internal_failure\": false, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated_out\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolated\": \"abc123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"isolatedserver\": \"https://isolateserver.appspot.com\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"namespace\": \"default-gzip\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"modified_ts\": \"2014-09-25 01:42:00\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"name\": \"heartbeat-canary-2014-09-25_01:41:55-os=Windows\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs\": [@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Heart beat succeeded on win32.\\n\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"Foo\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ], @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"outputs_ref\": {@@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"view_url\": \"blah\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"started_ts\": \"2014-09-25T01:42:11.123\", @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"state\": 112, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"try_number\": 1, @@@", + "@@@STEP_LOG_LINE@swarming.summary@ \"user\": \"unknown\"@@@", + "@@@STEP_LOG_LINE@swarming.summary@ }@@@", + "@@@STEP_LOG_LINE@swarming.summary@ ]@@@", + "@@@STEP_LOG_LINE@swarming.summary@}@@@", + "@@@STEP_LOG_END@swarming.summary@@@", + "@@@STEP_LINK@shard #0 isolated out@blah@@@", + "@@@STEP_LINK@view steps on Milo@https://luci-milo.appspot.com/swarming/task/148aa78d7aa0000@@@" + ] + }, + { + "name": "$result", + "recipe_result": null, + "status_code": 0 + } +]
\ No newline at end of file diff --git a/infra/bots/recipe_modules/swarming/example.py b/infra/bots/recipe_modules/swarming/example.py new file mode 100644 index 0000000000..d862c480a6 --- /dev/null +++ b/infra/bots/recipe_modules/swarming/example.py @@ -0,0 +1,30 @@ +# Copyright 2017 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + + +DEPS = [ + 'recipe_engine/path', + 'recipe_engine/properties', + 'recipe_engine/step', + 'swarming', +] + + +def RunSteps(api): + api.swarming.setup('mydir', swarming_rev='abc123') + api.swarming.create_isolated_gen_json( + 'isolate_path', 'isolate_dir', 'linux', 'task', {'myvar': 'myval'}) + tasks_to_hashes = api.swarming.batcharchive(targets=[ + 'task-%s' % num for num in range(5)]) + tasks = api.swarming.trigger_swarming_tasks( + tasks_to_hashes, dimensions={'os': 'Linux'}) + for t in tasks: + api.swarming.collect_swarming_task(t) + + +def GenTests(api): + yield ( + api.test('test') + + api.properties(revision='abc123') + ) |