Skip to content

Commit

Permalink
Add merge request support for Gitlab CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
afinetooth committed Apr 13, 2021
1 parent 7e74dad commit 2f17266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/coveralls/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def self.set_service_params_for_gitlab(config)
config[:service_job_number] = ENV['CI_BUILD_NAME']
config[:service_job_id] = ENV['CI_BUILD_ID']
config[:service_branch] = ENV['CI_BUILD_REF_NAME']
config[:service_pull_request] = ENV['CI_MERGE_REQUEST_IID']
config[:commit_sha] = ENV['CI_BUILD_REF']
end

Expand Down
3 changes: 3 additions & 0 deletions spec/coveralls/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,13 @@
let(:service_job_number) { "spec:one" }
let(:service_job_id) { 1234 }
let(:service_branch) { "feature" }
let(:service_pull_request) { "1" }

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_MERGE_REQUEST_IID').and_return(service_pull_request)
ENV.stub(:[]).with('CI_BUILD_REF').and_return(commit_sha)
end

Expand All @@ -239,6 +241,7 @@
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[:service_pull_request].should eq(service_pull_request)
config[:commit_sha].should eq(commit_sha)
end
end
Expand Down

0 comments on commit 2f17266

Please sign in to comment.