diff --git a/.gitignore b/.gitignore index 7e4c52560..ed6772d69 100644 --- a/.gitignore +++ b/.gitignore @@ -122,7 +122,8 @@ _rawPackage/ _dotTrace* _tests/ *.Result.xml -coverage.xml +coverage*.xml +coverage*.json setup/Output/ *.~is diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 856740503..9c78dfe27 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -341,4 +341,4 @@ stages: displayName: Publish Coverage Results inputs: codeCoverageTool: 'cobertura' - summaryFileLocation: '**/Coverage.xml' \ No newline at end of file + summaryFileLocation: '**/coverage.cobertura.xml' \ No newline at end of file diff --git a/test.sh b/test.sh index abc1b5a73..f607d4d45 100755 --- a/test.sh +++ b/test.sh @@ -9,6 +9,8 @@ ASSEMBLIES="" TEST_LOG_FILE="TestLog.txt" COVERAGE_FILE="$TEST_DIR/Coverage.xml" +dotnet tool install --global coverlet.console + if [ -d "$TEST_DIR/_tests" ]; then TEST_DIR="$TEST_DIR/_tests" fi @@ -19,7 +21,7 @@ rm -f "$TEST_LOG_FILE" export LIDARR_TESTS_LOG_OUTPUT="File" NUNIT="$TEST_DIR/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe" -OPEN_COVER="$TEST_DIR/OpenCover.4.7.922/tools/OpenCover.Console.exe" +OPEN_COVER="coverlet" NUNIT_COMMAND="$NUNIT" NUNIT_PARAMS="--workers=1" @@ -58,7 +60,7 @@ done if [ "$COVERAGE" = "Coverage" ]; then if [ "$PLATFORM" = "Windows" ] ; then - $OPEN_COVER -register:user -target:"$NUNIT" -targetargs:"$NUNIT_PARAMS --where=\"$WHERE\" $ASSEMBLIES" -output:"$COVERAGE_FILE"; + $OPEN_COVER ./_tests/Lidarr.Core.Test --format "cobertura" --target "$NUNIT" --targetargs "$NUNIT_PARAMS --where=\"$WHERE\" $ASSEMBLIES"; EXIT_CODE=$? else echo "Coverage only supported on Windows"