Skip to content

Commit

Permalink
Merge pull request #135 from bytewalls/add-named-job-flags
Browse files Browse the repository at this point in the history
Named job flags
  • Loading branch information
nickmerwin committed Jun 29, 2018
2 parents 73c345f + 850e16b commit ecece72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/coveralls/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def self.configuration
if ENV['COVERALLS_PARALLEL'] && ENV['COVERALLS_PARALLEL'] != "false"
config[:parallel] = true
end
if ENV['COVERALLS_FLAG_NAME']
config[:flag_name] = ENV['COVERALLS_FLAG_NAME']
end
if ENV['TRAVIS']
set_service_params_for_travis(config, yml ? yml['service_name'] : nil)
elsif ENV['CIRCLECI']
Expand Down
13 changes: 13 additions & 0 deletions spec/coveralls/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@
end
end

context 'flag_name in environment' do
let(:flag_name) { 'Test Flag' }

before do
ENV.stub(:[]).with('COVERALLS_FLAG_NAME').and_return(flag_name)
end

it 'pulls the flag name from the environment if set' do
config = Coveralls::Configuration.configuration
config[:flag_name].should eq(flag_name)
end
end

context 'Services' do
context 'with env based service name' do
let(:service_name) { 'travis-enterprise' }
Expand Down

0 comments on commit ecece72

Please sign in to comment.