rainforest-cli 0.0.3 → 0.0.4
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.
- data/.rspec +2 -1
- data/lib/rainforest/cli.rb +2 -1
- data/lib/rainforest/cli/options.rb +8 -0
- data/lib/rainforest/cli/version.rb +1 -1
- data/spec/options_spec.rb +5 -0
- metadata +2 -2
data/.rspec
CHANGED
data/lib/rainforest/cli.rb
CHANGED
@@ -29,7 +29,8 @@ module Rainforest
|
|
29
29
|
sleep 5
|
30
30
|
response = get "#{API_URL}/#{run_id}"
|
31
31
|
if %w(queued in_progress sending_webhook waiting_for_callback).include?(response["state"])
|
32
|
-
puts "Run #{run_id} is still running: #{response['current_progress']['percent']}% complete
|
32
|
+
puts "Run #{run_id} is still running: #{response['current_progress']['percent']}% complete and has #{response["result"]}"
|
33
|
+
running = false if response["result"] == 'failed' && @options.failfast?
|
33
34
|
else
|
34
35
|
puts "Run #{run_id} is now #{response["state"]} and has #{response["result"]}"
|
35
36
|
running = false
|
@@ -14,6 +14,10 @@ module Rainforest
|
|
14
14
|
@foreground = value
|
15
15
|
end
|
16
16
|
|
17
|
+
opts.on("--fail-fast", String, "Fail as soon as there is a failure (don't wait for completion)") do |value|
|
18
|
+
@failfast = true
|
19
|
+
end
|
20
|
+
|
17
21
|
opts.on("--token TOKEN", String, "Your rainforest API token.") do |value|
|
18
22
|
@token = value
|
19
23
|
end
|
@@ -35,6 +39,10 @@ module Rainforest
|
|
35
39
|
@tests
|
36
40
|
end
|
37
41
|
|
42
|
+
def failfast?
|
43
|
+
@failfast
|
44
|
+
end
|
45
|
+
|
38
46
|
def foreground?
|
39
47
|
@foreground
|
40
48
|
end
|
data/spec/options_spec.rb
CHANGED
@@ -28,4 +28,9 @@ describe Rainforest::Cli::OptionParser do
|
|
28
28
|
let(:args) { ["run", "--conflict", "abort", "all"] }
|
29
29
|
its(:conflict) { should == "abort"}
|
30
30
|
end
|
31
|
+
|
32
|
+
context "it parses the fail-fast flag" do
|
33
|
+
let(:args) { ["run", "--fail-fast"] }
|
34
|
+
its(:failfast?) { should be_true }
|
35
|
+
end
|
31
36
|
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: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-08-
|
13
|
+
date: 2013-08-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|