coveralls-lcov 1.6.0 → 1.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5947e0da86ee418e01885e3ffa90560160da8f408921a4fea674808d0479f448
4
- data.tar.gz: 5d87045b77103b3061b889ed3a4ca485e252866cb154defe331613158c071e44
3
+ metadata.gz: ecff8406287e594bd44a2a6e519dea024a2d22fac3cb4e6639ddebd9540aa738
4
+ data.tar.gz: d3860be529759a2c33c4c0642a2a8498274e611a5cb2be8fb9357bc7ccb15cc1
5
5
  SHA512:
6
- metadata.gz: 59e6f65330738325d79eacd9496a7637a4264a223c009ccaf8d64f628c2974159187005d0f83ffaeec196b06721ba70faa01cc0fc2ac6899e5a41b8c40a66213
7
- data.tar.gz: d56f7e7f880e8cd9211b50d981efb3afc3e2d48701cf8af9d416ce12c7f9c083bdd9e9f424e6afe43e0ae08f7378ed7b7c57a816bd491ce78208f9cf8a2b6762
6
+ metadata.gz: ad739f55ad21ed4d1ea62ab01a0e06c28d22e777429efa6c3c1179f6022cc47fb0d26ce739f7010ad570431ba61aba9b522fbae7caafb0bfcf897f2b64d19d7e
7
+ data.tar.gz: 8cbfb33e126ea010121f4a86af5b655d7c1435f779d3be277440584539db8afd35370bd47495dc13fd098ffc85b7b01f51be45066b7e4d00eed0998f3d5c359b
data/README.md CHANGED
@@ -72,6 +72,25 @@ after_success:
72
72
 
73
73
  See also lcovrc(5).
74
74
 
75
+ ## Available command line flags
76
+
77
+ Flag | Description
78
+ --- | ---
79
+ `-t` `--repo-token=TOKEN` | The secret token for your repository, found at the bottom of your repository’s page on Coveralls.
80
+ `-s` `--service_name=SERVICE` | The CI service or other environment in which the test suite was run. This can be anything, but certain services have special features (travis-ci, travis-pro, or coveralls-ruby).
81
+ `--service-job-id=JOB_ID` | A unique identifier of the job on the service specified by service_name.
82
+ `-b` `--branch=BRANCH` | The current Git branch to be reported to Coveralls (not needed for Travis or if `git rev-parse` properly reports the branch).
83
+ `--service-pull-request=PULL_REQUEST` | The associated pull request ID of the build. Used for updating the status and/or commenting.
84
+ `--flag-name=FLAG_NAME` | If this is set, the job being reported will be named in the view and have it’s own independent status reported to your VCS provider.
85
+ `--retry=N` | Retries sending coverage data on failure to Coveralls N times (default: 3)
86
+ `--delay=N` | Delays the next retry by N seconds (default: 3)
87
+ `--source-encoding=ENCODING` | The encoding of the source file (default: UTF-8)
88
+ `-v` `--verbose` | Prints debug information like the HTTP request payload.
89
+ `-n` `--dry-run` | Converts coverage data and optionally prints coverage data in verbose mode, but does not send it to Coveralls.
90
+ `-h` `--host=HOST` | Host of Coveralls endpoint (default: coveralls.io)
91
+ `-p` `--port=PORT` | Post of Coveralls endpoint (default: 443)
92
+ `--[no]ssl` | Use SSL for connecting to Coveralls (default)
93
+
75
94
  ## Contributing
76
95
 
77
96
  1. Fork it ( http://github.com/okkez/coveralls-lcov/fork )
@@ -2,11 +2,12 @@
2
2
  module Coveralls
3
3
  module Lcov
4
4
  class Converter
5
- def initialize(tracefile, source_encoding = Encoding::UTF_8, service_name = "travis-ci", service_job_id = nil)
5
+ def initialize(tracefile, source_encoding = Encoding::UTF_8, service_name = "travis-ci", service_job_id = nil, branch = nil)
6
6
  @tracefile = tracefile
7
7
  @source_encoding = source_encoding
8
8
  @service_name = service_name
9
9
  @service_job_id = service_job_id
10
+ @branch = branch
10
11
  end
11
12
 
12
13
  def convert
@@ -97,7 +98,7 @@ module Coveralls
97
98
  message: `git log -1 --format=%s`,
98
99
  },
