Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Side by Side Diff: recipe_modules/shutil/example.expected/basic.json

Issue 1923013002: Revert of recipe engine: extract infra-specific paths out of the engine (Closed) Base URL: https://github.com/luci/recipes-py.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « recipe_modules/shutil/example.py ('k') | recipe_modules/step/api.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 [ 1 [
2 { 2 {
3 "cmd": [ 3 "cmd": [
4 "python", 4 "python",
5 "-u", 5 "-u",
6 "\nimport os\nimport sys\nos.remove(sys.argv[1])\n", 6 "\nimport os\nimport sys\nos.remove(sys.argv[1])\n",
7 "bar" 7 "bar"
8 ], 8 ],
9 "cwd": "[SLAVE_BUILD]",
9 "name": "foo", 10 "name": "foo",
10 "~followup_annotations": [ 11 "~followup_annotations": [
11 "@@@STEP_LOG_LINE@python.inline@@@@", 12 "@@@STEP_LOG_LINE@python.inline@@@@",
12 "@@@STEP_LOG_LINE@python.inline@import os@@@", 13 "@@@STEP_LOG_LINE@python.inline@import os@@@",
13 "@@@STEP_LOG_LINE@python.inline@import sys@@@", 14 "@@@STEP_LOG_LINE@python.inline@import sys@@@",
14 "@@@STEP_LOG_LINE@python.inline@os.remove(sys.argv[1])@@@", 15 "@@@STEP_LOG_LINE@python.inline@os.remove(sys.argv[1])@@@",
15 "@@@STEP_LOG_END@python.inline@@@" 16 "@@@STEP_LOG_END@python.inline@@@"
16 ] 17 ]
17 }, 18 },
18 { 19 {
19 "cmd": [ 20 "cmd": [
20 "python", 21 "python",
21 "-u", 22 "-u",
22 "\nimport json, os, sys\nif os.path.exists(sys.argv[1]) and os.path.isdir( sys.argv[1]):\n with open(sys.argv[2], 'w') as f:\n json.dump(os.listdir(sys .argv[1]), f)\n", 23 "\nimport json, os, sys\nif os.path.exists(sys.argv[1]) and os.path.isdir( sys.argv[1]):\n with open(sys.argv[2], 'w') as f:\n json.dump(os.listdir(sys .argv[1]), f)\n",
23 "/fake/dir", 24 "/fake/dir",
24 "/path/to/tmp/json" 25 "/path/to/tmp/json"
25 ], 26 ],
27 "cwd": "[SLAVE_BUILD]",
26 "name": "listdir fake dir", 28 "name": "listdir fake dir",
27 "~followup_annotations": [ 29 "~followup_annotations": [
28 "@@@STEP_LOG_LINE@json.output@[@@@", 30 "@@@STEP_LOG_LINE@json.output@[@@@",
29 "@@@STEP_LOG_LINE@json.output@ \"file 1\", @@@", 31 "@@@STEP_LOG_LINE@json.output@ \"file 1\", @@@",
30 "@@@STEP_LOG_LINE@json.output@ \"file 2\"@@@", 32 "@@@STEP_LOG_LINE@json.output@ \"file 2\"@@@",
31 "@@@STEP_LOG_LINE@json.output@]@@@", 33 "@@@STEP_LOG_LINE@json.output@]@@@",
32 "@@@STEP_LOG_END@json.output@@@", 34 "@@@STEP_LOG_END@json.output@@@",
33 "@@@STEP_LOG_LINE@python.inline@@@@", 35 "@@@STEP_LOG_LINE@python.inline@@@@",
34 "@@@STEP_LOG_LINE@python.inline@import json, os, sys@@@", 36 "@@@STEP_LOG_LINE@python.inline@import json, os, sys@@@",
35 "@@@STEP_LOG_LINE@python.inline@if os.path.exists(sys.argv[1]) and os.path .isdir(sys.argv[1]):@@@", 37 "@@@STEP_LOG_LINE@python.inline@if os.path.exists(sys.argv[1]) and os.path .isdir(sys.argv[1]):@@@",
36 "@@@STEP_LOG_LINE@python.inline@ with open(sys.argv[2], 'w') as f:@@@", 38 "@@@STEP_LOG_LINE@python.inline@ with open(sys.argv[2], 'w') as f:@@@",
37 "@@@STEP_LOG_LINE@python.inline@ json.dump(os.listdir(sys.argv[1]), f)@ @@", 39 "@@@STEP_LOG_LINE@python.inline@ json.dump(os.listdir(sys.argv[1]), f)@ @@",
38 "@@@STEP_LOG_END@python.inline@@@" 40 "@@@STEP_LOG_END@python.inline@@@"
39 ] 41 ]
40 }, 42 },
41 { 43 {
42 "cmd": [ 44 "cmd": [
43 "some", 45 "some",
44 "command" 46 "command"
45 ], 47 ],
48 "cwd": "[SLAVE_BUILD]",
46 "name": "manipulate file 1" 49 "name": "manipulate file 1"
47 }, 50 },
48 { 51 {
49 "cmd": [ 52 "cmd": [
50 "some", 53 "some",
51 "command" 54 "command"
52 ], 55 ],
56 "cwd": "[SLAVE_BUILD]",
53 "name": "manipulate file 2" 57 "name": "manipulate file 2"
54 }, 58 },
55 { 59 {
56 "cmd": [ 60 "cmd": [
57 "echo", 61 "echo",
58 "[TMP]/prefix_a_tmp_1" 62 "[TMP_BASE]/prefix_a_tmp_1"
59 ], 63 ],
64 "cwd": "[SLAVE_BUILD]",
60 "name": "print prefix_a" 65 "name": "print prefix_a"
61 }, 66 },
62 { 67 {
63 "cmd": [ 68 "cmd": [
64 "echo", 69 "echo",
65 "[TMP]/prefix_b_tmp_2" 70 "[TMP_BASE]/prefix_b_tmp_2"
66 ], 71 ],
72 "cwd": "[SLAVE_BUILD]",
67 "name": "print prefix_b" 73 "name": "print prefix_b"
68 }, 74 },
69 { 75 {
70 "cmd": [ 76 "cmd": [
71 "python", 77 "python",
72 "-u", 78 "-u",
73 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 79 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
74 "abcde", 80 "abcde",
75 "tmp_file.txt" 81 "tmp_file.txt"
76 ], 82 ],
83 "cwd": "[SLAVE_BUILD]",
77 "name": "write_simple" 84 "name": "write_simple"
78 }, 85 },
79 { 86 {
80 "cmd": [ 87 "cmd": [
81 "python", 88 "python",
82 "-u", 89 "-u",
83 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 90 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
84 "tmp_file.txt", 91 "tmp_file.txt",
85 "/path/to/tmp/" 92 "/path/to/tmp/"
86 ], 93 ],
94 "cwd": "[SLAVE_BUILD]",
87 "name": "read_simple" 95 "name": "read_simple"
88 }, 96 },
89 { 97 {
90 "cmd": [ 98 "cmd": [
91 "python", 99 "python",
92 "-u", 100 "-u",
93 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 101 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
94 "! ~&&", 102 "! ~&&",
95 "tmp_file.txt" 103 "tmp_file.txt"
96 ], 104 ],
105 "cwd": "[SLAVE_BUILD]",
97 "name": "write_symbols" 106 "name": "write_symbols"
98 }, 107 },
99 { 108 {
100 "cmd": [ 109 "cmd": [
101 "python", 110 "python",
102 "-u", 111 "-u",
103 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 112 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
104 "tmp_file.txt", 113 "tmp_file.txt",
105 "/path/to/tmp/" 114 "/path/to/tmp/"
106 ], 115 ],
116 "cwd": "[SLAVE_BUILD]",
107 "name": "read_symbols" 117 "name": "read_symbols"
108 }, 118 },
109 { 119 {
110 "cmd": [ 120 "cmd": [
111 "python", 121 "python",
112 "-u", 122 "-u",
113 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 123 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
114 "abcde fgh", 124 "abcde fgh",
115 "tmp_file.txt" 125 "tmp_file.txt"
116 ], 126 ],
127 "cwd": "[SLAVE_BUILD]",
117 "name": "write_spaces" 128 "name": "write_spaces"
118 }, 129 },
119 { 130 {
120 "cmd": [ 131 "cmd": [
121 "python", 132 "python",
122 "-u", 133 "-u",
123 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 134 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
124 "tmp_file.txt", 135 "tmp_file.txt",
125 "/path/to/tmp/" 136 "/path/to/tmp/"
126 ], 137 ],
138 "cwd": "[SLAVE_BUILD]",
127 "name": "read_spaces" 139 "name": "read_spaces"
128 }, 140 },
129 { 141 {
130 "cmd": [ 142 "cmd": [
131 "python", 143 "python",
132 "-u", 144 "-u",
133 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 145 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
134 "ab\ncd\nefg\n", 146 "ab\ncd\nefg\n",
135 "tmp_file.txt" 147 "tmp_file.txt"
136 ], 148 ],
149 "cwd": "[SLAVE_BUILD]",
137 "name": "write_multiline" 150 "name": "write_multiline"
138 }, 151 },
139 { 152 {
140 "cmd": [ 153 "cmd": [
141 "python", 154 "python",
142 "-u", 155 "-u",
143 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 156 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
144 "tmp_file.txt", 157 "tmp_file.txt",
145 "/path/to/tmp/" 158 "/path/to/tmp/"
146 ], 159 ],
160 "cwd": "[SLAVE_BUILD]",
147 "name": "read_multiline" 161 "name": "read_multiline"
148 }, 162 },
149 { 163 {
150 "cmd": [ 164 "cmd": [
151 "python", 165 "python",
152 "-u", 166 "-u",
153 "\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", 167 "\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",
154 "[TMP]/copytree_example_tmp", 168 "[SLAVE_BUILD]/copytree_example_tmp",
155 "511" 169 "511"
156 ], 170 ],
171 "cwd": "[SLAVE_BUILD]",
157 "name": "makedirs makedirs", 172 "name": "makedirs makedirs",
158 "~followup_annotations": [ 173 "~followup_annotations": [
159 "@@@STEP_LOG_LINE@python.inline@@@@", 174 "@@@STEP_LOG_LINE@python.inline@@@@",
160 "@@@STEP_LOG_LINE@python.inline@import sys, os@@@", 175 "@@@STEP_LOG_LINE@python.inline@import sys, os@@@",
161 "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@", 176 "@@@STEP_LOG_LINE@python.inline@path = sys.argv[1]@@@",
162 "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@", 177 "@@@STEP_LOG_LINE@python.inline@mode = int(sys.argv[2])@@@",
163 "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@", 178 "@@@STEP_LOG_LINE@python.inline@if not os.path.isdir(path):@@@",
164 "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@", 179 "@@@STEP_LOG_LINE@python.inline@ if os.path.exists(path):@@@",
165 "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@", 180 "@@@STEP_LOG_LINE@python.inline@ print \"%s exists but is not a dir\" % path@@@",
166 "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@", 181 "@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@",
167 "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@", 182 "@@@STEP_LOG_LINE@python.inline@ os.makedirs(path, mode)@@@",
168 "@@@STEP_LOG_END@python.inline@@@" 183 "@@@STEP_LOG_END@python.inline@@@"
169 ] 184 ]
170 }, 185 },
171 { 186 {
172 "cmd": [ 187 "cmd": [
173 "python", 188 "python",
174 "-u", 189 "-u",
175 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 190 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
176 "some file content", 191 "some file content",
177 "[TMP]/copytree_example_tmp/dummy_file" 192 "[SLAVE_BUILD]/copytree_example_tmp/dummy_file"
178 ], 193 ],
179 "name": "write [TMP]/copytree_example_tmp/dummy_file" 194 "cwd": "[SLAVE_BUILD]",
195 "name": "write [SLAVE_BUILD]/copytree_example_tmp/dummy_file"
180 }, 196 },
181 { 197 {
182 "cmd": [ 198 "cmd": [
183 "python", 199 "python",
184 "-u", 200 "-u",
185 "\nimport shutil\nimport sys\nshutil.copytree(sys.argv[1], sys.argv[2], sy mlinks=bool(sys.argv[3]))\n", 201 "\nimport shutil\nimport sys\nshutil.copytree(sys.argv[1], sys.argv[2], sy mlinks=bool(sys.argv[3]))\n",
186 "[TMP]/copytree_example_tmp", 202 "[SLAVE_BUILD]/copytree_example_tmp",
187 "[TMP]/copytree_example_tmp2", 203 "[SLAVE_BUILD]/copytree_example_tmp2",
188 "0" 204 "0"
189 ], 205 ],
206 "cwd": "[SLAVE_BUILD]",
190 "name": "copytree" 207 "name": "copytree"
191 }, 208 },
192 { 209 {
193 "cmd": [ 210 "cmd": [
194 "python", 211 "python",
195 "-u", 212 "-u",
196 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n", 213 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
197 "[TMP]/copytree_example_tmp2/dummy_file", 214 "[SLAVE_BUILD]/copytree_example_tmp2/dummy_file",
198 "/path/to/tmp/" 215 "/path/to/tmp/"
199 ], 216 ],
200 "name": "read [TMP]/copytree_example_tmp2/dummy_file" 217 "cwd": "[SLAVE_BUILD]",
218 "name": "read [SLAVE_BUILD]/copytree_example_tmp2/dummy_file"
201 }, 219 },
202 { 220 {
203 "cmd": [ 221 "cmd": [
204 "python", 222 "python",
205 "-u", 223 "-u",
206 "\nimport glob\nimport sys\nwith open(sys.argv[1], 'w') as f:\n f.write(' \\n'.join(glob.glob(sys.argv[2])))\n", 224 "\nimport glob\nimport sys\nwith open(sys.argv[1], 'w') as f:\n f.write(' \\n'.join(glob.glob(sys.argv[2])))\n",
207 "/path/to/tmp/", 225 "/path/to/tmp/",
208 "[TMP]/copytree_example_tmp/*" 226 "[SLAVE_BUILD]/copytree_example_tmp/*"
209 ], 227 ],
228 "cwd": "[SLAVE_BUILD]",
210 "name": "glob" 229 "name": "glob"
211 }, 230 },
212 { 231 {
213 "cmd": [ 232 "cmd": [
214 "python", 233 "python",
215 "-u", 234 "-u",
216 "\nimport shutil, sys\nshutil.rmtree(sys.argv[1])\n", 235 "\nimport shutil, sys\nshutil.rmtree(sys.argv[1])\n",
217 "[TMP]/copytree_example_tmp" 236 "[SLAVE_BUILD]/copytree_example_tmp"
218 ], 237 ],
238 "cwd": "[SLAVE_BUILD]",
219 "name": "cleanup", 239 "name": "cleanup",
220 "~followup_annotations": [ 240 "~followup_annotations": [
221 "@@@STEP_LOG_LINE@python.inline@@@@", 241 "@@@STEP_LOG_LINE@python.inline@@@@",
222 "@@@STEP_LOG_LINE@python.inline@import shutil, sys@@@", 242 "@@@STEP_LOG_LINE@python.inline@import shutil, sys@@@",
223 "@@@STEP_LOG_LINE@python.inline@shutil.rmtree(sys.argv[1])@@@", 243 "@@@STEP_LOG_LINE@python.inline@shutil.rmtree(sys.argv[1])@@@",
224 "@@@STEP_LOG_END@python.inline@@@" 244 "@@@STEP_LOG_END@python.inline@@@"
225 ] 245 ]
226 }, 246 },
227 { 247 {
228 "cmd": [ 248 "cmd": [
229 "python", 249 "python",
230 "-u", 250 "-u",
231 "\nimport shutil, sys\nshutil.rmtree(sys.argv[1])\n", 251 "\nimport shutil, sys\nshutil.rmtree(sys.argv[1])\n",
232 "[TMP]/copytree_example_tmp2" 252 "[SLAVE_BUILD]/copytree_example_tmp2"
233 ], 253 ],
254 "cwd": "[SLAVE_BUILD]",
234 "name": "cleanup2", 255 "name": "cleanup2",
235 "~followup_annotations": [ 256 "~followup_annotations": [
236 "@@@STEP_LOG_LINE@python.inline@@@@", 257 "@@@STEP_LOG_LINE@python.inline@@@@",
237 "@@@STEP_LOG_LINE@python.inline@import shutil, sys@@@", 258 "@@@STEP_LOG_LINE@python.inline@import shutil, sys@@@",
238 "@@@STEP_LOG_LINE@python.inline@shutil.rmtree(sys.argv[1])@@@", 259 "@@@STEP_LOG_LINE@python.inline@shutil.rmtree(sys.argv[1])@@@",
239 "@@@STEP_LOG_END@python.inline@@@" 260 "@@@STEP_LOG_END@python.inline@@@"
240 ] 261 ]
241 }, 262 },
242 { 263 {
243 "name": "$result", 264 "name": "$result",
244 "recipe_result": null, 265 "recipe_result": null,
245 "status_code": 0 266 "status_code": 0
246 } 267 }
247 ] 268 ]
OLDNEW
« no previous file with comments | « recipe_modules/shutil/example.py ('k') | recipe_modules/step/api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698