rainforest-cli 1.6.5 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/CHANGELOG.md +8 -0
  4. data/README.md +42 -7
  5. data/bin/rainforest +1 -1
  6. data/lib/{rainforest/cli.rb → rainforest_cli.rb} +23 -15
  7. data/lib/{rainforest/cli → rainforest_cli}/constants.rb +0 -0
  8. data/lib/{rainforest/cli → rainforest_cli}/csv_importer.rb +0 -0
  9. data/lib/{rainforest/cli → rainforest_cli}/deleter.rb +0 -0
  10. data/lib/{rainforest/cli → rainforest_cli}/exporter.rb +0 -0
  11. data/lib/{rainforest/cli → rainforest_cli}/git_trigger.rb +0 -0
  12. data/lib/{rainforest/cli → rainforest_cli}/http_client.rb +5 -4
  13. data/lib/rainforest_cli/junit_outputter.rb +69 -0
  14. data/lib/{rainforest/cli → rainforest_cli}/options.rb +40 -1
  15. data/lib/{rainforest/cli → rainforest_cli}/remote_tests.rb +0 -0
  16. data/lib/rainforest_cli/reporter.rb +64 -0
  17. data/lib/{rainforest/cli → rainforest_cli}/resources.rb +0 -0
  18. data/lib/{rainforest/cli → rainforest_cli}/runner.rb +20 -6
  19. data/lib/{rainforest/cli → rainforest_cli}/test_files.rb +0 -0
  20. data/lib/{rainforest/cli → rainforest_cli}/test_parser.rb +4 -65
  21. data/lib/rainforest_cli/test_parser/embedded_test.rb +14 -0
  22. data/lib/rainforest_cli/test_parser/step.rb +24 -0
  23. data/lib/rainforest_cli/test_parser/test.rb +40 -0
  24. data/lib/{rainforest/cli → rainforest_cli}/uploader.rb +32 -27
  25. data/lib/rainforest_cli/uploader/multi_form_post_request.rb +50 -0
  26. data/lib/rainforest_cli/uploader/uploadable_parser.rb +143 -0
  27. data/lib/{rainforest/cli → rainforest_cli}/validator.rb +0 -0
  28. data/lib/{rainforest/cli → rainforest_cli}/version.rb +1 -1
  29. data/rainforest-cli.gemspec +3 -1
  30. data/spec/fixtures/failed_test_response.json +29 -0
  31. data/spec/fixtures/runs_response.json +275 -0
  32. data/spec/fixtures/tests_response.json +130 -0
  33. data/spec/{csv_importer_spec.rb → rainforest_cli/csv_importer_spec.rb} +7 -14
  34. data/spec/{deleter_spec.rb → rainforest_cli/deleter_spec.rb} +0 -0
  35. data/spec/{exporter_spec.rb → rainforest_cli/exporter_spec.rb} +0 -0
  36. data/spec/{git_trigger_spec.rb → rainforest_cli/git_trigger_spec.rb} +0 -0
  37. data/spec/{http_client_spec.rb → rainforest_cli/http_client_spec.rb} +23 -0
  38. data/spec/rainforest_cli/junit_outputter_spec.rb +32 -0
  39. data/spec/{options_spec.rb → rainforest_cli/options_spec.rb} +33 -0
  40. data/spec/{remote_tests_spec.rb → rainforest_cli/remote_tests_spec.rb} +0 -0
  41. data/spec/rainforest_cli/reporter_spec.rb +51 -0
  42. data/spec/{resources_spec.rb → rainforest_cli/resources_spec.rb} +0 -0
  43. data/spec/{runner_spec.rb → rainforest_cli/runner_spec.rb} +0 -0
  44. data/spec/{test_files_spec.rb → rainforest_cli/test_files_spec.rb} +1 -1
  45. data/spec/rainforest_cli/test_parser/step_spec.rb +53 -0
  46. data/spec/rainforest_cli/test_parser_spec.rb +15 -0
  47. data/spec/rainforest_cli/uploader/uploadable_parser_spec.rb +84 -0
  48. data/spec/{uploader_spec.rb → rainforest_cli/uploader_spec.rb} +2 -2
  49. data/spec/{validator_spec.rb → rainforest_cli/validator_spec.rb} +6 -7
  50. data/spec/{cli_spec.rb → rainforest_cli_spec.rb} +5 -5
  51. data/spec/spec_helper.rb +4 -1
  52. metadata +95 -47
  53. data/.rvmrc +0 -1
  54. data/spec/test_parser_spec.rb +0 -95
