diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 394ee35027..ee8bea45fa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -420,4 +420,24 @@ stages: testRunTitle: '$(osName) Automation Tests' failTaskOnFailedTests: $(failBuild) displayName: Publish Test Results + + - stage: Report_Out + dependsOn: + - Unit_Test + - Integration_Automation + condition: eq(variables['system.pullrequest.isfork'], false) + displayName: Build Status Report + jobs: + - job: + displayName: Discord Notification + pool: + vmImage: 'ubuntu-18.04' + steps: + - checkout: none + - powershell: | + iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/Servarr/AzureDiscordNotify/master/DiscordNotify.ps1')) + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + DISCORDCHANNELID: $(discordChannelId) + DISCORDWEBHOOKKEY: $(discordWebhookKey) \ No newline at end of file diff --git a/build.sh b/build.sh index d21555afe5..7a957f3205 100755 --- a/build.sh +++ b/build.sh @@ -4,6 +4,7 @@ outputFolderLinux='./_output_linux' outputFolderMacOS='./_output_macos' outputFolderMacOSApp='./_output_macos_app' testPackageFolder='./_tests/' +testSearchPattern='*.Test/bin/x86/Release/*' sourceFolder='./src' slnFile=$sourceFolder/NzbDrone.sln updateFolder=$outputFolder/Radarr.Update @@ -215,20 +216,29 @@ PackageTests() { ProgressStart 'Creating Test Package' + rm -rf $testPackageFolder + mkdir $testPackageFolder + + find . -maxdepth 6 -path $testSearchPattern -exec cp -r "{}" $testPackageFolder \; + if [ $runtime = "dotnet" ] ; then $nuget install NUnit.ConsoleRunner -Version 3.10.0 -Output $testPackageFolder else mono $nuget install NUnit.ConsoleRunner -Version 3.10.0 -Output $testPackageFolder fi + cp $outputFolder/*.dll $testPackageFolder + cp $outputFolder/*.exe $testPackageFolder + cp $outputFolder/fpcalc $testPackageFolder cp ./test.sh $testPackageFolder rm -f $testPackageFolder/*.log.config CleanFolder $testPackageFolder true - echo "Adding NzbDrone.Core.dll.config (for dllmap)" - cp $sourceFolder/NzbDrone.Core/NzbDrone.Core.dll.config $testPackageFolder + echo "Adding CurlSharp.dll.config (for dllmap)" + cp $sourceFolder/NzbDrone.Common/CurlSharp.dll.config $testPackageFolder + echo "Copying CurlSharp libraries" cp $sourceFolder/ExternalModules/CurlSharp/libs/i386/* $testPackageFolder diff --git a/setup/nzbdrone.iss b/setup/radarr.iss similarity index 100% rename from setup/nzbdrone.iss rename to setup/radarr.iss diff --git a/test.sh b/test.sh index a9beb95ee7..4426984aac 100755 --- a/test.sh +++ b/test.sh @@ -28,7 +28,29 @@ NUNIT_PARAMS="--workers=1" if [ "$PLATFORM" = "Mac" ]; then - export DYLD_FALLBACK_LIBRARY_PATH="$TEST_DIR:/usr/local/lib:/lib:/usr/lib" + #set up environment + if [[ -x '/opt/local/bin/mono' ]]; then + # Macports and mono-supplied installer path + export PATH="/opt/local/bin:$PATH" + elif [[ -x '/usr/local/bin/mono' ]]; then + # Homebrew-supplied path to mono + export PATH="/usr/local/bin:$PATH" + fi + + 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 + export PATH="$MONO_FRAMEWORK_PATH/bin:$PATH" + export DYLD_FALLBACK_LIBRARY_PATH="$DYLD_FALLBACK_LIBRARY_PATH:$MONO_FRAMEWORK_PATH/lib" + fi + + if [[ -f '/opt/local/lib/libsqlite3.0.dylib' ]]; then + export DYLD_FALLBACK_LIBRARY_PATH="/opt/local/lib:$DYLD_FALLBACK_LIBRARY_PATH" + 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 @@ -64,6 +86,9 @@ for i in `find $TEST_DIR -name "$TEST_PATTERN"`; do ASSEMBLIES="$ASSEMBLIES $i" done +$NUNIT_COMMAND --where "$WHERE" $NUNIT_PARAMS $ASSEMBLIES; +EXIT_CODE=$? + if [ "$EXIT_CODE" -ge 0 ]; then echo "Failed tests: $EXIT_CODE" exit 0