Skip to content
Extraits de code Groupes Projets
travis.sh 1,93 ko
Newer Older
  • Learn to ignore specific revisions
  • Fabian Becker's avatar
    Fabian Becker a validé
    #!/bin/bash
    
    
    if [ "$TEST_SUITE" != "UITests" ] && [ "$TEST_SUITE" != "AngularJSTests" ]
    
    Fabian Becker's avatar
    Fabian Becker a validé
    then
    
        if [ `phpunit --group __nogroup__ | grep "No tests executed" | wc -l` -ne 1 ]
        then
            echo "=====> There are some tests functions which do not have a @group set. "
            echo "       Please add the @group phpdoc comment to the following tests: <====="
            phpunit --group __nogroup__ --testdox | grep "[x]"
            exit 1
        fi
    
        if [ "$TEST_SUITE" = "AngularJSTests" ]
        then
    
            sh ./../angularjs/scripts/travis.sh
    
        elif [ "$TEST_SUITE" = "JavascriptTests" ]
    
            touch ../javascript/enable_sqlite
            phantomjs ../javascript/testrunner.js
        elif [ "$TEST_SUITE" = "UITests" ]
        then
    
            if [ -n "$PLUGIN_NAME" ]
            then
    
                artifacts_folder="protected/ui-tests.master.$PLUGIN_NAME"
    
                artifacts_folder="ui-tests.master"
    
            echo "View UI failures (if any) here http://builds-artifacts.piwik.org/$artifacts_folder/$TRAVIS_JOB_NUMBER/screenshot-diffs/diffviewer.html"
    
            echo "If the new screenshots are valid, then you can copy them over to tests/PHPUnit/UI/expected-ui-screenshots/."
            echo ""
    
                phantomjs ../lib/screenshot-testing/run-tests.js --assume-artifacts --persist-fixture-data --screenshot-repo=$TRAVIS_REPO_SLUG --plugin=$PLUGIN_NAME
    
                phantomjs ../lib/screenshot-testing/run-tests.js --store-in-ui-tests-repo --persist-fixture-data --assume-artifacts
    
                travis_wait phpunit --configuration phpunit.xml --colors --testsuite $TEST_SUITE --group $PLUGIN_NAME
    
                travis_wait phpunit --configuration phpunit.xml --testsuite $TEST_SUITE --colors
    
    else
        phpunit --configuration phpunit.xml --coverage-text --colors