Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for running complete test suite on Travis CI
Fixes #16126: Setup integration testing on Travis CI
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
language: php | |||
|
|||
php: | |||
- 5.4 | |||
|
|||
before_script: ./scripts/travis_before_script.sh | |||
|
|||
env: | |||
- DB=mysql | |||
- DB=pgsql | |||
|
|||
script: phpunit --bootstrap ./tests/bootstrap.php ./tests/AllTests.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,28 @@ | |||
#!/bin/sh | |||
|
|||
# create database | |||
if [ $DB = 'mysql' ]; then | |||
mysql -e 'create database bugtracker;' | |||
DB_USER='root' | |||
elif [ $DB = 'pgsql' ]; then | |||
psql -c 'CREATE DATABASE bugtracker;' -U postgres | |||
psql -c "ALTER USER postgres SET bytea_output = 'escape';" -U postgres | |||
DB_USER='postgres' | |||
fi | |||
|
|||
# start embedded server | |||
php -S localhost:8000 & | |||
sleep 5 | |||
|
|||
# trigger installation | |||
curl --data "install=2&hostname=localhost&db_username=${DB_USER}&db_type=${DB}&db_password=&database_name=bugtracker&admin_username=${DB_USER}&admin_password=" http://localhost:8000/admin/install.php | |||
|
|||
# create the first project | |||
if [ $DB = 'mysql' ]; then | |||
mysql -e "INSERT INTO mantis_project_table(name, inherit_global) VALUES('First project', 1)" bugtracker | |||
elif [ $DB = 'pgsql' ]; then | |||
psql -c "INSERT INTO mantis_project_table(name, inherit_global, description) VALUES('First project', 1, '')" -d bugtracker -U postgres | |||
fi | |||
|
|||
# enable SOAP tests | |||
echo "<?php \$GLOBALS['MANTIS_TESTSUITE_SOAP_ENABLED'] = true; \$GLOBALS['MANTIS_TESTSUITE_SOAP_HOST'] = 'http://localhost:8000/api/soap/mantisconnect.php?wsdl';?>" > ./tests/bootstrap.php |