From e7100e3d59fe22a64a4075035f0fe0ea2f87c5a5 Mon Sep 17 00:00:00 2001 From: ta264 Date: Mon, 12 Aug 2019 07:16:58 +0100 Subject: [PATCH] Tidy up, try to fix mac --- azure-pipelines.yml | 129 +++----------------------------------------- test.sh | 19 ++++--- 2 files changed, 17 insertions(+), 131 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 71c542681..50bdd47f8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -68,25 +68,9 @@ stages: - publish: $(outputFolder) artifact: '$(osName)Backend' condition: and(succeeded(), eq(variables['osName'], 'Windows')) - # - publish: $(Build.SourcesDirectory) - # artifact: 'CoverageBuild' - # condition: and(succeeded(), eq(variables['osName'], 'Windows')) - - bash: | - pwd - ls -lR ./ - - # Azure publish strips out permissions, so we have to tar / publish / dowload / untar - - task: ArchiveFiles@2 - displayName: Create Test Package - inputs: - archiveFile: 'tests.tar.gz' - archiveType: 'tar' - tarCompression: 'gz' - includeRootFolder: false - rootFolderOrFile: $(testsFolder) - - publish: tests.tar.gz - artifact: LinuxTests - condition: and(succeeded(), eq(variables['osName'], 'Linux')) + - publish: $(Build.SourcesDirectory) + artifact: 'CoverageBuild' + condition: and(succeeded(), eq(variables['osName'], 'Windows')) - publish: $(testsFolder) artifact: '$(osName)Tests' condition: and(succeeded(), eq(variables['osName'], 'Windows')) @@ -239,6 +223,7 @@ stages: displayName: Run Tests env: DYLD_FALLBACK_LIBRARY_PATH: $(Build.SourcesDirectory)/_tests + TEST_DIR: $(Build.SourcesDirectory)/_tests inputs: targetType: 'filePath' filePath: '$(testsFolder)/test.sh' @@ -253,54 +238,6 @@ stages: testResultsFiles: '**/TestResult.xml' testRunTitle: '$(osName) Unit Tests' - # - job: Windows_Unit_Tests - # displayName: Windows Unit - # pool: - # vmImage: 'vs2017-win2016' - # steps: - # - checkout: self - # - task: DownloadPipelineArtifact@2 - # displayName: Download Test Artifact - # inputs: - # buildType: 'current' - # artifactName: Tests - # targetPath: $(testsFolder) - # - task: Bash@3 - # displayName: Windows Unit Tests - # inputs: - # targetType: 'filePath' - # filePath: ./test.sh - # arguments: Windows Unit Test - # - task: PublishTestResults@2 - # inputs: - # testResultsFormat: 'NUnit' - # testResultsFiles: '**/TestResult.xml' - # testRunTitle: 'Windows Unit Tests' - - # - job: Mac_Unit_Tests - # displayName: macOS Unit - # pool: - # vmImage: 'macOS-10.13' - # steps: - # - checkout: self - # - task: DownloadPipelineArtifact@2 - # displayName: Download Test Artifact - # inputs: - # buildType: 'current' - # artifactName: Tests - # targetPath: $(testsFolder) - # - task: Bash@3 - # displayName: macOS Unit Tests - # inputs: - # targetType: 'filePath' - # filePath: ./test.sh - # arguments: Mac Unit Test - # - task: PublishTestResults@2 - # inputs: - # testResultsFormat: 'NUnit' - # testResultsFiles: '**/TestResult.xml' - # testRunTitle: 'macOS Unit Tests' - - stage: Integration_Automation displayName: Integration / Tests dependsOn: Package @@ -348,7 +285,6 @@ stages: testResultsFiles: '**/TestResult.xml' testRunTitle: 'Linux Integration Tests' - - job: Windows_Integration_Tests displayName: Windows Integration pool: @@ -435,25 +371,12 @@ stages: pool: vmImage: 'vs2017-win2016' steps: - - checkout: self - submodules: true - #- bash: ./build.sh --only-backend - # displayName: Build Lidarr Backend - # - task: DownloadPipelineArtifact@2 - # inputs: - # buildType: 'current' - # artifactName: CoverageBuild - # targetPath: $(Build.SourcesDirectory) - #- publish: $(testsFolder) - # artifact: 'CoverageTest' + - checkout: none - task: DownloadPipelineArtifact@2 inputs: buildType: 'current' - artifactName: WindowsTests - targetPath: $(testsFolder) - - bash: | - pwd - ls -lR ./ + artifactName: CoverageBuild + targetPath: $(Build.SourcesDirectory) - task: Bash@3 displayName: Coverage Unit Tests inputs: @@ -464,40 +387,4 @@ stages: displayName: Publish Coverage Results inputs: codeCoverageTool: 'cobertura' - summaryFileLocation: './Coverage.xml' - - - job: Linux_Coverage - displayName: Linux - pool: - vmImage: 'ubuntu-16.04' - steps: - - checkout: self - submodules: true - - task: DownloadPipelineArtifact@2 - inputs: - buildType: 'current' - artifactName: LinuxTests - targetPath: '$(Build.SourcesDirectory)' - - bash: | - pwd - ls -lR ./ - - task: ExtractFiles@1 - inputs: - archiveFilePatterns: tests.tar.gz - destinationFolder: _tests - - bash: | - pwd - ls -lR ./ - - bash: ./test.sh Linux Unit Coverage - displayName: Coverage Unit Tests - # - task: Bash@3 - # displayName: Coverage Unit Tests - # inputs: - # targetType: 'filePath' - # filePath: ./test.sh - # arguments: Linux Unit Coverage - - task: PublishCodeCoverageResults@1 - displayName: Publish Coverage Results - inputs: - codeCoverageTool: 'cobertura' - summaryFileLocation: './Coverage.xml' + summaryFileLocation: './_tests/Coverage.xml' diff --git a/test.sh b/test.sh index 75dddd710..3626fdd86 100755 --- a/test.sh +++ b/test.sh @@ -3,11 +3,15 @@ PLATFORM=$1 TYPE=$2 COVERAGE=$3 WHERE="cat != ManualTest" -TEST_DIR="." TEST_PATTERN="*Test.dll" ASSEMBLIES="" TEST_LOG_FILE="TestLog.txt" +echo "test dir: $TEST_DIR" +if [ -z "$TEST_DIR" ]; then + TEST_DIR="." +fi + if [ -d "$TEST_DIR/_tests" ]; then TEST_DIR="$TEST_DIR/_tests" fi @@ -24,12 +28,6 @@ NUNIT_COMMAND="$NUNIT" NUNIT_PARAMS="--workers=1" if [ "$PLATFORM" = "Mac" ]; then - echo "Mac sqlite options:" - export LD_LIBRARY_PATH=/usr/bin:$LD_LIBRARY_PATH - echo $LD_LIBRARY_PATH - - sqlite3 -version - sqlite3 :memory: "pragma compile_options" #set up environment if [[ -x '/opt/local/bin/mono' ]]; then @@ -40,9 +38,8 @@ if [ "$PLATFORM" = "Mac" ]; then export PATH="/usr/local/bin:$PATH" fi - DIR=$(cd "$(dirname "$0")"; pwd) - echo $DIR - export DYLD_FALLBACK_LIBRARY_PATH="$DIR" + echo $TEST_DIR + export DYLD_FALLBACK_LIBRARY_PATH="$TEST_DIR" if [ -e /Library/Frameworks/Mono.framework ]; then MONO_FRAMEWORK_PATH=/Library/Frameworks/Mono.framework/Versions/Current @@ -55,6 +52,8 @@ if [ "$PLATFORM" = "Mac" ]; then fi export DYLD_FALLBACK_LIBRARY_PATH="$DYLD_FALLBACK_LIBRARY_PATH:$HOME/lib:/usr/local/lib:/lib:/usr/lib" + echo $LD_LIBRARY_PATH + echo $DYLD_LIBRARY_PATH echo $DYLD_FALLBACK_LIBRARY_PATH export DYLD_PRINT_LIBRARIES=YES