Generate Cobertura coverage data for Azure Pipelines
These can be used and displayed directly in the Azure Pipelines GUI. It may not end up replacing CodeCov but it's easy enough so: why not.
This commit is contained in:
parent
9b84b2404a
commit
100e85dda1
@ -17,4 +17,5 @@ end
|
|||||||
group :coverage do
|
group :coverage do
|
||||||
gem "codecov", require: false
|
gem "codecov", require: false
|
||||||
gem "simplecov", require: false
|
gem "simplecov", require: false
|
||||||
|
gem "simplecov-cobertura", require: false
|
||||||
end
|
end
|
||||||
|
|||||||
@ -59,6 +59,8 @@ GEM
|
|||||||
docile (~> 1.1)
|
docile (~> 1.1)
|
||||||
json (>= 1.8, < 3)
|
json (>= 1.8, < 3)
|
||||||
simplecov-html (~> 0.10.0)
|
simplecov-html (~> 0.10.0)
|
||||||
|
simplecov-cobertura (1.3.0)
|
||||||
|
simplecov (~> 0.8)
|
||||||
simplecov-html (0.10.2)
|
simplecov-html (0.10.2)
|
||||||
unicode-display_width (1.4.0)
|
unicode-display_width (1.4.0)
|
||||||
url (0.3.2)
|
url (0.3.2)
|
||||||
@ -77,6 +79,7 @@ DEPENDENCIES
|
|||||||
rubocop (= 0.59.1)
|
rubocop (= 0.59.1)
|
||||||
rubocop-rspec
|
rubocop-rspec
|
||||||
simplecov
|
simplecov
|
||||||
|
simplecov-cobertura
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
1.16.4
|
1.16.4
|
||||||
|
|||||||
@ -8,6 +8,11 @@ if ENV["HOMEBREW_TESTS_COVERAGE"]
|
|||||||
ENV["CODECOV_TOKEN"] = ENV["HOMEBREW_CODECOV_TOKEN"]
|
ENV["CODECOV_TOKEN"] = ENV["HOMEBREW_CODECOV_TOKEN"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if ENV["HOMEBREW_AZURE_PIPELINES"]
|
||||||
|
require "simplecov-cobertura"
|
||||||
|
formatters << SimpleCov::Formatter::CoberturaFormatter
|
||||||
|
end
|
||||||
|
|
||||||
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
|
SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(formatters)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,14 @@ jobs:
|
|||||||
testRunner: JUnit
|
testRunner: JUnit
|
||||||
testResultsFiles: brew-test-bot.xml
|
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
|
- job: Linux
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-16.04
|
vmImage: ubuntu-16.04
|
||||||
@ -31,3 +39,10 @@ jobs:
|
|||||||
displayName: Run brew test-bot
|
displayName: Run brew test-bot
|
||||||
env:
|
env:
|
||||||
HOMEBREW_GITHUB_API_TOKEN: $(github.publicApiToken)
|
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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user