KEYCLOAK-8837 Adapt TS to be able to test migration from 7.2.5.GA (instead from 7.2.0.GA)

This commit is contained in:
vramik 2018-11-16 13:19:34 +01:00 committed by Stian Thorgersen
parent dc06a8cee3
commit 55f90ff09f
9 changed files with 21 additions and 22 deletions

4
.gitignore vendored
View file

@ -60,3 +60,7 @@ target
# KEYCLOAK-5391: We will re-exclude node_modules when node_modules handling is worked out. # KEYCLOAK-5391: We will re-exclude node_modules when node_modules handling is worked out.
# For now, we keep our js libraries checked into GitHub, so we don't ignore. # For now, we keep our js libraries checked into GitHub, so we don't ignore.
#node_modules #node_modules
# testsuite #
#############
*offline-token.txt

View file

@ -17,7 +17,7 @@
<assembly> <assembly>
<id>auth-server-jboss-${migrated.auth.server.version}</id> <id>auth-server-migration-${migrated.auth.server.version}</id>
<formats> <formats>
<format>zip</format> <format>zip</format>
@ -28,14 +28,14 @@
<fileSets> <fileSets>
<fileSet> <fileSet>
<directory>${keycloak.server.home}</directory> <directory>${keycloak.server.home}</directory>
<outputDirectory>keycloak-${migrated.auth.server.version}</outputDirectory> <outputDirectory>auth-server-migration</outputDirectory>
<excludes> <excludes>
<exclude>**/*.sh</exclude> <exclude>**/*.sh</exclude>
</excludes> </excludes>
</fileSet> </fileSet>
<fileSet> <fileSet>
<directory>${keycloak.server.home}</directory> <directory>${keycloak.server.home}</directory>
<outputDirectory>keycloak-${migrated.auth.server.version}</outputDirectory> <outputDirectory>auth-server-migration</outputDirectory>
<includes> <includes>
<include>**/*.sh</include> <include>**/*.sh</include>
</includes> </includes>

View file

@ -31,7 +31,7 @@
<properties> <properties>
<keycloak.server.home>${project.build.directory}/unpacked/keycloak-${migrated.auth.server.version}</keycloak.server.home> <keycloak.server.home>${project.build.directory}/unpacked/keycloak-${migrated.auth.server.version}</keycloak.server.home>
<jdbc.mvn.driver.deployment.dir>${keycloak.server.home}/modules/system/layers/base/com/${jdbc.mvn.artifactId}/main</jdbc.mvn.driver.deployment.dir> <jdbc.mvn.driver.deployment.dir>${keycloak.server.home}/modules/system/layers/base/test/jdbc/${jdbc.mvn.artifactId}/main</jdbc.mvn.driver.deployment.dir>
</properties> </properties>
<build> <build>

View file

@ -73,7 +73,7 @@
<xsl:variable name="newDriverDefinition"> <xsl:variable name="newDriverDefinition">
<xsl:if test="$driver != 'h2'"> <xsl:if test="$driver != 'h2'">
<driver name="{$driver}" module="com.{$driver}"/> <driver name="{$driver}" module="test.jdbc.{$driver}"/>
</xsl:if> </xsl:if>
</xsl:variable> </xsl:variable>

View file

@ -27,7 +27,7 @@
<xsl:param name="version" select="''"/> <xsl:param name="version" select="''"/>
<xsl:variable name="newModuleDefinition"> <xsl:variable name="newModuleDefinition">
<module xmlns="urn:jboss:module:1.3" name="com.{$database}"> <module xmlns="urn:jboss:module:1.3" name="test.jdbc.{$database}">
<resources> <resources>
<resource-root path="{$database}-{$version}.jar"/> <resource-root path="{$database}-{$version}.jar"/>
</resources> </resources>

View file

