From 0b597c37b387acdfa8b9df9737d01c1d8ff205f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Fri, 18 Dec 2015 16:59:57 +0100 Subject: [PATCH 1/2] Restructure travis tests --- .travis.yml | 4 ++- apps/dav/tests/travis/carddavtester.sh | 35 ------------------- .../dav/tests/travis/carddavtester/install.sh | 20 +++++++++++ apps/dav/tests/travis/carddavtester/script.sh | 17 +++++++++ .../{litmus-v1.sh => litmus-v1/install.sh} | 11 ------ apps/dav/tests/travis/litmus-v1/script.sh | 13 +++++++ .../{litmus-v2.sh => litmus-v2/install.sh} | 11 ------ apps/dav/tests/travis/litmus-v2/script.sh | 13 +++++++ 8 files changed, 66 insertions(+), 58 deletions(-) delete mode 100644 apps/dav/tests/travis/carddavtester.sh create mode 100644 apps/dav/tests/travis/carddavtester/install.sh create mode 100644 apps/dav/tests/travis/carddavtester/script.sh rename apps/dav/tests/travis/{litmus-v1.sh => litmus-v1/install.sh} (52%) create mode 100644 apps/dav/tests/travis/litmus-v1/script.sh rename apps/dav/tests/travis/{litmus-v2.sh => litmus-v2/install.sh} (51%) create mode 100644 apps/dav/tests/travis/litmus-v2/script.sh diff --git a/.travis.yml b/.travis.yml index c599a0c192..3f80fdb845 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,12 +25,14 @@ before_install: install: - sh -c "if [ '$TEST_DAV' = '1' ]; then bash tests/travis/install.sh $DB; fi" + - sh -c "if [ '$TEST_DAV' = '1' ]; then bash apps/dav/tests/travis/$TC/install.sh; fi" + script: - sh -c "if [ '$TEST_DAV' != '1' ]; then echo \"Not testing DAV\"; fi" - sh -c "if [ '$TEST_DAV' = '1' ]; then echo \"Testing DAV\"; fi" - - sh -c "if [ '$TEST_DAV' = '1' ]; then bash apps/dav/tests/travis/$TC.sh; fi" + - sh -c "if [ '$TEST_DAV' = '1' ]; then bash apps/dav/tests/travis/$TC/script.sh; fi" matrix: include: diff --git a/apps/dav/tests/travis/carddavtester.sh b/apps/dav/tests/travis/carddavtester.sh deleted file mode 100644 index 17f7e8eb4a..0000000000 --- a/apps/dav/tests/travis/carddavtester.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -SCRIPT=`realpath $0` -SCRIPTPATH=`dirname $SCRIPT` - - -# start the server -php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../.." & - - -if [ ! -f CalDAVTester/run.py ]; then - cd "$SCRIPTPATH" - git clone https://github.com/DeepDiver1975/CalDAVTester.git - cd "$SCRIPTPATH/CalDAVTester" - python run.py -s - cd "$SCRIPTPATH" -fi - -# create test user -cd "$SCRIPTPATH/../../../../" -OC_PASS=user01 php occ user:add --password-from-env user01 -php occ dav:create-addressbook user01 addressbook -OC_PASS=user02 php occ user:add --password-from-env user02 -php occ dav:create-addressbook user02 addressbook -cd "$SCRIPTPATH/../../../../" - -# run the tests -cd "$SCRIPTPATH/CalDAVTester" -PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onfail -s "$SCRIPTPATH/caldavtest/config/serverinfo.xml" -o cdt.txt \ - "$SCRIPTPATH/caldavtest/tests/CardDAV/current-user-principal.xml" \ - "$SCRIPTPATH/caldavtest/tests/CardDAV/sync-report.xml" -RESULT=$? - -tail "$SCRIPTPATH/../../../../data-autotest/owncloud.log" - -exit $RESULT diff --git a/apps/dav/tests/travis/carddavtester/install.sh b/apps/dav/tests/travis/carddavtester/install.sh new file mode 100644 index 0000000000..fa5d141ce0 --- /dev/null +++ b/apps/dav/tests/travis/carddavtester/install.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +SCRIPT=`realpath $0` +SCRIPTPATH=`dirname $SCRIPT` + + +if [ ! -f CalDAVTester/run.py ]; then + cd "$SCRIPTPATH" + git clone https://github.com/DeepDiver1975/CalDAVTester.git + cd "$SCRIPTPATH/CalDAVTester" + python run.py -s + cd "$SCRIPTPATH" +fi + +# create test user +cd "$SCRIPTPATH/../../../../../" +OC_PASS=user01 php occ user:add --password-from-env user01 +php occ dav:create-addressbook user01 addressbook +OC_PASS=user02 php occ user:add --password-from-env user02 +php occ dav:create-addressbook user02 addressbook +cd "$SCRIPTPATH/../../../../../" diff --git a/apps/dav/tests/travis/carddavtester/script.sh b/apps/dav/tests/travis/carddavtester/script.sh new file mode 100644 index 0000000000..6edd92981e --- /dev/null +++ b/apps/dav/tests/travis/carddavtester/script.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +SCRIPT=`realpath $0` +SCRIPTPATH=`dirname $SCRIPT` + +# start the server +php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../../.." & + +# run the tests +cd "$SCRIPTPATH/CalDAVTester" +PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onfail -s "$SCRIPTPATH/../caldavtest/config/serverinfo.xml" -o cdt.txt \ + "$SCRIPTPATH/../caldavtest/tests/CardDAV/current-user-principal.xml" \ + "$SCRIPTPATH/../caldavtest/tests/CardDAV/sync-report.xml" +RESULT=$? + +tail "$/../../../../../data-autotest/owncloud.log" + +exit $RESULT diff --git a/apps/dav/tests/travis/litmus-v1.sh b/apps/dav/tests/travis/litmus-v1/install.sh similarity index 52% rename from apps/dav/tests/travis/litmus-v1.sh rename to apps/dav/tests/travis/litmus-v1/install.sh index ab0690f392..0ee2cb08d8 100644 --- a/apps/dav/tests/travis/litmus-v1.sh +++ b/apps/dav/tests/travis/litmus-v1/install.sh @@ -1,11 +1,4 @@ #!/usr/bin/env bash -SCRIPT=`realpath $0` -SCRIPTPATH=`dirname $SCRIPT` - - -# start the server -php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../.." & - # compile litmus if [ ! -f /tmp/litmus/litmus-0.13.tar.gz ]; then @@ -17,7 +10,3 @@ if [ ! -f /tmp/litmus/litmus-0.13.tar.gz ]; then ./configure make fi - -# run the tests -cd /tmp/litmus/litmus-0.13 -make URL=http://127.0.0.1:8888/remote.php/webdav CREDS="admin admin" TESTS="basic copymove props locks" check diff --git a/apps/dav/tests/travis/litmus-v1/script.sh b/apps/dav/tests/travis/litmus-v1/script.sh new file mode 100644 index 0000000000..cba305683b --- /dev/null +++ b/apps/dav/tests/travis/litmus-v1/script.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +SCRIPT=`realpath $0` +SCRIPTPATH=`dirname $SCRIPT` + + +# start the server +php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../../.." & + +sleep 30 + +# run the tests +cd /tmp/litmus/litmus-0.13 +make URL=http://127.0.0.1:8888/remote.php/webdav CREDS="admin admin" TESTS="basic copymove props locks" check diff --git a/apps/dav/tests/travis/litmus-v2.sh b/apps/dav/tests/travis/litmus-v2/install.sh similarity index 51% rename from apps/dav/tests/travis/litmus-v2.sh rename to apps/dav/tests/travis/litmus-v2/install.sh index 892ad327d3..0ee2cb08d8 100644 --- a/apps/dav/tests/travis/litmus-v2.sh +++ b/apps/dav/tests/travis/litmus-v2/install.sh @@ -1,11 +1,4 @@ #!/usr/bin/env bash -SCRIPT=`realpath $0` -SCRIPTPATH=`dirname $SCRIPT` - - -# start the server -php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../.." & - # compile litmus if [ ! -f /tmp/litmus/litmus-0.13.tar.gz ]; then @@ -17,7 +10,3 @@ if [ ! -f /tmp/litmus/litmus-0.13.tar.gz ]; then ./configure make fi - -# run the tests -cd /tmp/litmus/litmus-0.13 -make URL=http://127.0.0.1:8888/remote.php/dav/files/admin CREDS="admin admin" TESTS="basic copymove props locks" check diff --git a/apps/dav/tests/travis/litmus-v2/script.sh b/apps/dav/tests/travis/litmus-v2/script.sh new file mode 100644 index 0000000000..966ed5a205 --- /dev/null +++ b/apps/dav/tests/travis/litmus-v2/script.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +SCRIPT=`realpath $0` +SCRIPTPATH=`dirname $SCRIPT` + + +# start the server +php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../../.." & + +sleep 30 + +# run the tests +cd /tmp/litmus/litmus-0.13 +make URL=http://127.0.0.1:8888/remote.php/dav/files/admin CREDS="admin admin" TESTS="basic copymove props locks" check From ac78d248b7f5d478029d44d0c91cb6920db2a428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Mon, 21 Dec 2015 11:43:15 +0100 Subject: [PATCH 2/2] Sleep in carddavtester as well --- apps/dav/tests/travis/carddavtester/script.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/dav/tests/travis/carddavtester/script.sh b/apps/dav/tests/travis/carddavtester/script.sh index 6edd92981e..46a6a98e27 100644 --- a/apps/dav/tests/travis/carddavtester/script.sh +++ b/apps/dav/tests/travis/carddavtester/script.sh @@ -5,6 +5,8 @@ SCRIPTPATH=`dirname $SCRIPT` # start the server php -S 127.0.0.1:8888 -t "$SCRIPTPATH/../../../../.." & +sleep 30 + # run the tests cd "$SCRIPTPATH/CalDAVTester" PYTHONPATH="$SCRIPTPATH/pycalendar/src" python testcaldav.py --print-details-onfail -s "$SCRIPTPATH/../caldavtest/config/serverinfo.xml" -o cdt.txt \