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

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

Issue 2909983003: [loader] Make recipe engine support examples/ module subdir (Closed)
Patch Set: Created 3 years, 6 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/json/example.py ('k') | recipe_modules/json/example.resources/cool_script.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 [
2 {
3 "cmd": [
4 "echo",
5 "[1, 2, 3]"
6 ],
7 "name": "echo1",
8 "stdout": "/path/to/tmp/json",
9 "~followup_annotations": [
10 "@@@STEP_LOG_LINE@json.output@[@@@",
11 "@@@STEP_LOG_LINE@json.output@ 1, @@@",
12 "@@@STEP_LOG_LINE@json.output@ 2, @@@",
13 "@@@STEP_LOG_LINE@json.output@ 3@@@",
14 "@@@STEP_LOG_LINE@json.output@]@@@",
15 "@@@STEP_LOG_END@json.output@@@"
16 ]
17 },
18 {
19 "cmd": [
20 "echo",
21 "{\"cool\": [1, 2, 3], \"hello\": \"world\"}"
22 ],
23 "name": "echo_dumps_property"
24 },
25 {
26 "cmd": [
27 "echo",
28 "[2, 3, 4]"
29 ],
30 "name": "echo2",
31 "stdout": "/path/to/tmp/json",
32 "~followup_annotations": [
33 "@@@STEP_LOG_LINE@json.output@[@@@",
34 "@@@STEP_LOG_LINE@json.output@ 2, @@@",
35 "@@@STEP_LOG_LINE@json.output@ 3, @@@",
36 "@@@STEP_LOG_LINE@json.output@ 4@@@",
37 "@@@STEP_LOG_LINE@json.output@]@@@",
38 "@@@STEP_LOG_END@json.output@@@"
39 ]
40 },
41 {
42 "cmd": [
43 "python",
44 "-u",
45 "\nimport json\nimport sys\nwith open(sys.argv[1], 'w') as f:\n f.write(j son.dumps([1, 2, 3]))\nwith open(sys.argv[2], 'w') as f:\n f.write(json.dumps([ 'x', 'y', '\\xef\\xbb\\xbf\\xef\\xbd\\x9a']))\n",
46 "/path/to/tmp/json",
47 "/path/to/tmp/json"
48 ],
49 "name": "foo",
50 "~followup_annotations": [
51 "@@@STEP_LOG_LINE@json.output[1]@[@@@",
52 "@@@STEP_LOG_LINE@json.output[1]@ 1, @@@",
53 "@@@STEP_LOG_LINE@json.output[1]@ 2, @@@",
54 "@@@STEP_LOG_LINE@json.output[1]@ 3@@@",
55 "@@@STEP_LOG_LINE@json.output[1]@]@@@",
56 "@@@STEP_LOG_END@json.output[1]@@@",
57 "@@@STEP_LOG_LINE@json.output[2]@[@@@",
58 "@@@STEP_LOG_LINE@json.output[2]@ \"x\", @@@",
59 "@@@STEP_LOG_LINE@json.output[2]@ \"y\", @@@",
60 "@@@STEP_LOG_LINE@json.output[2]@ \"\\ufeff\\uff5a\"@@@",
61 "@@@STEP_LOG_LINE@json.output[2]@]@@@",
62 "@@@STEP_LOG_END@json.output[2]@@@",
63 "@@@STEP_LOG_LINE@python.inline@@@@",
64 "@@@STEP_LOG_LINE@python.inline@import json@@@",
65 "@@@STEP_LOG_LINE@python.inline@import sys@@@",
66 "@@@STEP_LOG_LINE@python.inline@with open(sys.argv[1], 'w') as f:@@@",
67 "@@@STEP_LOG_LINE@python.inline@ f.write(json.dumps([1, 2, 3]))@@@",
68 "@@@STEP_LOG_LINE@python.inline@with open(sys.argv[2], 'w') as f:@@@",
69 "@@@STEP_LOG_LINE@python.inline@ f.write(json.dumps(['x', 'y', '\\xef\\xb b\\xbf\\xef\\xbd\\x9a']))@@@",
70 "@@@STEP_LOG_END@python.inline@@@"
71 ]
72 },
73 {
74 "cmd": [
75 "cat",
76 "{\"x\": 1, \"y\": 2}"
77 ],
78 "name": "json through",
79 "stdout": "/path/to/tmp/json",
80 "~followup_annotations": [
81 "@@@STEP_LOG_LINE@json.output@{@@@",
82 "@@@STEP_LOG_LINE@json.output@ \"x\": 1, @@@",
83 "@@@STEP_LOG_LINE@json.output@ \"y\": 2@@@",
84 "@@@STEP_LOG_LINE@json.output@}@@@",
85 "@@@STEP_LOG_END@json.output@@@"
86 ]
87 },
88 {
89 "cmd": [
90 "cat",
91 "{\"x\": 1, \"y\": 2}"
92 ],
93 "name": "write json to file",
94 "stdout": "[TMP_BASE]/temp.json"
95 },
96 {
97 "cmd": [
98 "python",
99 "-u",
100 "\nimport shutil\nimport sys\nshutil.copy(sys.argv[1], sys.argv[2])\n",
101 "[TMP_BASE]/temp.json",
102 "/path/to/tmp/json"
103 ],
104 "name": "read json from file we just wrote",
105 "~followup_annotations": [
106 "@@@STEP_LOG_LINE@json.output@{@@@",
107 "@@@STEP_LOG_LINE@json.output@ \"x\": 1, @@@",
108 "@@@STEP_LOG_LINE@json.output@ \"y\": 2@@@",
109 "@@@STEP_LOG_LINE@json.output@}@@@",
110 "@@@STEP_LOG_END@json.output@@@"
111 ]
112 },
113 {
114 "cmd": [
115 "python",
116 "RECIPE[recipe_engine::json:example].resources/cool_script.py",
117 "{\"x\":1,\"y\":2}",
118 "[TMP_BASE]/leak.json"
119 ],
120 "name": "leaking json",
121 "~followup_annotations": [
122 "@@@STEP_LOG_LINE@json.output@{@@@",
123 "@@@STEP_LOG_LINE@json.output@ \"x\": 1, @@@",
124 "@@@STEP_LOG_LINE@json.output@ \"y\": 2@@@",
125 "@@@STEP_LOG_LINE@json.output@}@@@",
126 "@@@STEP_LOG_END@json.output@@@"
127 ]
128 },
129 {
130 "cmd": [
131 "python",
132 "RECIPE[recipe_engine::json:example].resources/cool_script.py",
133 "{\"here is some total\ngarbage",
134 "/path/to/tmp/json"
135 ],
136 "name": "invalid json",
137 "~followup_annotations": [
138 "@@@STEP_LOG_LINE@json.output (invalid)@{\"here is some total@@@",
139 "@@@STEP_LOG_LINE@json.output (invalid)@garbage@@@",
140 "@@@STEP_LOG_END@json.output (invalid)@@@",
141 "@@@STEP_LOG_LINE@json.output (exception)@Invalid control character at: li ne 1 column 21 (char 20)@@@",
142 "@@@STEP_LOG_END@json.output (exception)@@@"
143 ]
144 },
145 {
146 "name": "$result",
147 "recipe_result": null,
148 "status_code": 0
149 }
150 ]
OLDNEW
« no previous file with comments | « recipe_modules/json/example.py ('k') | recipe_modules/json/example.resources/cool_script.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698