Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Cobertura coverage data for Azure Pipelines #4922

Merged
merged 1 commit into from
Oct 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Library/Homebrew/test/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ end
group :coverage do
gem "codecov", require: false
gem "simplecov", require: false
gem "simplecov-cobertura", require: false
end
3 changes: 3 additions & 0 deletions Library/Homebrew/test/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ GEM
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-cobertura (1.3.0)
simplecov (~> 0.8)
simplecov-html (0.10.2)
unicode-display_width (1.4.0)
url (0.3.2)
Expand All @@ -77,6 +79,7 @@ DEPENDENCIES
rubocop (= 0.59.1)
rubocop-rspec
simplecov
simplecov-cobertura

BUNDLED WITH
1.16.4
5 changes: 5 additions & 0 deletions Library/Homebrew/test/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
ENV["CODECOV_TOKEN"] = ENV["HOMEBREW_CODECOV_TOKEN"]
end

if ENV["HOMEBREW_AZURE_PIPELINES"]
require "simplecov-cobertura"
formatters << SimpleCov::Formatter::CoberturaFormatter
end

SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
end

Expand Down
15 changes: 15 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
testRunner: JUnit
testResultsFiles: brew-test-bot.xml

- task: PublishCodeCoverageResults@1
displayName: Publish brew tests code coverage
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(Build.SourcesDirectory)/coverage/coverage.xml
reportDirectory: $(Build.SourcesDirectory)/coverage
failIfCoverageEmpty: true

- job: Linux
pool:
vmImage: ubuntu-16.04
Expand All @@ -31,3 +39,10 @@ jobs:
displayName: Run brew test-bot
env:
HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)

- task: PublishTestResults@2
displayName: Publish test-bot test results
condition: succeededOrFailed()
inputs:
testRunner: JUnit
testResultsFiles: brew-test-bot.xml