dotpretty 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dotpretty +1 -0
- data/lib/dotpretty/aggregator.rb +36 -3
- data/lib/dotpretty/parser.rb +19 -0
- data/lib/dotpretty/reporters/basic.rb +7 -0
- data/lib/dotpretty/reporters/json.rb +3 -0
- data/lib/dotpretty/reporters/progress.rb +7 -0
- data/lib/dotpretty/runner.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02a933610d0d442dae61cf120172123ab0a49f2b064a91564e56a3b87d421391
|
4
|
+
data.tar.gz: 59de42feb963165f9b095c854e5e5d544f2a5d853768ce704a6901d4ee56cee7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eed2de212ec74010573226d7c87e028bfc6e94f0c6c21f24ab0765462370d95ccea240fc1cf0d7e2dd1871ef6aea1444d000c64760f0337e2166145eb1960ac
|
7
|
+
data.tar.gz: ca522cd11c6da7ee7f0ebb2cf9d9516c9a09945334cf31e21488f4cb99de8542f01224173a2a390bc3066a62070961880bacd3bdeff3f7d6757a6710bd159f01
|
data/bin/dotpretty
CHANGED
data/lib/dotpretty/aggregator.rb
CHANGED
@@ -2,6 +2,7 @@ module Dotpretty
|
|
2
2
|
class Aggregator
|
3
3
|
|
4
4
|
BUILD_COMPLETED = /^Build completed/
|
5
|
+
BUILD_FAILED = /^Build FAILED.$/
|
5
6
|
TEST_FAILED = /^Failed/
|
6
7
|
TEST_PASSED = /^Passed/
|
7
8
|
TEST_SUMMARY = /^Total tests/
|
@@ -18,9 +19,11 @@ module Dotpretty
|
|
18
19
|
when :waiting
|
19
20
|
state_machine.trigger(:build_started)
|
20
21
|
when :build_in_progress
|
21
|
-
state_machine.trigger(:
|
22
|
+
state_machine.trigger(:received_build_input, input_line)
|
23
|
+
when :reading_build_failure_details
|
24
|
+
state_machine.trigger(:received_build_failure_details, input_line)
|
22
25
|
when :ready_to_run_tests
|
23
|
-
state_machine.trigger(:
|
26
|
+
state_machine.trigger(:received_input_line, input_line)
|
24
27
|
when :waiting_for_test_input
|
25
28
|
state_machine.trigger(:test_input_received, input_line)
|
26
29
|
when :waiting_for_failure_details
|
@@ -30,6 +33,24 @@ module Dotpretty
|
|
30
33
|
end
|
31
34
|
end
|
32
35
|
|
36
|
+
def parse_build_input(input_line)
|
37
|
+
if input_line.match(BUILD_COMPLETED)
|
38
|
+
state_machine.trigger(:build_completed)
|
39
|
+
elsif input_line.match(BUILD_FAILED)
|
40
|
+
state_machine.trigger(:build_failed)
|
41
|
+
else
|
42
|
+
state_machine.trigger(:received_build_input)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def determine_if_tests_started(input_line)
|
47
|
+
if input_line.match(TESTS_STARTED)
|
48
|
+
state_machine.trigger(:tests_started)
|
49
|
+
else
|
50
|
+
state_machine.trigger(:tests_did_not_start)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
33
54
|
def parse_test_input(input_line)
|
34
55
|
if input_line.match(TEST_PASSED)
|
35
56
|
match = input_line.match(/^Passed\s+(.+)$/)
|
@@ -52,6 +73,18 @@ module Dotpretty
|
|
52
73
|
reporter.build_started
|
53
74
|
end
|
54
75
|
|
76
|
+
def reset_build_failure_details
|
77
|
+
self.build_failure_details = []
|
78
|
+
end
|
79
|
+
|
80
|
+
def track_build_failure_details(input_line)
|
81
|
+
build_failure_details << input_line
|
82
|
+
end
|
83
|
+
|
84
|
+
def report_failing_build
|
85
|
+
reporter.build_failed(build_failure_details)
|
86
|
+
end
|
87
|
+
|
55
88
|
def track_failure_details(details)
|
56
89
|
current_failing_test[:details] << details.rstrip if details.rstrip != ""
|
57
90
|
end
|
@@ -99,7 +132,7 @@ module Dotpretty
|
|
99
132
|
|
100
133
|
private
|
101
134
|
|
102
|
-
attr_accessor :current_failing_test, :reporter
|
135
|
+
attr_accessor :build_failure_details, :current_failing_test, :reporter
|
103
136
|
|
104
137
|
end
|
105
138
|
end
|
data/lib/dotpretty/parser.rb
CHANGED
@@ -12,10 +12,25 @@ module Dotpretty
|
|
12
12
|
transition :build_started, :build_in_progress, :build_started
|
13
13
|
end
|
14
14
|
state :build_in_progress do
|
15
|
+
transition :received_build_input, :parsing_build_input
|
16
|
+
end
|
17
|
+
state :parsing_build_input do
|
18
|
+
on_entry :parse_build_input
|
15
19
|
transition :build_completed, :ready_to_run_tests, :build_completed
|
20
|
+
transition :build_failed, :reading_build_failure_details, :reset_build_failure_details
|
21
|
+
transition :received_build_input, :build_in_progress
|
22
|
+
end
|
23
|
+
state :reading_build_failure_details do
|
24
|
+
transition :received_build_failure_details, :reading_build_failure_details, :track_build_failure_details
|
25
|
+
transition :end_of_input, :done, :report_failing_build
|
16
26
|
end
|
17
27
|
state :ready_to_run_tests do
|
28
|
+
transition :received_input_line, :determining_if_tests_started
|
29
|
+
end
|
30
|
+
state :determining_if_tests_started do
|
31
|
+
on_entry :determine_if_tests_started
|
18
32
|
transition :tests_started, :waiting_for_test_input, :starting_tests
|
33
|
+
transition :tests_did_not_start, :ready_to_run_tests
|
19
34
|
end
|
20
35
|
state :waiting_for_test_input do
|
21
36
|
transition :test_input_received, :parsing_test_input
|
@@ -48,6 +63,10 @@ module Dotpretty
|
|
48
63
|
aggregator.parse_line(input_line)
|
49
64
|
end
|
50
65
|
|
66
|
+
def done_with_input
|
67
|
+
state_machine.trigger(:end_of_input)
|
68
|
+
end
|
69
|
+
|
51
70
|
private
|
52
71
|
|
53
72
|
attr_accessor :aggregator, :output, :state_machine
|
@@ -16,6 +16,13 @@ module Dotpretty
|
|
16
16
|
output.puts("")
|
17
17
|
end
|
18
18
|
|
19
|
+
def build_failed(failure_details)
|
20
|
+
output.puts("Build failed")
|
21
|
+
failure_details.each do |detail|
|
22
|
+
output.puts(detail)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
19
26
|
def starting_tests
|
20
27
|
output.puts("Starting test execution...")
|
21
28
|
end
|
@@ -17,6 +17,13 @@ module Dotpretty
|
|
17
17
|
output.puts("Build started")
|
18
18
|
end
|
19
19
|
|
20
|
+
def build_failed(failure_details)
|
21
|
+
output.puts("Build failed")
|
22
|
+
failure_details.each do |detail|
|
23
|
+
output.puts(detail)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
20
27
|
def show_test_summary(summary)
|
21
28
|
output.puts("")
|
22
29
|
output.puts("")
|
data/lib/dotpretty/runner.rb
CHANGED