rainforest-cli 1.12.5 → 1.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/rainforest_cli/runner.rb +10 -13
- data/lib/rainforest_cli/version.rb +1 -1
- data/spec/rainforest_cli/runner_spec.rb +57 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab9a261f140208e59dd4a9e912dc976a64ae772c
|
4
|
+
data.tar.gz: de8727af6393a26c55ffac08927edd03d5b3c03f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8f303a75ca6e391126fb5e9a52d33fac4c022f346657a0267b2516dec220c16152ebe93e69d4b30ad69bc3b41381fa1c99db4ab17298bece05676b7c59de7d55
|
7
|
+
data.tar.gz: 4fb2564cc6757cd8bab4fcf95f29aa7263bc89429d6acd461a852f34635f8d6a4f933565052793917fd1c95e5e770eee844aa79a5616a980522d3f7a2fc9ae9b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Rainforest CLI Changelog
|
2
2
|
|
3
|
+
## 1.12.6 - 12th July 2017
|
4
|
+
- Fixed an issue where the process was exiting with exit code 0 regardless of a
|
5
|
+
run's final result when using the `--wait` flag.
|
6
|
+
(6c851badfaaadeccfb18a0a20278810bbe2d5335, @epaulet)
|
7
|
+
|
3
8
|
## 1.12.5 - 7th March 2017
|
4
9
|
- Include site ID for exported tests.
|
5
10
|
(1816af9406013ac7594765822f73066adf332cf1, @epaulet)
|
@@ -35,18 +35,7 @@ module RainforestCli
|
|
35
35
|
logger.info "Issued run #{run_id}"
|
36
36
|
|
37
37
|
if options.foreground?
|
38
|
-
|
39
|
-
if options.junit_file?
|
40
|
-
reporter = Reporter.new(options)
|
41
|
-
reporter.run_id = run_id
|
42
|
-
reporter.report
|
43
|
-
end
|
44
|
-
|
45
|
-
if response['result'] != 'passed'
|
46
|
-
exit 1
|
47
|
-
end
|
48
|
-
else
|
49
|
-
true
|
38
|
+
wait_for_run_completion(run_id)
|
50
39
|
end
|
51
40
|
end
|
52
41
|
|
@@ -70,7 +59,15 @@ module RainforestCli
|
|
70
59
|
logger.info "The detailed results are available at #{response['frontend_url']}"
|
71
60
|
end
|
72
61
|
|
73
|
-
|
62
|
+
if options.junit_file?
|
63
|
+
reporter = Reporter.new(options)
|
64
|
+
reporter.run_id = run_id
|
65
|
+
reporter.report
|
66
|
+
end
|
67
|
+
|
68
|
+
if response['result'] != 'passed'
|
69
|
+
exit 1
|
70
|
+
end
|
74
71
|
end
|
75
72
|
|
76
73
|
def make_create_run_options
|
@@ -113,4 +113,61 @@ describe RainforestCli::Runner do
|
|
113
113
|
end
|
114
114
|
end
|
115
115
|
|
116
|
+
describe '#wait_for_run_completion' do
|
117
|
+
context 'run reaches final state' do
|
118
|
+
let(:run_id) { 123 }
|
119
|
+
let(:final_run_response) do
|
120
|
+
{
|
121
|
+
'id' => run_id,
|
122
|
+
'state' => state,
|
123
|
+
'result' => result,
|
124
|
+
'state_details' => {
|
125
|
+
'is_final_state' => true,
|
126
|
+
},
|
127
|
+
}
|
128
|
+
end
|
129
|
+
|
130
|
+
before do
|
131
|
+
allow_any_instance_of(RainforestCli::HttpClient).to receive(:get)
|
132
|
+
.with("/runs/#{run_id}", {}, retries_on_failures: true)
|
133
|
+
.and_return(final_run_response)
|
134
|
+
end
|
135
|
+
|
136
|
+
context 'run passes' do
|
137
|
+
let(:state) { 'complete' }
|
138
|
+
let(:result) { 'passed' }
|
139
|
+
|
140
|
+
it 'returns without exiting' do
|
141
|
+
expect { subject.wait_for_run_completion(run_id) }.to_not raise_error
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
context 'run fails' do
|
146
|
+
let(:state) { 'complete' }
|
147
|
+
let(:result) { 'failed' }
|
148
|
+
|
149
|
+
it 'exits 1' do
|
150
|
+
expect { subject.wait_for_run_completion(run_id) }.to raise_error(SystemExit)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
context 'run encounters an error' do
|
155
|
+
let(:state) { 'error' }
|
156
|
+
let(:result) { 'no_result' }
|
157
|
+
|
158
|
+
it 'exits 1' do
|
159
|
+
expect { subject.wait_for_run_completion(run_id) }.to raise_error(SystemExit)
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
context 'run is aborted' do
|
164
|
+
let(:state) { 'aborted' }
|
165
|
+
let(:result) { 'no_result' }
|
166
|
+
|
167
|
+
it 'exits 1' do
|
168
|
+
expect { subject.wait_for_run_completion(run_id) }.to raise_error(SystemExit)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
end
|
172
|
+
end
|
116
173
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rainforest-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.12.
|
4
|
+
version: 1.12.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Russell Smith
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-07-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: httparty
|
@@ -347,4 +347,3 @@ test_files:
|
|
347
347
|
- spec/validation-examples/parse_errors/no_question_mark.rfml
|
348
348
|
- spec/validation-examples/parse_errors/no_rfml_id.rfml
|
349
349
|
- spec/validation-examples/parse_errors/no_title.rfml
|
350
|
-
has_rdoc:
|