Cleaning up.

This commit is contained in:
jgen 2014-02-19 16:16:01 -05:00
parent bdbb280064
commit 7d90c20297
3 changed files with 9 additions and 24 deletions

View file

@ -35,11 +35,8 @@ after_failure:
- sudo ls -al data/config/ - sudo ls -al data/config/
- sudo cat data/config/shimmie.conf.php - sudo cat data/config/shimmie.conf.php
- sudo cat data/config/extensions.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) # configure notifications (email, IRC, campfire etc)
#notifications: #notifications:
# irc: "irc.freenode.org#travis" # irc: "irc.freenode.org#shimmie"
# #

View file

@ -332,7 +332,6 @@ class Database {
$this->connect_engine(); $this->connect_engine();
$this->engine->init($this->db); $this->engine->init($this->db);
// FIXME: this causes problems with running via the PHP CLI
$this->beginTransaction(); $this->beginTransaction();
} }
@ -394,7 +393,7 @@ class Database {
* Execute an SQL query and return an PDO resultset * Execute an SQL query and return an PDO resultset
*/ */
public function execute($query, $args=array()) { public function execute($query, $args=array()) {
//try { try {
if(is_null($this->db)) $this->connect_db(); if(is_null($this->db)) $this->connect_db();
_count_execs($this->db, $query, $args); _count_execs($this->db, $query, $args);
$stmt = $this->db->prepare($query); $stmt = $this->db->prepare($query);
@ -413,10 +412,10 @@ class Database {
$stmt->execute($args); $stmt->execute($args);
} }
return $stmt; return $stmt;
/*} }
catch(PDOException $pdoe) { catch(PDOException $pdoe) {
throw new SCoreException($pdoe->getMessage()."<p><b>Query:</b> ".$query); throw new SCoreException($pdoe->getMessage()."<p><b>Query:</b> ".$query);
}*/ }
} }
/** /**

View file

@ -53,33 +53,22 @@ foreach(_get_themelet_files(get_theme()) as $themelet) {
_load_extensions(); _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(); $database->commit();
// Create the necessary users for the tests. // Create the necessary users for the tests.
$userPage = new UserPage(); $userPage = new UserPage();
$userPage->onUserCreation(new UserCreationEvent("demo", "demo", "")); $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", "")); $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(); $page = class_exists("CustomPage") ? new CustomPage() : new Page();
$user = _get_user(); $user = _get_user();
send_event(new InitExtEvent()); send_event(new InitExtEvent());
// Now we can run all the tests. // Now we can actually run all the tests.
$all = new TestFinder(""); $all = new TestFinder("");
$results = $all->run(new TextReporter()); $results = $all->run(new TextReporter());
// At this point this isn't really necessary as the test machines are stateless. // Travis-CI needs to know the results of the tests.
//$database->commit();
exit ($results ? 0 : 1); exit ($results ? 0 : 1);