99
100
  remotes: [], # FIXME need this?
100
- branch: ENV["TRAVIS_BRANCH"] || `git rev-parse --abbrev-ref HEAD`,
101
+ branch: @branch || ENV["TRAVIS_BRANCH"] || `git rev-parse --abbrev-ref HEAD`,
101
102
  }
102
103
  end
103
104
 
@@ -19,6 +19,9 @@ module Coveralls
19
19
  @source_encoding = Encoding::UTF_8
20
20
  @service_name = "travis-ci"
21
21
  @service_job_id = nil
22
+ @branch = nil
23
+ @service_pull_request = nil
24
+ @flag_name = nil
22
25
  @verbose = false
23
26
  @dry_run = false
24
27
  @host = "coveralls.io"
@@ -41,6 +44,15 @@ BANNER
41
44
  @parser.on("--service-job-id=JOB_ID", "Service job id. ex. TRAVIS_JOB_ID") do |service_job_id|
42
45
  @service_job_id = service_job_id
43
46
  end
47
+ @parser.on("-b", "--branch=BRANCH", "The current Git branch. ex. TRAVIS_BRANCH") do |branch|
48
+ @branch = branch
49
+ end
50
+ @parser.on("--service-pull-request=PULL_REQUEST", "Service pull request number. ex. TRAVIS_PULL_REQUEST") do |service_pull_request|
51
+ @service_pull_request = service_pull_request
52
+ end
53
+ @parser.on("--flag-name=FLAG_NAME", "Flag name. ex. \"domain_layer\"") do |flag_name|
54
+ @flag_name = flag_name
55
+ end
44
56
  @parser.on("--retry=N", Integer, "Retry to POST N times (default: 3)") do |n_times|
45
57
  @n_times = n_times
46
58
  end
@@ -76,7 +88,7 @@ BANNER
76
88
  exit false
77
89
  end
78
90
  tracefile = @argv.shift
79
- converter = Converter.new(tracefile, @source_encoding, @service_name, @service_job_id)
91
+ converter = Converter.new(tracefile, @source_encoding, @service_name, @service_job_id, @branch)
80
92
  payload = converter.convert
81
93
  coveralls_config = YAML.load_file(".coveralls.yml") if File.exist? ".coveralls.yml"
82
94
  if @repo_token
@@ -84,6 +96,12 @@ BANNER
84
96
  elsif coveralls_config && coveralls_config["repo_token"]
85
97
  payload[:repo_token] = coveralls_config["repo_token"]
86
98
  end
99
+ if @service_pull_request
100
+ payload[:service_pull_request] = @service_pull_request
101
+ end
102
+ if @flag_name
103
+ payload[:flag_name] = @flag_name
104
+ end
87
105
  payload[:parallel] = @parallel
88
106
  payload_json = payload.to_json
89
107
  puts payload_json if @verbose
@@ -1,5 +1,5 @@
1
1
  module Coveralls
2
2
  module Lcov
3
- VERSION = "1.6.0"
3
+ VERSION = "1.7.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coveralls-lcov
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenji Okimoto
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-15 00:00:00.000000000 Z
11
+ date: 2021-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -61,7 +61,7 @@ homepage: https://github.com/okkez/coveralls-lcov
61
61
  licenses:
62
62
  - MIT
63
63
  metadata: {}
64
- post_install_message:
64
+ post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths:
67
67
  - lib
@@ -76,8 +76,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  requirements: []
79
- rubygems_version: 3.1.2
80
- signing_key:
79
+ rubygems_version: 3.2.3
80
+ signing_key:
81
81
  specification_version: 4
82
82
  summary: Post coverage information to coveralls.io
83
83
  test_files: []