Skip to content

Commit

Permalink
KEYCLOAK-8837 Adapt TS to be able to test migration from 7.2.5.GA (in…
Browse files Browse the repository at this point in the history
…stead from 7.2.0.GA)
  • Loading branch information
vramik authored and stianst committed Nov 19, 2018
1 parent dc06a8c commit 55f90ff
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 60,7 @@ target
# 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.
#node_modules

# testsuite #
#############
*offline-token.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 17,7 @@

<assembly>

<id>auth-server-jboss-${migrated.auth.server.version}</id>
<id>auth-server-migration-${migrated.auth.server.version}</id>

<formats>
<format>zip</format>
Expand All @@ -28,14 28,14 @@
<fileSets>
<fileSet>
<directory>${keycloak.server.home}</directory>
<outputDirectory>keycloak-${migrated.auth.server.version}</outputDirectory>
<outputDirectory>auth-server-migration</outputDirectory>
<excludes>
<exclude>**/*.sh</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${keycloak.server.home}</directory>
<outputDirectory>keycloak-${migrated.auth.server.version}</outputDirectory>
<outputDirectory>auth-server-migration</outputDirectory>
<includes>
<include>**/*.sh</include>
</includes>
Expand Down
2 changes: 1 addition & 1 deletion testsuite/integration-arquillian/servers/migration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 31,7 @@

<properties>
<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>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 73,7 @@

<xsl:variable name="newDriverDefinition">
<xsl:if test="$driver != 'h2'">
<driver name="{$driver}" module="com.{$driver}"/>
<driver name="{$driver}" module="test.jdbc.{$driver}"/>
</xsl:if>
</xsl:variable>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 27,7 @@
<xsl:param name="version" select="''"/>

<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>
<resource-root path="{$database}-{$version}.jar"/>
</resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 43,7 @@ public ExecutionDecision decide(Method method) {

String versionFrom = migrationAnnotation.versionFrom();

if (migratedAuthServerVersion.contains(versionFrom)) {
if (migratedAuthServerVersion.startsWith(versionFrom)) {
return ExecutionDecision.execute();
} else {
return ExecutionDecision.dontExecute(method.getName() "doesn't fit with migration version.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 68,23 @@ private void addTestRealmToTestRealmReps(RealmResource realm) {
}

@Test
@Migration(versionFrom = "3.4.3.Final")
public void migration3_4_3Test() {
@Migration(versionFrom = "3.")
public void migration3_xTest() {
testMigratedData();
testMigrationTo4_x();
}

@Test
@Migration(versionFrom = "2.5.5.Final")
public void migration2_5_5Test() {
@Migration(versionFrom = "2.")
public void migration2_xTest() {
testMigratedData();
testMigrationTo3_x();
testMigrationTo4_x();
}

@Test
@Migration(versionFrom = "1.9.8.Final")
public void migration1_9_8Test() throws Exception {
@Migration(versionFrom = "1.")
public void migration1_xTest() throws Exception {
testMigratedData(false);
testMigrationTo2_x();
testMigrationTo3_x();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 122,6 @@
-Dauth.server.https.port=${auth.server.https.port}
-Dkeycloak.password.blacklists.path=${keycloak.password.blacklists.path}
${adapter.test.props}
${migration.import.properties}
${auth.server.profile}
${auth.server.feature}
${kie.maven.settings}
Expand Down
12 changes: 4 additions & 8 deletions testsuite/integration-arquillian/tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 141,6 @@
-Djava.security.krb5.conf=${project.build.directory}/dependency/kerberos/test-krb5.conf
</adapter.test.props>

<migration.import.properties/>
<examples.home>${project.build.directory}/examples</examples.home>
<examples.basedir>${keycloak-parent.basedir}/examples</examples.basedir> <!--keycloak/examples directory-->
<examples.version.suffix>${project.version}</examples.version.suffix>
Expand Down Expand Up @@ -463,7 462,6 @@
<examples.home>${examples.home}</examples.home>
<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>

<testsuite.constants>${testsuite.constants}</testsuite.constants>
Expand Down Expand Up @@ -497,8 495,6 @@
<appium.fullReset>${appium.fullReset}</appium.fullReset>

<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.keystore>${client.certificate.keystore}</client.certificate.keystore>
Expand Down Expand Up @@ -1345,7 1341,7 @@
<systemPropertyVariables>
<migrated.auth.server.version>${migrated.auth.server.version}</migrated.auth.server.version>
<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>
</systemPropertyVariables>
</configuration>
Expand All @@ -1356,14 1352,14 @@
</profile>

<profile>
<id>migration-productized</id>
<id>migration-prod</id>
<activation>
<property>
<name>migrated.version.import.file.suffix</name>
<name>migration.import.file.name</name>
</property>
</activation>
<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>
</profile>

Expand Down

0 comments on commit 55f90ff

Please sign in to comment.