Looks like we are going to have to install, then run the tests.
This commit is contained in:
		
							parent
							
								
									4eab3daef4
								
							
						
					
					
						commit
						a210cc9e9e
					
				| @ -21,8 +21,9 @@ before_script: | |||||||
|   - if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS shimmie;" -U postgres; fi |   - if [[ "$DB" == "pgsql" ]]; then psql -c "DROP DATABASE IF EXISTS shimmie;" -U postgres; fi | ||||||
|   - if [[ "$DB" == "pgsql" ]]; then psql -c "create database shimmie;" -U postgres; fi |   - if [[ "$DB" == "pgsql" ]]; then psql -c "create database shimmie;" -U postgres; fi | ||||||
|   - if [[ "$DB" == "mysql" ]]; then mysql -e "create database shimmie;" -uroot; fi |   - if [[ "$DB" == "mysql" ]]; then mysql -e "create database shimmie;" -uroot; fi | ||||||
|  |   - php tests/test_install.php -d $DB | ||||||
| 
 | 
 | ||||||
| script: php tests/all_tests.php -d $DB | script: php tests/all_tests.php | ||||||
| 
 | 
 | ||||||
| # If a failure occured then dump out a bunch of logs for debugging purposes. | # If a failure occured then dump out a bunch of logs for debugging purposes. | ||||||
| after_failure: | after_failure: | ||||||
|  | |||||||
| @ -12,41 +12,17 @@ require_once('lib/simpletest/autorun.php'); | |||||||
| require_once('lib/simpletest/unit_tester.php'); | require_once('lib/simpletest/unit_tester.php'); | ||||||
| require_once('lib/simpletest/web_tester.php'); | require_once('lib/simpletest/web_tester.php'); | ||||||
| require_once('lib/simpletest/reporter.php'); | require_once('lib/simpletest/reporter.php'); | ||||||
| require_once('tests/test_install.php'); |  | ||||||
| require_once("core/util.inc.php"); |  | ||||||
| 
 | 
 | ||||||
| // Enable all errors.
 | // Enable all errors.
 | ||||||
| error_reporting(E_ALL); | error_reporting(E_ALL); | ||||||
| 
 | 
 | ||||||
| // Get the command line option telling us what database to use.
 |  | ||||||
| $options = getopt("d:"); |  | ||||||
| $db = $options["d"]; |  | ||||||
| 
 |  | ||||||
| if (empty($db)){ die("Error: need to specifiy a database for the test environment."); } |  | ||||||
| 
 |  | ||||||
| define("_TRAVIS_DATABASE", $db); |  | ||||||
| 
 |  | ||||||
| // Install Shimmie
 |  | ||||||
| $test_suite = new TestSuite('Shimmie tests'); |  | ||||||
| $test_suite->add(new ShimmieInstallerTest()); |  | ||||||
| 
 |  | ||||||
| // Wait for the config file to be written.
 |  | ||||||
| 
 |  | ||||||
| $timeout = 5; |  | ||||||
| 
 |  | ||||||
| while ($timeout > 0 && !file_exists("../data/config/shimmie.conf.php")) { |  | ||||||
| 	sleep(1); |  | ||||||
| 	$timeout--; |  | ||||||
| 	clearstatcache(); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| require_once("core/sys_config.inc.php"); |  | ||||||
| include "../data/config/shimmie.conf.php"; |  | ||||||
| 
 |  | ||||||
| // 
 | // 
 | ||||||
| // The code below is from index.php
 | // The code below is from index.php
 | ||||||
| //
 | //
 | ||||||
| 
 | 
 | ||||||
|  | require_once "core/sys_config.inc.php"; | ||||||
|  | require_once "core/util.inc.php"; | ||||||
|  | 
 | ||||||
| // set up and purify the environment
 | // set up and purify the environment
 | ||||||
| _version_check(); | _version_check(); | ||||||
| _sanitise_environment(); | _sanitise_environment(); | ||||||
|  | |||||||
| @ -8,6 +8,24 @@ | |||||||
|  * @copyright  Copyright (c) 2014, jgen |  * @copyright  Copyright (c) 2014, jgen | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
|  | require_once('lib/simpletest/autorun.php'); | ||||||
|  | require_once('lib/simpletest/unit_tester.php'); | ||||||
|  | require_once('lib/simpletest/web_tester.php'); | ||||||
|  | require_once('lib/simpletest/reporter.php'); | ||||||
|  | require_once('tests/test_install.php'); | ||||||
|  | require_once("core/util.inc.php"); | ||||||
|  | 
 | ||||||
|  | // Enable all errors.
 | ||||||
|  | error_reporting(E_ALL); | ||||||
|  | 
 | ||||||
|  | // Get the command line option telling us what database to use.
 | ||||||
|  | $options = getopt("d:"); | ||||||
|  | $db = $options["d"]; | ||||||
|  | 
 | ||||||
|  | if (empty($db)){ die("Error: need to specifiy a database for the test environment."); } | ||||||
|  | 
 | ||||||
|  | define("_TRAVIS_DATABASE", $db); | ||||||
|  | 
 | ||||||
| class ShimmieInstallerTest extends WebTestCase { | class ShimmieInstallerTest extends WebTestCase { | ||||||
| 	function testInstallShimmie() | 	function testInstallShimmie() | ||||||
| 	{ | 	{ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user