Skip to content

Commit

Permalink
Named job flags
Browse files Browse the repository at this point in the history
  • Loading branch information
joroshiba committed Jun 26, 2018
1 parent 6c8775b commit 850e16b
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 850e16b

Please sign in to comment.