Upgrade old Keycloak version for DB migration tests (#29884)

Closes #29883

Signed-off-by: Martin Bartoš <mabartos@redhat.com>
This commit is contained in:
Martin Bartoš 2024-05-28 11:32:31 +02:00 committed by GitHub
parent 66ef3bf2d7
commit d396dfed6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5891 additions and 10 deletions

View file

@ -763,7 +763,7 @@ jobs:
timeout-minutes: 45 timeout-minutes: 45
strategy: strategy:
matrix: matrix:
old-version: [19.0.3] old-version: [24.0.4]
database: [postgres, mysql, oracle, mssql, mariadb] database: [postgres, mysql, oracle, mssql, mariadb]
fail-fast: false fail-fast: false
steps: steps:

View file

@ -177,15 +177,7 @@ public class KeycloakQuarkusServerDeployableContainer extends AbstractQuarkusDep
private ProcessBuilder getProcessBuilder() { private ProcessBuilder getProcessBuilder() {
Map<String, String> env = new HashMap<>(); Map<String, String> env = new HashMap<>();
String[] processCommands = getArgs(env).toArray(new String[0]); String[] processCommands = getArgs(env).toArray(new String[0]);
if (suiteContext.get().isAuthServerMigrationEnabled() && configuration.getImportFile() != null) {
for (int i = 0; i < processCommands.length; i++) {
if (processCommands[i].startsWith("--db-url=")) {
processCommands[i]= "--db-url=\"" + processCommands[i].substring(9) + "\"";
}
}
}
ProcessBuilder pb = new ProcessBuilder(processCommands); ProcessBuilder pb = new ProcessBuilder(processCommands);
pb.environment().putAll(env); pb.environment().putAll(env);
return pb; return pb;

View file

@ -28,7 +28,7 @@ import java.util.List;
import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER; import static org.keycloak.testsuite.auth.page.AuthRealm.MASTER;
/** /**
* Test for DB migration with legacy JPA store * Test for DB migration with the JPA store
* *
* @author <a href="mailto:vramik@redhat.com">Vlastislav Ramik</a> * @author <a href="mailto:vramik@redhat.com">Vlastislav Ramik</a>
*/ */
@ -72,4 +72,16 @@ public class MigrationTest extends AbstractMigrationTest {
testMigrationTo24_x(true, true); testMigrationTo24_x(true, true);
testMigrationTo25_0_0(); testMigrationTo25_0_0();
} }
@Test
@Migration(versionPrefix = "24.")
public void migration24_xTest() throws Exception{
testMigratedData(false);
// Always test offline-token login during migration test
testOfflineTokenLogin();
testExtremelyLongClientAttribute(migrationRealm);
testMigrationTo25_0_0();
}
} }