Skip to content

Commit

Permalink
debugging upgrade ci problems
Browse files Browse the repository at this point in the history
  • Loading branch information
tombaeyens committed Jul 31, 2012
1 parent 3d624a5 commit 30e1bb5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ private void executeSchemaResource(String operation, String component, String re
throw new ActivitiException("database update java class '"+upgradestepClassName+"' can't be instantiated: "+e.getMessage(), e);
}
try {
log.fine("executing upgrade step java class "+upgradestepClassName);
dbUpgradeStep.execute(this);
} catch (Exception e) {
throw new ActivitiException("error while executing database update java class '"+upgradestepClassName+"': "+e.getMessage(), e);
Expand All @@ -822,6 +823,7 @@ private void executeSchemaResource(String operation, String component, String re
Statement jdbcStatement = connection.createStatement();
try {
// no logging needed as the connection will log it
log.fine("SQL: "+sqlStatement);
jdbcStatement.execute(sqlStatement);
jdbcStatement.close();
} catch (Exception e) {
Expand Down
4 changes: 2 additions & 2 deletions modules/activiti-upgrade/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<configuration>
<failIfNoTests>false</failIfNoTests>
<trimStackTrace>false</trimStackTrace>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<!-- redirectTestOutputToFile>true</redirectTestOutputToFile -->
<includes>
<include>**/*AfterTest.java</include>
</includes>
Expand Down Expand Up @@ -161,7 +161,7 @@
<tasks>
<echo message="dropping schema in ${database}" />
<property name="test_classpath" refid="maven.test.classpath" />
<java classname="org.activiti.engine.impl.db.DbSchemaDrop">
<java classname="org.activiti.engine.impl.db.DbSchemaDrop" fork="true">
<classpath>
<path path="${test_classpath}"/>
</classpath>
Expand Down
34 changes: 28 additions & 6 deletions qa/upgrade/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project name="activiti.qa.upgrade" default="upgrade">

<property file="${user.home}/.activiti/build.properties" />
<property name="activiti.version" value="5.9-SNAPSHOT" />
<property name="activiti.version" value="5.10-SNAPSHOT" />
<property name="database" value="h2" />
<property name="activiti.old.version" value="5.0" />
<property name="downloads.dir" value="${user.home}/.activiti/downloads" />
Expand All @@ -24,11 +24,23 @@
<ant antfile="target/activiti-${activiti.old.version}/setup/build.xml" target="h2.start" inheritall="false">
<property name="db" value="${database}" />
</ant>
<echo message="creating activiti tables" />
<echo message="####################################" />
<echo message="### CREATING ACTIVITI ${activiti.old.version} TABLES ###" />
<echo message="####################################" />
<loadfile property="old.database.properties.used" srcFile="target/activiti-${activiti.old.version}/setup/build.${database}.properties" failonerror="false"/>
<echo message="${old.database.properties.used}" />
<jar destfile="target/activiti-${activiti.old.version}/setup/files/dependencies/libs/logging-config.jar">
<fileset dir=".">
<includesfile name="logging.properties"/>
</fileset>
</jar>
<ant antfile="target/activiti-${activiti.old.version}/setup/build.xml" target="db.create" inheritall="false">
<property name="db" value="${database}" />
<property name="feature.cycle" value="disabled" />
</ant>
</ant>
<echo message="###################################################" />
<echo message="### RUNNING BEFORE-TESTS IN ACTIVITI ${activiti.old.version} ###" />
<echo message="###################################################" />
<echo message="unpacking upgrade before test classes" />
<exec executable="${mvn.executable}">
<arg line="dependency:unpack-dependencies -Dactiviti.upgrade.version=${activiti.old.version}-ALWAYS-SNAPSHOT -DoutputDirectory=target/activiti-${activiti.old.version}-upgrade-before-classes -DexcludeTransitive=true" />
Expand All @@ -38,7 +50,6 @@
<filterset filtersfile="${user.home}/.activiti/upgrade/build.${database}.properties" />
</copy>
<mkdir dir="target/test-results-before" />
<echo message="running before tests" />
<junit>
<classpath>
<pathelement location="target/activiti-${activiti.old.version}-upgrade-before-classes" />
Expand All @@ -49,13 +60,15 @@
<fileset dir="target/activiti-${activiti.old.version}-upgrade-before-classes">
<include name="**/*BeforeTest.class"/>
</fileset>
<formatter type="xml" />
<formatter type="xml" usefile="false" />
</batchtest>
</junit>
<echo message="##################################################" />
<echo message="### RUNNING AFTER-TESTS IN ACTIVITI ${activiti.version} ###" />
<echo message="##################################################" />
<condition property="optional.debug.property" value="-Dmaven.surefire.debug" else="">
<equals arg1="${debug}" arg2="true"/>
</condition>
<echo message="running after tests" />
<exec executable="${mvn.executable}" dir="../../modules/activiti-upgrade">
<arg line="-Ddatabase=${database} ${optional.debug.property} clean prepare-package" />
</exec>
Expand All @@ -80,6 +93,9 @@
</target>

<target name="internal.install.old.distro" unless="old.installation.available">
<echo message="#############################" />
<echo message="### INSTALLING OLD DISTRO ###" />
<echo message="#############################" />
<mkdir dir="target/activiti-${activiti.old.version}" />
<unzip src="${downloads.dir}/activiti-${activiti.old.version}.zip" dest="target" />
<copy file="${user.home}/.activiti/upgrade/build.${database}.properties" todir="target/activiti-${activiti.old.version}/setup" overwrite="true" />
Expand All @@ -98,6 +114,9 @@
</target>

<target name="build.engine.module">
<echo message="##############################" />
<echo message="### BUILDING ENGINE MODULE ###" />
<echo message="##############################" />
<exec executable="${mvn.executable}" dir="../..">
<arg line="-DskipTests clean install" />
</exec>
Expand All @@ -107,6 +126,9 @@
<equals arg1="${database}" arg2="mysql" />
</condition>
<target name="clean.db" if="is.database.mysql" depends="install.old.distro">
<echo message="#########################" />
<echo message="### CLEANING MYSQL DB ###" />
<echo message="#########################" />
<property file="${user.home}/.activiti/upgrade/build.${database}.properties" />
<echo message="cleaning db ${jdbc.url}" />
<sql driver="${jdbc.driver}" password="${jdbc.password}" url="${jdbc.url}" userid="${jdbc.username}">
Expand Down
5 changes: 5 additions & 0 deletions qa/upgrade/logging.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
handlers = java.util.logging.ConsoleHandler
.level = FINE
java.util.logging.ConsoleHandler.level=FINEST
java.util.logging.ConsoleHandler.formatter=org.activiti.engine.impl.util.LogUtil$LogFormatter

0 comments on commit 30e1bb5

Please sign in to comment.