Skip to content
Extraits de code Groupes Projets
Valider da122f87 rédigé par mattpiwik's avatar mattpiwik
Parcourir les fichiers

Forget about previous commit, this is the proper way to debug a failing test!

git-svn-id: http://dev.piwik.org/svn/trunk@7798 59fd770c-687e-43c8-a1e3-f5a4ff64c105
parent 128474d6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -45,9 +45,6 @@ class Piwik_Sql ...@@ -45,9 +45,6 @@ class Piwik_Sql
static public function exec($sql) static public function exec($sql)
{ {
$db = Zend_Registry::get('db'); $db = Zend_Registry::get('db');
if (!is_a($db, 'Zend_Db_Adapter_Abstract')) {
debug_print_backtrace();
}
$profiler = $db->getProfiler(); $profiler = $db->getProfiler();
$q = $profiler->queryStart($sql, Zend_Db_Profiler::INSERT); $q = $profiler->queryStart($sql, Zend_Db_Profiler::INSERT);
$return = self::getDb()->exec($sql); $return = self::getDb()->exec($sql);
......
<project name="piwik" default="all" basedir="."> <project name="piwik" default="all" basedir=".">
<property file="build.properties" /> <property file="build.properties"/>
<property file="defaults.properties" /> <property file="defaults.properties"/>
<target name="clean"> <target name="clean">
<delete dir="${basedir}/results" /> <delete dir="${basedir}/results"/>
</target> </target>
<target name="prepare-build-filesystem" depends="clean"> <target name="prepare-build-filesystem" depends="clean">
<mkdir dir="${basedir}/../tmp/templates_c" /> <mkdir dir="${basedir}/../tmp/templates_c"/>
<mkdir dir="${basedir}/../tmp/cache" /> <mkdir dir="${basedir}/../tmp/cache"/>
<mkdir dir="${basedir}/../tmp/latest" /> <mkdir dir="${basedir}/../tmp/latest"/>
<mkdir dir="${basedir}/../tmp/sessions" /> <mkdir dir="${basedir}/../tmp/sessions"/>
<mkdir dir="${basedir}/../tmp/assets" /> <mkdir dir="${basedir}/../tmp/assets"/>
<chmod perm="a+rw">
<dirset dir="${basedir}/..">
<include name="config" />
<include name="tmp" />
<include name="tmp/**" />
</dirset>
</chmod>
</target>
<target name="phpunit"> <chmod perm="a+rw">
<copy file="${basedir}/PHPUnit/phpunit.xml.dist" tofile="${basedir}/PHPUnit/phpunit.xml" overwrite="true"> <dirset dir="${basedir}/..">
<filterset> <include name="config"/>
<filtersfile file="${basedir}/build.properties"/> <include name="tmp"/>
</filterset> <include name="tmp/**"/>
</copy> </dirset>
</target> </chmod>
</target>
<target name="process-build-resources-pdo-mysql" depends="prepare-build-filesystem"> <target name="phpunit">
<copy file="${basedir}/config/pdo_mysql.template.php" tofile="${basedir}/../config/config.ini.php" overwrite="true"> <copy file="${basedir}/PHPUnit/phpunit.xml.dist" tofile="${basedir}/PHPUnit/phpunit.xml" overwrite="true">
<filterset> <filterset>
<filtersfile file="${basedir}/build.properties"/> <filtersfile file="${basedir}/build.properties"/>
</filterset> </filterset>
</copy> </copy>
</target> </target>
<target name="test-pdo-mysql" depends="process-build-resources-pdo-mysql"> <target name="process-build-resources-pdo-mysql" depends="prepare-build-filesystem">
<echo>PDO_MYSQL unit tests started</echo> <copy file="${basedir}/config/pdo_mysql.template.php" tofile="${basedir}/../config/config.ini.php"
overwrite="true">
<filterset>
<filtersfile file="${basedir}/build.properties"/>
</filterset>
</copy>
</target>
<exec executable="phpunit" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true"> <target name="test-pdo-mysql" depends="process-build-resources-pdo-mysql">
<echo>PDO_MYSQL unit tests started</echo>
<exec executable="phpunit" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true">
<!-- DEBUG: when test crash in the middle, enable this to see which test crashes. Note: remove \ from -\- below --> <!-- DEBUG: when test crash in the middle, enable this to see which test crashes. Note: remove \ from -\- below -->
<!--<arg line=" -\-testdox"/>--> <arg line=" -\-testdox"/>
</exec> </exec>
<echo>PDO_MYSQL unit tests finished</echo> <echo>PDO_MYSQL unit tests finished</echo>
</target> </target>
<target name="process-build-resources-mysqli" depends="prepare-build-filesystem"> <target name="process-build-resources-mysqli" depends="prepare-build-filesystem">
<copy file="${basedir}/config/mysqli.template.php" tofile="${basedir}/../config/config.ini.php" overwrite="true"> <copy file="${basedir}/config/mysqli.template.php" tofile="${basedir}/../config/config.ini.php"
<filterset> overwrite="true">
<filtersfile file="${basedir}/build.properties"/> <filterset>
</filterset> <filtersfile file="${basedir}/build.properties"/>
</copy> </filterset>
</target> </copy>
</target>
<target name="test-mysqli" depends="process-build-resources-mysqli"> <target name="test-mysqli" depends="process-build-resources-mysqli">
<echo>MYSQLI unit tests started</echo> <echo>MYSQLI unit tests started</echo>
<exec executable="phpunit" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true"> <exec executable="phpunit" dir="${basedir}/PHPUnit" failonerror="false" failifexecutionfails="true">
<!-- DEBUG: when test crash in the middle, enable this to see which test crashes. Note: Remove \ from -\- below --> <!-- DEBUG: when test crash in the middle, enable this to see which test crashes. Note: Remove \ from -\- below -->
<!--<arg line="-\-testdox"/>--> <!--<arg line="-\-testdox"/>-->
</exec> </exec>
<echo>MYSQLI unit tests finished</echo> <echo>MYSQLI unit tests finished</echo>
</target> </target>
<target name="all" depends="phpunit,test-pdo-mysql,test-mysqli"> <target name="all" depends="phpunit,test-pdo-mysql,test-mysqli">
</target> </target>
</project> </project>
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter