From e025b6bf7eb12861c8e6045ad8b298487b6084d8 Mon Sep 17 00:00:00 2001 From: verhoek Date: Wed, 20 Jun 2018 09:47:36 +0200 Subject: [PATCH 1/2] Added sensible default values to build directly from duplicati source folder. --- .travis.yml | 2 +- build.sh | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 33537bc8a..dedcbd899 100644 --- a/.travis.yml +++ b/.travis.yml @@ -68,4 +68,4 @@ before_install: - echo -n | openssl s_client -connect scan.coverity.com:443 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca- script: - - ./build.sh ${TRAVIS_BUILD_DIR} ${CATEGORY} + - ./build.sh ${CATEGORY} ${TRAVIS_BUILD_DIR} diff --git a/build.sh b/build.sh index 318675f7f..8ea96b27a 100755 --- a/build.sh +++ b/build.sh @@ -12,9 +12,15 @@ list_dir() { trap 'quit_on_error $LINENO' ERR -TRAVIS_BUILD_DIR=$1 -CATEGORY=$2 -TESTUSER=travis +CATEGORY=$1 +TRAVIS_BUILD_DIR=${2:-.} + +if id travis &> /dev/null +then + TESTUSER=travis +else + TESTUSER=`whoami` +fi echo "Build script starting with parameters TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR and CATEGORY=$CATEGORY" @@ -69,7 +75,7 @@ echo "travis_fold:end:download_extract_testdata" # run unit tests echo "travis_fold:start:unit_test" -if [[ "$CATEGORY" != "GUI" ]]; then +if [[ "$CATEGORY" != "GUI" && "$CATEGORY" != "" ]]; then mono ./testrunner/NUnit.ConsoleRunner.3.5.0/tools/nunit3-console.exe \ ./Duplicati/UnitTest/bin/Release/Duplicati.UnitTest.dll --where:cat==$CATEGORY --workers=1 fi @@ -77,8 +83,8 @@ echo "travis_fold:end:unit_test" # start server and run gui tests echo "travis_fold:start:gui_unit_test" -mono ./Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Release/Duplicati.Server.exe & if [[ "$CATEGORY" == "GUI" ]]; then + mono ./Duplicati/GUI/Duplicati.GUI.TrayIcon/bin/Release/Duplicati.Server.exe & python guiTests/guiTest.py fi echo "travis_fold:end:gui_unit_test" From 41ddc704616639c27701f78711ca22afda5ce9fe Mon Sep 17 00:00:00 2001 From: verhoek Date: Wed, 20 Jun 2018 18:45:32 +0200 Subject: [PATCH 2/2] Make Codacy happier. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 8ea96b27a..7f4610b83 100755 --- a/build.sh +++ b/build.sh @@ -19,7 +19,7 @@ if id travis &> /dev/null then TESTUSER=travis else - TESTUSER=`whoami` + TESTUSER=$(whoami) fi echo "Build script starting with parameters TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR and CATEGORY=$CATEGORY"