Skip to content

Commit

Permalink
Try renabling AED code coverage
Browse files Browse the repository at this point in the history
Work done for #196
  • Loading branch information
atruskie committed Mar 31, 2020
1 parent 2161ce3 commit e2a5a6b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
- if a `TimeSpan` needs to be formatted
- in a log: the default formatting is acceptable
- in a filename: use ISO8601 duration formatting
- New code or bug fixes must be covered by unit tests.
Our project has a historically bad relationship with unit testing and we want to try
and improve on this.

[![codecov](https://codecov.io/gh/QutEcoacoustics/audio-analysis/branch/master/graph/badge.svg)](https://codecov.io/gh/QutEcoacoustics/audio-analysis)

## Required Software

Expand Down
12 changes: 3 additions & 9 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ variables:

# Run on all commits, except for some folders
trigger:
batch: true
branches:
include:
- '*'
Expand All @@ -20,12 +21,5 @@ stages:
- stage: build
jobs:
- template: build/azure-pipelines-build.yml
# - stage: build
# jobs:
# - template: build/azure-pipelines-build.yml
# - stage: test
# jobs:
# - template: build/azure-pipelines-test.yml
# - stage: release
# jobs:
# - template: build/azure-pipelines-release.yml
#- stage: release

9 changes: 5 additions & 4 deletions build/azure-pipelines-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,12 @@ jobs:
projects: tests/AED.Test/AED.Test.fsproj
publishTestResults: true
testRunTitle: "AED.Test for ${{ platform.rid }} ${{ configuration }}"
# TODO: merge code coverage reports
#--collect:"XPlat Code Coverage" temporarily disabling code coverage because I can't work out to merge
# coverage reports
arguments: >
$(runtimeArgument)
--configuration ${{ configuration }}
--logger trx
--settings tests/AED.Test/.runsettings
--collect:"XPlat Code Coverage"
--
RunConfiguration.DisableAppDomain=true
displayName: Run AED.Test
Expand All @@ -163,12 +162,14 @@ jobs:
arguments: install --tool-path . dotnet-reportgenerator-globaltool
displayName: Install ReportGenerator tool

# e.g. /home/vsts/work/_temp/68a005a0-e79f-46ca-a524-52abd13b3678/coverage.cobertura.xml
# e.g. /home/vsts/work/1/s/coverlet/reports
- pwsh: >
./reportgenerator
-reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml
-targetdir:$(Build.SourcesDirectory)/coverlet/reports
-reporttypes:"Cobertura"
displayName: Create reports covertura reports
displayName: Create reports cobertura reports
- task: PublishCodeCoverageResults@1
inputs:
Expand Down
15 changes: 15 additions & 0 deletions tests/AED.Test/.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<RunConfiguration>
<ResultsDirectory>../../tests/Results</ResultsDirectory>
</RunConfiguration>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>json,cobertura,opencover</Format>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>

0 comments on commit e2a5a6b

Please sign in to comment.