diff --git a/lib/coveralls/configuration.rb b/lib/coveralls/configuration.rb index ffcc4413..09bcb9ab 100644 --- a/lib/coveralls/configuration.rb +++ b/lib/coveralls/configuration.rb @@ -89,7 +89,6 @@ def self.set_service_params_for_tddium(config) def self.set_service_params_for_gitlab(config) config[:service_name] = 'gitlab-ci' - config[:service_number] = ENV['CI_BUILD_REF'][0..5] config[:service_job_number] = ENV['CI_BUILD_NAME'] config[:service_job_id] = ENV['CI_BUILD_ID'] config[:service_branch] = ENV['CI_BUILD_REF_NAME'] diff --git a/lib/coveralls/version.rb b/lib/coveralls/version.rb index 7014aa3a..8f4aa3ee 100644 --- a/lib/coveralls/version.rb +++ b/lib/coveralls/version.rb @@ -1,3 +1,3 @@ module Coveralls - VERSION = "0.8.11" + VERSION = "0.8.12" end diff --git a/spec/coveralls/configuration_spec.rb b/spec/coveralls/configuration_spec.rb index ebc62f20..45755a88 100644 --- a/spec/coveralls/configuration_spec.rb +++ b/spec/coveralls/configuration_spec.rb @@ -193,6 +193,30 @@ end end + describe '.set_service_params_for_gitlab' do + let(:commit_sha) { SecureRandom.hex(32) } + let(:service_job_number) { "spec:one" } + let(:service_job_id) { 1234 } + let(:service_branch) { "feature" } + + before do + ENV.stub(:[]).with('CI_BUILD_NAME').and_return(service_job_number) + ENV.stub(:[]).with('CI_BUILD_ID').and_return(service_job_id) + ENV.stub(:[]).with('CI_BUILD_REF_NAME').and_return(service_branch) + ENV.stub(:[]).with('CI_BUILD_REF').and_return(commit_sha) + end + + it 'should set the expected parameters' do + config = {} + Coveralls::Configuration.set_service_params_for_gitlab(config) + config[:service_name].should eq('gitlab-ci') + config[:service_job_number].should eq(service_job_number) + config[:service_job_id].should eq(service_job_id) + config[:service_branch].should eq(service_branch) + config[:commit_sha].should eq(commit_sha) + end + end + describe '.set_service_params_for_semaphore' do let(:semaphore_build_num) { SecureRandom.hex(4) } before do