radarr/test.sh
Qstick 923b959b6c
Build on Azure instead of Appveyor (#4590)
* Build on Azure instead of Appveyor

* fixup! Update Nuget

* fixup! installer and tests

* fixup! automation tests mac/linux

* Fix .gitattributes

* Fix line endings

* Try to fix integration tests

* Install mediainfo

* Update sqlite3 binaries for windows and mac

* Update media info to 20.03 and fix test

* Fix HttpClientTests, Use Servarr HttpBin Mirror

* Update test script

* Add media info to tests

* Fix tests

* Ignore tests ignored on Aphrodite

* partial automation update

* Reveet mac mediaInfo upgrade

* fixup! automation tests

* Revert "Reveet mac mediaInfo upgrade"

This reverts commit b54a76446b.

* Don't run linux tests on mac

* Exclude test failing on mac

Co-authored-by: ta264 <ta264@users.noreply.github.com>
2020-07-15 18:31:50 -04:00

68 lines
1.7 KiB
Bash
Executable file

#! /bin/bash
PLATFORM=$1
TYPE=$2
WHERE="cat != ManualTest"
TEST_DIR="."
TEST_PATTERN="*Test.dll"
ASSEMBLIES=""
TEST_LOG_FILE="TestLog.txt"
if [ -d "$TEST_DIR/_tests" ]; then
TEST_DIR="$TEST_DIR/_tests"
fi
rm -f "$TEST_LOG_FILE"
# Uncomment to log test output to a file instead of the console
export RADARR_TESTS_LOG_OUTPUT="File"
NUNIT="$TEST_DIR/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe"
NUNIT_COMMAND="$NUNIT"
NUNIT_PARAMS="--workers=1"
if [ "$PLATFORM" = "Mac" ]; then
export DYLD_FALLBACK_LIBRARY_PATH="$TEST_DIR:$MONOPREFIX/lib:/usr/local/lib:/lib:/usr/lib"
echo $DYLD_FALLBACK_LIBRARY_PATH
mono --version
# To debug which libraries are being loaded:
export DYLD_PRINT_LIBRARIES=YES
fi
if [ "$PLATFORM" = "Windows" ]; then
mkdir -p "$ProgramData/Radarr"
WHERE="$WHERE && cat != LINUX"
elif [ "$PLATFORM" = "Linux" ] || [ "$PLATFORM" = "Mac" ] ; then
mkdir -p ~/.config/Radarr
WHERE="$WHERE && cat != WINDOWS"
NUNIT_COMMAND="mono --debug --runtime=v4.0 $NUNIT"
else
echo "Platform must be provided as first arguement: Windows, Linux or Mac"
exit 1
fi
if [ "$TYPE" = "Unit" ]; then
WHERE="$WHERE && cat != IntegrationTest && cat != AutomationTest"
elif [ "$TYPE" = "Integration" ] || [ "$TYPE" = "int" ] ; then
WHERE="$WHERE && cat == IntegrationTest"
elif [ "$TYPE" = "Automation" ] ; then
WHERE="$WHERE && cat == AutomationTest"
else
echo "Type must be provided as second argument: Unit, Integration or Automation"
exit 2
fi
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
else
exit $EXIT_CODE
fi