diff --git a/.travis.yml b/.travis.yml index 3e1acf78..5fbcab62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,15 +31,12 @@ script: after_failure: - sudo cat /etc/nginx/sites-enabled/default - sudo cat /var/log/nginx/error.log - - sudo ls -al + - sudo ls -al - sudo ls -al data/config/ - sudo cat data/config/shimmie.conf.php - sudo cat data/config/extensions.conf.php - - sudo cat /var/log/php5-fpm.log - - sudo cat /var/log/mysql.log - - sudo cat /var/log/mysql.err # configure notifications (email, IRC, campfire etc) #notifications: -# irc: "irc.freenode.org#travis" +# irc: "irc.freenode.org#shimmie" # \ No newline at end of file diff --git a/core/database.class.php b/core/database.class.php index 06a31ff3..67237c1b 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -332,7 +332,6 @@ class Database { $this->connect_engine(); $this->engine->init($this->db); - // FIXME: this causes problems with running via the PHP CLI $this->beginTransaction(); } @@ -394,7 +393,7 @@ class Database { * Execute an SQL query and return an PDO resultset */ public function execute($query, $args=array()) { - //try { + try { if(is_null($this->db)) $this->connect_db(); _count_execs($this->db, $query, $args); $stmt = $this->db->prepare($query); @@ -413,10 +412,10 @@ class Database { $stmt->execute($args); } return $stmt; - /*} + } catch(PDOException $pdoe) { throw new SCoreException($pdoe->getMessage()."

Query: ".$query); - }*/ + } } /** diff --git a/tests/all_tests.php b/tests/all_tests.php index 1cb6c811..e5ec126e 100644 --- a/tests/all_tests.php +++ b/tests/all_tests.php @@ -53,33 +53,22 @@ foreach(_get_themelet_files(get_theme()) as $themelet) { _load_extensions(); -// Put the database into autocommit mode. +// Put the database into autocommit mode. (We don't really need transactions for the test setup) $database->commit(); // Create the necessary users for the tests. - $userPage = new UserPage(); $userPage->onUserCreation(new UserCreationEvent("demo", "demo", "")); -//$database->commit(); // Need to commit the new user to the database. - -//$database->beginTransaction(); - $userPage->onUserCreation(new UserCreationEvent("test", "test", "")); -//$database->commit(); // Need to commit the new user to the database. - -//$database->beginTransaction(); - -// Continue +// Fire off the InitExtEvent() $page = class_exists("CustomPage") ? new CustomPage() : new Page(); $user = _get_user(); send_event(new InitExtEvent()); -// Now we can run all the tests. +// Now we can actually run all the tests. $all = new TestFinder(""); $results = $all->run(new TextReporter()); -// At this point this isn't really necessary as the test machines are stateless. -//$database->commit(); - +// Travis-CI needs to know the results of the tests. exit ($results ? 0 : 1);