codeclimate-test-reporter 1.0.4 → 1.0.5

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: 8288228e25163162b6b30325990ffbc7b5b665a2
4
- data.tar.gz: 65905735dfec5e174f58a603673f7f12814c36f7
3
+ metadata.gz: 0cab60d1204fbf2233dca7539b34c314c82d32ca
4
+ data.tar.gz: 6b0e7ede8cb1faaa6311f779eb06b080a4be6075
5
5
  SHA512:
6
- metadata.gz: b521cd941110f5cf514d272ce80c1f85da62058ac9f42ec6668bf96400893eba8f3d792cc20954fad4db622e6cbcd254a86e363f03866b2a4ee760f2d995c3fc
7
- data.tar.gz: f10dc131ba15d256e90bee8c482819b0801a800e28a9dc8b05f470108bbe3840f3082f85d516302e5c091b7863c0c44011391f80e6e5a42a0e38da0d53c2ebdf
6
+ metadata.gz: 51c10d62fc9f37856a4b5c9bb3e36a0b53d8db695f55bd979fbcf7f588ff4e3f6d70405d459888a7f17bd01b05ded0f0ecbb1101f6fe56cde7f0a71ce4e175b9
7
+ data.tar.gz: ba384c67984ae2f513bb621e94c949baded0df4335fee66abdb0798bf7b252da5b67ee50ec8e8efda6123add063a025bf9cb42d8bf535d73aba92f412b8545cf
data/bin/ci CHANGED
@@ -12,4 +12,4 @@ ruby -v
12
12
  bundle install
13
13
  bundle exec rake
14
14
 
15
- bundle exec codeclimate-test-reporter
15
+ CODECLIMATE_REPO_TOKEN=c4881e09870b0fac1291c93339b36ffe36210a2645c1ad25e52d8fda3943fb4d bundle exec codeclimate-test-reporter
@@ -70,6 +70,7 @@ module CodeClimate
70
70
  build_url: env["CI_BUILD_URL"],
71
71
  branch: env["CI_BRANCH"],
72
72
  commit_sha: env["CI_COMMIT_ID"],
73
+ committed_at: env["CI_COMMITED_AT"],
73
74
  }
74
75
  elsif env["CI_NAME"] =~ /VEXOR/i
75
76
  {
@@ -5,8 +5,8 @@ module CodeClimate
5
5
  def info
6
6
  {
7
7
  head: head,
8
- committed_at: committed_at,
9
- branch: branch_from_git,
8
+ committed_at: committed_at_from_git_or_ci,
9
+ branch: branch_from_git_or_ci,
10
10
  }
11
11
  end
12
12
 
@@ -14,6 +14,10 @@ module CodeClimate
14
14
  clean_service_branch || clean_git_branch || "master"
15
15
  end
16
16
 
17
+ def committed_at_from_git_or_ci
18
+ committed_at_from_git || committed_at_from_ci
19
+ end
20
+
17
21
  def clean_service_branch
18
22
  ci_branch = String(Ci.service_data[:branch])
19
23
  clean = ci_branch.strip.sub(%r{^origin/}, "")
@@ -34,7 +38,13 @@ module CodeClimate
34
38
  git("log -1 --pretty=format:'%H'")
35
39
  end
36
40
 
37
- def committed_at
41
+ def committed_at_from_ci
42
+ if (value = Ci.service_data[:committed_at])
43
+ value.to_i
44
+ end
45
+ end
46
+
47
+ def committed_at_from_git
38
48
  committed_at = git("log -1 --pretty=format:%ct")
39
49
  committed_at.to_i.zero? ? nil : committed_at.to_i
40
50
  end
@@ -27,7 +27,8 @@ module CodeClimate
27
27
  end
28
28
 
29
29
  def committed_at
30
- @payload[:git] && @payload[:git][:committed_at]
30
+ (@payload[:git] && @payload[:git][:committed_at]) ||
31
+ (@payload[:ci_service] && @payload[:ci_service][:committed_at])
31
32
  end
32
33
 
33
34
  def run_at
@@ -1,5 +1,5 @@
1
1
  module CodeClimate
2
2
  module TestReporter
3
- VERSION = "1.0.4".freeze
3
+ VERSION = "1.0.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeclimate-test-reporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Helmkamp
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-12-29 00:00:00.000000000 Z
12
+ date: 2017-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simplecov