]> source.dussan.org Git - nextcloud-server.git/commitdiff
Introduce evaluation of an environment variable to choose if all, only database or...
authorThomas Müller <thomas.mueller@tmit.eu>
Mon, 2 Nov 2015 23:24:23 +0000 (00:24 +0100)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 30 Nov 2015 09:55:05 +0000 (10:55 +0100)
This is mainly required on automated execution on Jenkins

autotest.sh

index f0efc45ccca7e22317587a4baf70c47afad6b07a..ae8e9f0d4842a6a01ff5dd07283abaa520a6953e 100755 (executable)
@@ -260,14 +260,27 @@ function execute_tests {
        if [[ "$_XDEBUG_CONFIG" ]]; then
                export XDEBUG_CONFIG=$_XDEBUG_CONFIG
        fi
+       if [ -z "$TEST_SELECTION" ]; then
+               TEST_SELECTION='all'
+       fi
+       GROUP=''
+       if [ "$TEST_SELECTION" == "DB" ]; then
+               GROUP='--group DB'
+       fi
+       if [ "$TEST_SELECTION" == "NODB" ]; then
+               GROUP='--exclude-group DB'
+       fi
+
+       COVER=''
        if [ -z "$NOCOVERAGE" ]; then
-               "${PHPUNIT[@]}" --configuration phpunit-autotest.xml --log-junit "autotest-results-$DB.xml" --coverage-clover "autotest-clover-$DB.xml" --coverage-html "coverage-html-$DB" "$2" "$3"
-               RESULT=$?
+               COVER='--coverage-clover "autotest-clover-$DB.xml" --coverage-html "coverage-html-$DB"'
+               "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP --log-junit "autotest-results-$DB.xml" --coverage-clover "autotest-clover-$DB.xml" --coverage-html "coverage-html-$DB" "$2" "$3"
        else
                echo "No coverage"
-               "${PHPUNIT[@]}" --configuration phpunit-autotest.xml --log-junit "autotest-results-$DB.xml" "$2" "$3"
-               RESULT=$?
        fi
+       echo "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
+       "${PHPUNIT[@]}" --configuration phpunit-autotest.xml $GROUP $COVER --log-junit "autotest-results-$DB.xml" "$2" "$3"
+               RESULT=$?
 
        if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then
                cd ..