build_log_parser 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e7bc3c47b1f6e7bf65547ab0542c9a1295153043
4
- data.tar.gz: 106338d3a1c8481784f0c4b869978920c3a45710
3
+ metadata.gz: 6135dc6a2614063bf61d60eea8ed6f4c361edda2
4
+ data.tar.gz: 85d4a91676c15af3227f70bc5a054fdca7de041a
5
5
  SHA512:
6
- metadata.gz: a762bf3aefffba2089e8c69a34f121e9d80daffddd62f73b84aa8b3843daf541439141e38878cfbb74b0097daaa3789b2998122f2a7805c15623b5e1affda382
7
- data.tar.gz: 70e5cc9525a37138e17c0567f4376afdac2e91ee6d693655271c35dc72548cda5121397352c3bdd3c8ea2852775cd0bab845265f85b881239dedd36a3e59b00a
6
+ metadata.gz: 4467613878d1b843092ef77e8b0e9fa642be5cabfed2fc87972d18ac733116a77250c4d804a3b71583ab6fac8af5df404938fa472a5ba8d3f195662ea2de4873
7
+ data.tar.gz: ead30fdb85456168fc0e05e7fc16b0bf0c3c76fa6663f62d90a76cc5a4569939b5a858b9d9f3f0cc7b28a1497fb6d89689f83ac2e700acbcaf4509acb28205fb
@@ -5,7 +5,8 @@ module BuildLogParser
5
5
  /^finished tests in ([\d]\.[\d]+s),/i,
6
6
  /ran [\d]+ tests in (.*)\n?/i,
7
7
  /time: (.*), memory:/i,
8
- /[\d]+ passing (.*)/
8
+ /[\d]+ passing (.*)/,
9
+ /executed [\d]+ of [\d]+ [\w]+ \(([\d\.]+ [\w]+) /i
9
10
  ]
10
11
 
11
12
  def fetch_duration(str)
@@ -21,6 +22,7 @@ module BuildLogParser
21
22
  scan(pattern).
22
23
  flatten.
23
24
  map { |m| ChronicDuration.parse(m) }.
25
+ compact.
24
26
  reduce(:+)
25
27
  end
26
28
  end
@@ -1,8 +1,8 @@
1
- require "build_log_parser/duration_matcher"
2
- require "build_log_parser/coverage_matcher"
3
- require "build_log_parser/rspec_matcher"
4
- require "build_log_parser/test_unit_matcher"
5
- require "build_log_parser/phpunit_matcher"
1
+ require "build_log_parser/matchers/duration_matcher"
2
+ require "build_log_parser/matchers/coverage_matcher"
3
+ require "build_log_parser/matchers/rspec_matcher"
4
+ require "build_log_parser/matchers/test_unit_matcher"
5
+ require "build_log_parser/matchers/phpunit_matcher"
6
6
 
7
7
  module BuildLogParser
8
8
  class Parser
@@ -1,3 +1,3 @@
1
1
  module BuildLogParser
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/spec/fixtures/js.txt CHANGED
@@ -1 +1,13 @@
1
- JS 1.9.7 (Linux): Executed 202 of 202 SUCCESS (12.156 secs / 11.47 secs)
1
+ PhantomJS 1.9.7 (Linux): Executed 1 of 11 SUCCESS (0 secs / 0 secs)
2
+ JS 1.9.7 (Linux): Executed 2 of 11 SUCCESS (0 secs / 0 secs)
3
+ JS 1.9.7 (Linux): Executed 3 of 11 SUCCESS (0 secs / 0 secs)
4
+ JS 1.9.7 (Linux): Executed 4 of 11 SUCCESS (0 secs / 0 secs)
5
+ JS 1.9.7 (Linux): Executed 5 of 11 SUCCESS (0 secs / 0 secs)
6
+ JS 1.9.7 (Linux): Executed 6 of 11 SUCCESS (0 secs / 0.5 secs)
7
+ JS 1.9.7 (Linux): Executed 7 of 11 SUCCESS (0 secs / 0.5 secs)
8
+ JS 1.9.7 (Linux): Executed 8 of 11 SUCCESS (0 secs / 0.5 secs)
9
+ JS 1.9.7 (Linux): Executed 9 of 11 SUCCESS (0 secs / 0.5 secs)
10
+ JS 1.9.7 (Linux): Executed 10 of 11 SUCCESS (0 secs / 0.502 secs)
11
+ PhantomJS 1.9.7 (Linux): Executed 10 of 11 SUCCESS (0 secs / 0.502 secs)
12
+ JS 1.9.7 (Linux): Executed 11 of 11 SUCCESS (0 secs / 0.505 secs)
13
+ JS 1.9.7 (Linux): Executed 11 of 11 SUCCESS (0.886 secs / 0.505 secs)
@@ -143,7 +143,8 @@ describe BuildLogParser::Parser do
143
143
  [ "Time: 01:50, Memory: 113.00Mb", 110.00 ],
144
144
  [ "Finished tests in 8.071688s, 3.8406 tests/s, 9.4156 assertions/s.", 8.071688 ],
145
145
  [ "Finished in 10.8 seconds (3.1s on load, 7.7s on tests)", 10.8 ],
146
- [ "80 passing (347ms)", 0.347 ]
146
+ [ "80 passing (347ms)", 0.347 ],
147
+ [ "JS 1.9.7 (Linux): Executed 202 of 202 SUCCESS (12.156 secs / 11.47 secs)", 12.156 ]
147
148
  ]
148
149
  end
149
150
 
@@ -162,6 +163,14 @@ describe BuildLogParser::Parser do
162
163
  end
163
164
  end
164
165
 
166
+ context "with multiple js entries" do
167
+ let(:log) { fixture "js.txt" }
168
+
169
+ it "returns total duration" do
170
+ expect(result).to eq 0.886
171
+ end
172
+ end
173
+
165
174
  context "with phpunit data" do
166
175
  let(:log) { fixture "phpunit.txt" }
167
176
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build_log_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Sosedoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-23 00:00:00.000000000 Z
11
+ date: 2014-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -81,12 +81,12 @@ files:
81
81
  - Rakefile
82
82
  - build_log_parser.gemspec
83
83
  - lib/build_log_parser.rb
84
- - lib/build_log_parser/coverage_matcher.rb
85
- - lib/build_log_parser/duration_matcher.rb
84
+ - lib/build_log_parser/matchers/coverage_matcher.rb
85
+ - lib/build_log_parser/matchers/duration_matcher.rb
86
+ - lib/build_log_parser/matchers/phpunit_matcher.rb
87
+ - lib/build_log_parser/matchers/rspec_matcher.rb
88
+ - lib/build_log_parser/matchers/test_unit_matcher.rb
86
89
  - lib/build_log_parser/parser.rb
87
- - lib/build_log_parser/phpunit_matcher.rb
88
- - lib/build_log_parser/rspec_matcher.rb
89
- - lib/build_log_parser/test_unit_matcher.rb
90
90
  - lib/build_log_parser/version.rb
91
91
  - spec/fixtures/js.txt
92
92
  - spec/fixtures/phpunit.txt