@ -43,7 +43,7 @@ public class MigrationTestExecutionDecider implements TestExecutionDecider {
String versionFrom = migrationAnnotation.versionFrom(); String versionFrom = migrationAnnotation.versionFrom();
if (migratedAuthServerVersion.contains(versionFrom)) { if (migratedAuthServerVersion.startsWith(versionFrom)) {
return ExecutionDecision.execute(); return ExecutionDecision.execute();
} else { } else {
return ExecutionDecision.dontExecute(method.getName() + "doesn't fit with migration version."); return ExecutionDecision.dontExecute(method.getName() + "doesn't fit with migration version.");

View file

@ -68,23 +68,23 @@ public class MigrationTest extends AbstractMigrationTest {
} }
@Test @Test
@Migration(versionFrom = "3.4.3.Final") @Migration(versionFrom = "3.")
public void migration3_4_3Test() { public void migration3_xTest() {
testMigratedData(); testMigratedData();
testMigrationTo4_x(); testMigrationTo4_x();
} }
@Test @Test
@Migration(versionFrom = "2.5.5.Final") @Migration(versionFrom = "2.")
public void migration2_5_5Test() { public void migration2_xTest() {
testMigratedData(); testMigratedData();
testMigrationTo3_x(); testMigrationTo3_x();
testMigrationTo4_x(); testMigrationTo4_x();
} }
@Test @Test
@Migration(versionFrom = "1.9.8.Final") @Migration(versionFrom = "1.")
public void migration1_9_8Test() throws Exception { public void migration1_xTest() throws Exception {
testMigratedData(false); testMigratedData(false);
testMigrationTo2_x(); testMigrationTo2_x();
testMigrationTo3_x(); testMigrationTo3_x();

View file

@ -122,7 +122,6 @@
-Dauth.server.https.port=${auth.server.https.port} -Dauth.server.https.port=${auth.server.https.port}
-Dkeycloak.password.blacklists.path=${keycloak.password.blacklists.path} -Dkeycloak.password.blacklists.path=${keycloak.password.blacklists.path}
${adapter.test.props} ${adapter.test.props}
${migration.import.properties}
${auth.server.profile} ${auth.server.profile}
${auth.server.feature} ${auth.server.feature}
${kie.maven.settings} ${kie.maven.settings}

View file

@ -141,7 +141,6 @@
-Djava.security.krb5.conf=${project.build.directory}/dependency/kerberos/test-krb5.conf -Djava.security.krb5.conf=${project.build.directory}/dependency/kerberos/test-krb5.conf
</adapter.test.props> </adapter.test.props>
<migration.import.properties/>
<examples.home>${project.build.directory}/examples</examples.home> <examples.home>${project.build.directory}/examples</examples.home>
<examples.basedir>${keycloak-parent.basedir}/examples</examples.basedir> <!--keycloak/examples directory--> <examples.basedir>${keycloak-parent.basedir}/examples</examples.basedir> <!--keycloak/examples directory-->
<examples.version.suffix>${project.version}</examples.version.suffix> <examples.version.suffix>${project.version}</examples.version.suffix>
@ -463,7 +462,6 @@
<examples.home>${examples.home}</examples.home> <examples.home>${examples.home}</examples.home>
<examples.version.suffix>${examples.version.suffix}</examples.version.suffix> <examples.version.suffix>${examples.version.suffix}</examples.version.suffix>
<migration.import.properties>${migration.import.properties}</migration.import.properties>
<kie.maven.settings>${kie.maven.settings}</kie.maven.settings> <kie.maven.settings>${kie.maven.settings}</kie.maven.settings>
<testsuite.constants>${testsuite.constants}</testsuite.constants> <testsuite.constants>${testsuite.constants}</testsuite.constants>
@ -497,8 +495,6 @@
<appium.fullReset>${appium.fullReset}</appium.fullReset> <appium.fullReset>${appium.fullReset}</appium.fullReset>
<project.version>${project.version}</project.version> <project.version>${project.version}</project.version>
<migration.project.version>${migration.project.version}</migration.project.version>
<migration.product.version>${migration.product.version}</migration.product.version>
<client.certificate.ca.path>${client.certificate.ca.path}</client.certificate.ca.path> <client.certificate.ca.path>${client.certificate.ca.path}</client.certificate.ca.path>
<client.certificate.keystore>${client.certificate.keystore}</client.certificate.keystore> <client.certificate.keystore>${client.certificate.keystore}</client.certificate.keystore>
@ -1345,7 +1341,7 @@
<systemPropertyVariables> <systemPropertyVariables>
<migrated.auth.server.version>${migrated.auth.server.version}</migrated.auth.server.version> <migrated.auth.server.version>${migrated.auth.server.version}</migrated.auth.server.version>
<auth.server.jboss.migration>true</auth.server.jboss.migration> <auth.server.jboss.migration>true</auth.server.jboss.migration>
<keycloak.migration.home>${containers.home}/keycloak-${migrated.auth.server.version}</keycloak.migration.home> <keycloak.migration.home>${containers.home}/auth-server-migration</keycloak.migration.home>
<migration.import.props.previous>${migration.import.props.previous}</migration.import.props.previous> <migration.import.props.previous>${migration.import.props.previous}</migration.import.props.previous>
</systemPropertyVariables> </systemPropertyVariables>
</configuration> </configuration>
@ -1356,14 +1352,14 @@
</profile> </profile>
<profile> <profile>
<id>migration-productized</id> <id>migration-prod</id>
<activation> <activation>
<property> <property>
<name>migrated.version.import.file.suffix</name> <name>migration.import.file.name</name>
</property> </property>
</activation> </activation>
<properties> <properties>
<migration.import.file>target/test-classes/migration-test/migration-realm-${migrated.version.import.file.suffix}.json</migration.import.file> <migration.import.file>target/test-classes/migration-test/${migration.import.file.name}</migration.import.file>
</properties> </properties>
</profile> </profile>