fixup! automation tests mac/linux

This commit is contained in:
Qstick 2020-07-13 23:37:14 -04:00
parent 1a81ef8d1f
commit dd90dbfa2e
3 changed files with 15 additions and 51 deletions

View file

@ -255,7 +255,7 @@ stages:
inputs:
targetType: 'filePath'
filePath: '$(testsFolder)/test.sh'
arguments: '$(osName) Unit Test'
arguments: '$(osName) Unit'
- publish: TestResult.xml
artifact: 'TestResult'
displayName: Publish Test Result
@ -337,7 +337,7 @@ stages:
inputs:
targetType: 'filePath'
filePath: '$(testsFolder)/test.sh'
arguments: $(osName) Integration Test
arguments: $(osName) Integration
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'
@ -394,9 +394,9 @@ stages:
displayName: Move Package Contents
- bash: |
if [[ $OSNAME == "Mac" ]]; then
url=https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-macos.tar.gz
url=https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-macos.tar.gz
elif [[ $OSNAME == "Linux" ]]; then
url=https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
url=https://github.com/mozilla/geckodriver/releases/download/v0.26.0/geckodriver-v0.26.0-linux64.tar.gz
else
echo "Unhandled OS"
exit 1
@ -412,7 +412,7 @@ stages:
inputs:
targetType: 'filePath'
filePath: '$(testsFolder)/test.sh'
arguments: $(osName) Automation Test
arguments: $(osName) Automation
- task: PublishTestResults@2
inputs:
testResultsFormat: 'NUnit'

View file

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NLog;
@ -34,7 +34,9 @@ public AutomationTest()
[TestFixtureSetUp]
public void SmokeTestSetup()
{
driver = new FirefoxDriver();
var options = new FirefoxOptions();
options.AddArguments("--headless");
driver = new FirefoxDriver(options);
_runner = new NzbDroneRunner(LogManager.GetCurrentClassLogger());
_runner.KillAll();

50
test.sh
View file

@ -2,21 +2,15 @@
PLATFORM=$1
TYPE=$2
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
COVERAGE_RESULT_DIRECTORY="$TEST_DIR/CoverageResults/"
rm -f "$TEST_LOG_FILE"
# Uncomment to log test output to a file instead of the console
@ -26,44 +20,12 @@ NUNIT="$TEST_DIR/NUnit.ConsoleRunner.3.10.0/tools/nunit3-console.exe"
NUNIT_COMMAND="$NUNIT"
NUNIT_PARAMS="--workers=1"
if [ "$PLATFORM" = "Mac" ]; then
#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
# 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
elif [ "$PLATFORM" = "Linux" ]; then
WHERE="$WHERE && cat != WINDOWS"
NUNIT_COMMAND="mono --debug --runtime=v4.0 $NUNIT"
elif [ "$PLATFORM" = "Mac" ]; then
WHERE="$WHERE && cat != WINDOWS"
NUNIT_COMMAND="mono --debug --runtime=v4.0 $NUNIT"
else
@ -94,4 +56,4 @@ if [ "$EXIT_CODE" -ge 0 ]; then
exit 0
else
exit $EXIT_CODE
fi
fi