File without changes
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module RainforestCli
3
- VERSION = '1.6.5'
3
+ VERSION = '1.7.0'
4
4
  end
@@ -2,7 +2,7 @@
2
2
  # coding: utf-8
3
3
  lib = File.expand_path('../lib', __FILE__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'rainforest/cli/version'
5
+ require 'rainforest_cli/version'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'rainforest-cli'
@@ -20,10 +20,12 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
 
22
22
  spec.add_dependency 'httparty', '~> 0.13.7'
23
+ spec.add_dependency 'mimemagic', '0.3.0'
23
24
  spec.add_dependency 'parallel', '~> 1.6', '>= 1.6.1'
24
25
  spec.add_dependency 'ruby-progressbar', '~> 1.7', '>= 1.7.5'
25
26
  spec.add_dependency 'rainforest', '~> 2.1', '>= 2.1.0'
26
27
  spec.add_dependency 'http-exceptions', '~> 0.0', '>= 0.0.4'
28
+ spec.add_dependency 'builder', '~> 3.2'
27
29
  spec.add_development_dependency 'bundler', '~> 1.3'
28
30
  spec.add_development_dependency 'rake', '~> 10.4', '>= 10.4.2'
29
31
  end
@@ -0,0 +1,29 @@
1
+ {
2
+ "steps": [
3
+ {
4
+ "browsers": [
5
+ {
6
+ "name": "this_is_a_browser",
7
+ "result": "failed",
8
+ "feedback": [
9
+ {
10
+ "job_state": "approved",
11
+ "answer_given": "no",
12
+ "note": "This feedback should appear"
13
+ },
14
+ {
15
+ "job_state": "approved",
16
+ "answer_given": "no",
17
+ "note": "This \"feedback\" has escaped\n characters"
18
+ },
19
+ {
20
+ "job_state": "unapproved",
21
+ "answer_given": "no",
22
+ "note": "This feedback shouldn't \"appear"
23
+ }
24
+ ]
25
+ }
26
+ ]
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,275 @@
1
+ {
2
+ "id": 12345,
3
+ "created_at": "2016-06-21T09:39:50Z",
4
+ "crowd": "default",
5
+ "reroute_geo": "default",
6
+ "environment": {
7
+ "id": 123,
8
+ "created_at": "2016-05-05T17:47:55Z",
9
+ "name": "Enviornment",
10
+ "default": true,
11
+ "webhook": null,
12
+ "webhook_enabled": null,
13
+ "site_environments": [
14
+ {
15
+ "id": 123,
16
+ "created_at": "2016-05-05T17:47:55Z",
17
+ "site_id": 123,
18
+ "environment_id": 123,
19
+ "url": "http://nowhere.com"
20
+ }
21
+ ]
22
+ },
23
+ "tests": [
24
+ {
25
+ "id": 1,
26
+ "created_at": "2016-06-21T09:40:07Z",
27
+ "title": "A passing test case",
28
+ "test_id": 1,
29
+ "result": "passed"
30
+ },
31
+ {
32
+ "id": 2,
33
+ "created_at": "2016-06-21T09:40:07Z",
34
+ "title": "Another passing test case",
35
+ "test_id": 37273,
36
+ "result": "passed"
37
+ },
38
+ {
39
+ "id": 3,
40
+ "created_at": "2016-06-21T09:40:07Z",
41
+ "title": "A failing test case",
42
+ "test_id": 3,
43
+ "result": "failed"
44
+ },
45
+ {
46
+ "id": 4,
47
+ "created_at": "2016-06-21T09:40:07Z",
48
+ "title": "This title \"has\" escaped quotes",
49
+ "test_id": 4,
50
+ "result": "failed"
51
+ }
52
+ ],
53
+ "state": "complete",
54
+ "state_details": {
55
+ "name": "complete",
56
+ "is_final_state": true
57
+ },
58
+ "result": "failed",
59
+ "current_progress": {
60
+ "percent": 100,
61
+ "total": 4,
62
+ "complete": 4,
63
+ "eta": {
64
+ "seconds": 0,
65
+ "ts": "2016-07-07T20:13:10.064+00:00"
66
+ },
67
+ "no_result": 0,
68
+ "passed": 2,
69
+ "failed": 2
70
+ },
71
+ "timestamps": {
72
+ "complete": "2016-06-21T11:43:24.713Z",
73
+ "in_progress": "2016-06-21T09:40:49.698Z",
74
+ "provisionally_complete": "2016-06-21T11:39:13.612Z",
75
+ "validating": "2016-06-21T09:40:13.786Z",
76
+ "created_at": "2016-06-21T09:39:50.880Z"
77
+ },
78
+ "stats": {
79
+ "total_time_for_one_person": 90423,
80
+ "total_time_for_rainforest": 7413.775966,
81
+ "total_rainforest_overhead": 58.812942,
82
+ "speed_up": 12.2
83
+ },
84
+ "browsers": [
85
+ {
86
+ "name": "android_phone_landscape",
87
+ "state": "disabled",
88
+ "description": "Android Phone Landscape",
89
+ "category": "phone"
90
+ },
91
+ {
92
+ "name": "android_phone_portrait",
93
+ "state": "disabled",
94
+ "description": "Android Phone Portrait",
95
+ "category": "phone"
96
+ },
97
+ {
98
+ "name": "android_tablet_landscape",
99
+ "state": "disabled",
100
+ "description": "Android Tablet Landscape",
101
+ "category": "tablet"
102
+ },
103
+ {
104
+ "name": "android_tablet_portrait",
105
+ "state": "disabled",
106
+ "description": "Android Tablet Portrait",
107
+ "category": "tablet"
108
+ },
109
+ {
110
+ "name": "chrome",
111
+ "state": "disabled",
112
+ "description": "Google Chrome",
113
+ "category": "browser"
114
+ },
115
+ {
116
+ "name": "chrome_1440_900",
117
+ "state": "disabled",
118
+ "description": "Chrome (1440x900)",
119
+ "category": "browser"
120
+ },
121
+ {
122
+ "name": "firefox",
123
+ "state": "disabled",
124
+ "description": "Mozilla Firefox",
125
+ "category": "browser"
126
+ },
127
+ {
128
+ "name": "firefox_1440_900",
129
+ "state": "disabled",
130
+ "description": "Mozilla Firefox (1440x900)",
131
+ "category": "browser"
132
+ },
133
+ {
134
+ "name": "ie8",
135
+ "state": "disabled",
136
+ "description": "Microsoft Internet Explorer 8",
137
+ "category": "browser"
138
+ },
139
+ {
140
+ "name": "ie9",
141
+ "state": "disabled",
142
+ "description": "Microsoft Internet Explorer 9",
143
+ "category": "browser"
144
+ },
145
+ {
146
+ "name": "ie10",
147
+ "state": "disabled",
148
+ "description": "Microsoft Internet Explorer 10",
149
+ "category": "browser"
150
+ },
151
+ {
152
+ "name": "ie11",
153
+ "state": "disabled",
154
+ "description": "Microsoft Internet Explorer 11",
155
+ "category": "browser"
156
+ },
157
+ {
158
+ "name": "ie10_1440_900",
159
+ "state": "disabled",
160
+ "description": "Microsoft Internet Explorer 10 (1440x900)",
161
+ "category": "browser"
162
+ },
163
+ {
164
+ "name": "ie11_1440_900",
165
+ "state": "disabled",
166
+ "description": "Microsoft Internet Explorer 11 (1440x900)",
167
+ "category": "browser"
168
+ },
169
+ {
170
+ "name": "ie8_1440_900",
171
+ "state": "disabled",
172
+ "description": "Microsoft Internet Explorer 8 (1440x900)",
173
+ "category": "browser"
174
+ },
175
+ {
176
+ "name": "ie9_1440_900",
177
+ "state": "disabled",
178
+ "description": "Microsoft Internet Explorer 9 (1440x900)",
179
+ "category": "browser"
180
+ },
181
+ {
182
+ "name": "office2010",
183
+ "state": "disabled",
184
+ "description": "Microsoft Office 2010 Pro",
185
+ "category": "software"
186
+ },
187
+ {
188
+ "name": "office2013",
189
+ "state": "disabled",
190
+ "description": "Microsoft Office 2013 Pro",
191
+ "category": "software"
192
+ },
193
+ {
194
+ "name": "osx_chrome",
195
+ "state": "disabled",
196
+ "description": "Google Chrome (OSX)",
197
+ "category": "browser"
198
+ },
199
+ {
200
+ "name": "osx_chrome_1440_900",
201
+ "state": "disabled",
202
+ "description": "Chrome on OSX Mavericks (1440x900)",
203
+ "category": "browser"
204
+ },
205
+ {
206
+ "name": "osx_firefox",
207
+ "state": "disabled",
208
+ "description": "Mozilla Firefox (OSX)",
209
+ "category": "browser"
210
+ },
211
+ {
212
+ "name": "osx_firefox_1440_900",
213
+ "state": "enabled",
214
+ "description": "Firefox on OS X Mavericks (1440x900)",
215
+ "category": "browser"
216
+ },
217
+ {
218
+ "name": "safari",
219
+ "state": "disabled",
220
+ "description": "Apple Safari",
221
+ "category": "browser"
222
+ },
223
+ {
224
+ "name": "safari_1440_900",
225
+ "state": "disabled",
226
+ "description": "Safari 9 on OSX Mavericks (1440x900)",
227
+ "category": "browser"
228
+ },
229
+ {
230
+ "name": "ubuntu_chrome",
231
+ "state": "disabled",
232
+ "description": "Ubuntu Chrome",
233
+ "category": "browser"
234
+ },
235
+ {
236
+ "name": "ubuntu_firefox",
237
+ "state": "disabled",
238
+ "description": "Ubuntu Firefox",
239
+ "category": "browser"
240
+ },
241
+ {
242
+ "name": "windows10_edge",
243
+ "state": "disabled",
244
+ "description": "Edge on Windows 10",
245
+ "category": "browser"
246
+ },
247
+ {
248
+ "name": "windows10_ie11",
249
+ "state": "disabled",
250
+ "description": "IE11 on Windows 10",
251
+ "category": "browser"
252
+ }
253
+ ],
254
+ "user": {},
255
+ "error_logs": [],
256
+ "filters": {
257
+ "smart_folder_id": 929
258
+ },
259
+ "log_url": "https://someurl.com",
260
+ "description": "Test Description",
261
+ "real_cost_to_run": 277,
262
+ "frontend_url": "https://app.rainforestqa.com/runs/12345",
263
+ "total_tests": 4,
264
+ "total_passed_tests": 2,
265
+ "total_failed_tests": 2,
266
+ "total_no_result_tests": 0,
267
+ "sample_test_titles": [
268
+ "A passing test case",
269
+ "Another passing test case",
270
+ "A failing test case",
271
+ "This title \"has\" escaped quotes"
272
+ ],
273
+ "time_taken": 7354.963024,
274
+ "app_source_url": null
275
+ }
@@ -0,0 +1,130 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "created_at": "2016-06-21T09:40:07Z",
5
+ "test_id": 1,
6
+ "site_id": 123,
7
+ "title": "A passing test case",
8
+ "state": "complete",
9
+ "result": "passed",
10
+ "start_uri": "/",
11
+ "description": "This description \"contains\" escaped\ncharacters",
12
+ "run_mode": "default",
13
+ "updated_at": "2016-06-21T10:32:31.987Z",
14
+ "editable": false,
15
+ "browsers": [
16
+ {
17
+ "id": 1790934,
18
+ "created_at": "2016-06-21T09:40:47Z",
19
+ "name": "osx_firefox_1440_900",
20
+ "description": "Firefox on OS X Mavericks (1440x900)",
21
+ "category": "browser",
22
+ "result": "passed",
23
+ "state": "complete"
24
+ }
25
+ ],
26
+ "step_count": 9,
27
+ "frontend_url": "https://app.rainforestqa.com/runs/12345/tests/1",
28
+ "current_progress": {
29
+ "percent": 100,
30
+ "total": 1,
31
+ "complete": 1
32
+ }
33
+ },
34
+ {
35
+ "id": 2,
36
+ "created_at": "2016-06-21T09:40:07Z",
37
+ "test_id": 2,
38
+ "site_id": 123,
39
+ "title": "Another passing test case",
40
+ "state": "complete",
41
+ "result": "passed",
42
+ "start_uri": "/",
43
+ "description": "This description \"contains\" escaped\ncharacters",
44
+ "run_mode": "default",
45
+ "updated_at": "2016-06-21T10:12:53.143Z",
46
+ "editable": false,
47
+ "browsers": [
48
+ {
49
+ "id": 1790912,
50
+ "created_at": "2016-06-21T09:40:36Z",
51
+ "name": "osx_firefox_1440_900",
52
+ "description": "Firefox on OS X Mavericks (1440x900)",
53
+ "category": "browser",
54
+ "result": "passed",
55
+ "state": "complete"
56
+ }
57
+ ],
58
+ "step_count": 10,
59
+ "frontend_url": "https://app.rainforestqa.com/runs/12345/tests/2",
60
+ "current_progress": {
61
+ "percent": 100,
62
+ "total": 1,
63
+ "complete": 1
64
+ }
65
+ },
66
+ {
67
+ "id": 3,
68
+ "created_at": "2016-06-21T09:40:07Z",
69
+ "test_id": 3,
70
+ "site_id": 123,
71
+ "title": "A failing test case",
72
+ "state": "complete",
73
+ "result": "failed",
74
+ "start_uri": "/",
75
+ "description": "This description \"contains\" escaped\ncharacters",
76
+ "run_mode": "default",
77
+ "updated_at": "2016-06-21T10:30:51.848Z",
78
+ "editable": false,
79
+ "browsers": [
80
+ {
81
+ "id": 1790911,
82
+ "created_at": "2016-06-21T09:40:35Z",
83
+ "name": "osx_firefox_1440_900",
84
+ "description": "Firefox on OS X Mavericks (1440x900)",
85
+ "category": "browser",
86
+ "result": "failed",
87
+ "state": "complete"
88
+ }
89
+ ],
90
+ "step_count": 10,
91
+ "frontend_url": "https://app.rainforestqa.com/runs/12345/tests/3",
92
+ "current_progress": {
93
+ "percent": 100,
94
+ "total": 1,
95
+ "complete": 1
96
+ }
97
+ },
98
+ {
99
+ "id": 4,
100
+ "created_at": "2016-06-21T09:40:07Z",
101
+ "test_id": 4,
102
+ "site_id": 123,
103
+ "title": "This title \"has\" escaped quotes",
104
+ "state": "complete",
105
+ "result": "failed",
106
+ "start_uri": "/",
107
+ "description": "This description \"contains\" escaped\ncharacters",
108
+ "run_mode": "default",
109
+ "updated_at": "2016-06-21T10:54:51.771Z",
110
+ "editable": false,
111
+ "browsers": [
112
+ {
113
+ "id": 1790916,
114
+ "created_at": "2016-06-21T09:40:40Z",
115
+ "name": "osx_firefox_1440_900",
116
+ "description": "Firefox on OS X Mavericks (1440x900)",
117
+ "category": "browser",
118
+ "result": "failed",
119
+ "state": "complete"
120
+ }
121
+ ],
122
+ "step_count": 9,
123
+ "frontend_url": "https://app.rainforestqa.com/runs/12345/tests/4",
124
+ "current_progress": {
125
+ "percent": 100,
126
+ "total": 1,
127
+ "complete": 1
128
+ }
129
+ }
130
+ ]