mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-26 00:05:07 -07:00
coverage attempt
This commit is contained in:
parent
5f61fcfb49
commit
c630a585fa
4 changed files with 33 additions and 33 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -122,6 +122,7 @@ _rawPackage/
|
||||||
_dotTrace*
|
_dotTrace*
|
||||||
_tests/
|
_tests/
|
||||||
*.Result.xml
|
*.Result.xml
|
||||||
|
coverage.xml
|
||||||
setup/Output/
|
setup/Output/
|
||||||
*.~is
|
*.~is
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ stages:
|
||||||
inputs:
|
inputs:
|
||||||
targetType: 'filePath'
|
targetType: 'filePath'
|
||||||
filePath: ./test.sh
|
filePath: ./test.sh
|
||||||
arguments: Linux Unit
|
arguments: Linux Unit Test
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFormat: 'NUnit'
|
testResultsFormat: 'NUnit'
|
||||||
|
@ -197,7 +197,7 @@ stages:
|
||||||
inputs:
|
inputs:
|
||||||
targetType: 'filePath'
|
targetType: 'filePath'
|
||||||
filePath: ./test.sh
|
filePath: ./test.sh
|
||||||
arguments: Linux Integration
|
arguments: Linux Integration Test
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFormat: 'NUnit'
|
testResultsFormat: 'NUnit'
|
||||||
|
@ -221,7 +221,7 @@ stages:
|
||||||
inputs:
|
inputs:
|
||||||
targetType: 'filePath'
|
targetType: 'filePath'
|
||||||
filePath: ./test.sh
|
filePath: ./test.sh
|
||||||
arguments: Windows Unit
|
arguments: Windows Unit Test
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFormat: 'NUnit'
|
testResultsFormat: 'NUnit'
|
||||||
|
@ -253,14 +253,14 @@ stages:
|
||||||
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
|
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
|
||||||
- bash: |
|
- bash: |
|
||||||
ls -R ${BUILD_ARTIFACTSTAGINGDIRECTORY}
|
ls -R ${BUILD_ARTIFACTSTAGINGDIRECTORY}
|
||||||
mkdir -p .\\bin
|
mkdir -p ./bin
|
||||||
cp -R -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}\\bin\\Lidarr\\* .\\bin
|
cp -R -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Lidarr/* ./bin
|
||||||
- task: Bash@3
|
- task: Bash@3
|
||||||
displayName: Windows Integration Tests
|
displayName: Windows Integration Tests
|
||||||
inputs:
|
inputs:
|
||||||
targetType: 'filePath'
|
targetType: 'filePath'
|
||||||
filePath: ./test.sh
|
filePath: ./test.sh
|
||||||
arguments: Windows Integration
|
arguments: Windows Integration Test
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFormat: 'NUnit'
|
testResultsFormat: 'NUnit'
|
||||||
|
@ -284,7 +284,7 @@ stages:
|
||||||
inputs:
|
inputs:
|
||||||
targetType: 'filePath'
|
targetType: 'filePath'
|
||||||
filePath: ./test.sh
|
filePath: ./test.sh
|
||||||
arguments: Windows Automation
|
arguments: Windows Automation Test
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFormat: 'NUnit'
|
testResultsFormat: 'NUnit'
|
||||||
|
@ -308,17 +308,17 @@ stages:
|
||||||
inputs:
|
inputs:
|
||||||
targetType: 'filePath'
|
targetType: 'filePath'
|
||||||
filePath: ./test.sh
|
filePath: ./test.sh
|
||||||
arguments: Mac Unit
|
arguments: Mac Unit Test
|
||||||
- task: PublishTestResults@2
|
- task: PublishTestResults@2
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFormat: 'NUnit'
|
testResultsFormat: 'NUnit'
|
||||||
testResultsFiles: '**/TestResult.xml'
|
testResultsFiles: '**/TestResult.xml'
|
||||||
testRunTitle: 'macOS Unit Tests'
|
testRunTitle: 'macOS Unit Tests'
|
||||||
|
|
||||||
- job: Mac_Integration_Tests
|
- job: Unit_Test_Coverage
|
||||||
displayName: macOS Integration
|
displayName: Coverage
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'macOS-10.13'
|
vmImage: 'ubuntu-16.04'
|
||||||
steps:
|
steps:
|
||||||
- checkout: self
|
- checkout: self
|
||||||
- task: DownloadPipelineArtifact@2
|
- task: DownloadPipelineArtifact@2
|
||||||
|
@ -327,28 +327,14 @@ stages:
|
||||||
buildType: 'current'
|
buildType: 'current'
|
||||||
artifactName: Tests
|
artifactName: Tests
|
||||||
targetPath: $(testsFolder)
|
targetPath: $(testsFolder)
|
||||||
- task: DownloadPipelineArtifact@2
|
|
||||||
displayName: Download Build Artifact
|
|
||||||
inputs:
|
|
||||||
buildType: 'current'
|
|
||||||
artifactName: Lidarr
|
|
||||||
itemPattern: '**/Lidarr.**.osx.tar.gz'
|
|
||||||
targetPath: $(Build.ArtifactStagingDirectory)
|
|
||||||
- task: ExtractFiles@1
|
|
||||||
inputs:
|
|
||||||
archiveFilePatterns: '$(Build.ArtifactStagingDirectory)/**/Lidarr.**.osx.tar.gz'
|
|
||||||
destinationFolder: '$(Build.ArtifactStagingDirectory)/bin'
|
|
||||||
- bash: |
|
|
||||||
mkdir ./bin
|
|
||||||
cp -R -v ${BUILD_ARTIFACTSTAGINGDIRECTORY}/bin/Lidarr/* ./bin
|
|
||||||
- task: Bash@3
|
- task: Bash@3
|
||||||
displayName: macOS Integration Tests
|
displayName: Coverage Unit Tests
|
||||||
inputs:
|
inputs:
|
||||||
targetType: 'filePath'
|
targetType: 'filePath'
|
||||||
filePath: ./test.sh
|
filePath: ./test.sh
|
||||||
arguments: Mac Integration
|
arguments: Linux Unit Coverage
|
||||||
- task: PublishTestResults@2
|
- task: PublishCodeCoverageResults@1
|
||||||
|
displayName: Publish Coverage Results
|
||||||
inputs:
|
inputs:
|
||||||
testResultsFormat: 'NUnit'
|
codeCoverageTool: 'cobertura'
|
||||||
testResultsFiles: '**/TestResult.xml'
|
summaryFileLocation: '**/Coverage.xml'
|
||||||
testRunTitle: 'macOS Integration Tests'
|
|
2
build.sh
2
build.sh
|
@ -261,8 +261,10 @@ PackageTests()
|
||||||
|
|
||||||
if [ $runtime = "dotnet" ] ; then
|
if [ $runtime = "dotnet" ] ; then
|
||||||
$nuget install NUnit.ConsoleRunner -Version 3.7.0 -Output $testPackageFolder
|
$nuget install NUnit.ConsoleRunner -Version 3.7.0 -Output $testPackageFolder
|
||||||
|
$nuget install OpenCover -Version 4.7.922 -Output $testPackageFolder
|
||||||
else
|
else
|
||||||
mono $nuget install NUnit.ConsoleRunner -Version 3.7.0 -Output $testPackageFolder
|
mono $nuget install NUnit.ConsoleRunner -Version 3.7.0 -Output $testPackageFolder
|
||||||
|
mono $nuget install OpenCover -Version 4.7.922 -Output $testPackageFolder
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp $outputFolder/*.dll $testPackageFolder
|
cp $outputFolder/*.dll $testPackageFolder
|
||||||
|
|
11
test.sh
11
test.sh
|
@ -1,11 +1,13 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
PLATFORM=$1
|
PLATFORM=$1
|
||||||
TYPE=$2
|
TYPE=$2
|
||||||
|
COVERAGE=$3
|
||||||
WHERE="cat != ManualTest"
|
WHERE="cat != ManualTest"
|
||||||
TEST_DIR="."
|
TEST_DIR="."
|
||||||
TEST_PATTERN="*Test.dll"
|
TEST_PATTERN="*Test.dll"
|
||||||
ASSEMBLIES=""
|
ASSEMBLIES=""
|
||||||
TEST_LOG_FILE="TestLog.txt"
|
TEST_LOG_FILE="TestLog.txt"
|
||||||
|
COVERAGE_FILE="$TEST_DIR/Coverage.xml"
|
||||||
|
|
||||||
if [ -d "$TEST_DIR/_tests" ]; then
|
if [ -d "$TEST_DIR/_tests" ]; then
|
||||||
TEST_DIR="$TEST_DIR/_tests"
|
TEST_DIR="$TEST_DIR/_tests"
|
||||||
|
@ -17,6 +19,7 @@ rm -f "$TEST_LOG_FILE"
|
||||||
export LIDARR_TESTS_LOG_OUTPUT="File"
|
export LIDARR_TESTS_LOG_OUTPUT="File"
|
||||||
|
|
||||||
NUNIT="$TEST_DIR/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe"
|
NUNIT="$TEST_DIR/NUnit.ConsoleRunner.3.7.0/tools/nunit3-console.exe"
|
||||||
|
OPEN_COVER="$TEST_DIR/OpenCover.4.7.922/tools/OpenCover.Console.exe"
|
||||||
NUNIT_COMMAND="$NUNIT"
|
NUNIT_COMMAND="$NUNIT"
|
||||||
NUNIT_PARAMS="--workers=1"
|
NUNIT_PARAMS="--workers=1"
|
||||||
|
|
||||||
|
@ -53,8 +56,16 @@ for i in `find $TEST_DIR -name "$TEST_PATTERN"`;
|
||||||
do ASSEMBLIES="$ASSEMBLIES $i"
|
do ASSEMBLIES="$ASSEMBLIES $i"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$COVERAGE" = "Coverage" ]; then
|
||||||
|
$OPEN_COVER -register:user -target:"$NUNIT" -targetargs:"$NUNIT_PARAMS --where=\"$WHERE\" $ASSEMBLIES" -output:"$COVERAGE_FILE";
|
||||||
|
EXIT_CODE=$?
|
||||||
|
elif [ "$COVERAGE" = "Test" ] ; then
|
||||||
$NUNIT_COMMAND --where "$WHERE" $NUNIT_PARAMS $ASSEMBLIES;
|
$NUNIT_COMMAND --where "$WHERE" $NUNIT_PARAMS $ASSEMBLIES;
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
|
else
|
||||||
|
echo "Run Type must be provided as third argument: Coverage or Test"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$EXIT_CODE" -ge 0 ]; then
|
if [ "$EXIT_CODE" -ge 0 ]; then
|
||||||
echo "Failed tests: $EXIT_CODE"
|
echo "Failed tests: $EXIT_CODE"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue