Run new framework db testsuite on Aurora

Closes #41940

Signed-off-by: Simon Vacek <simonvacky@email.cz>
This commit is contained in:
Šimon Vacek
2026-01-22 20:14:54 +01:00
committed by GitHub
parent e278a2f6fd
commit 8f0cbcb244
5 changed files with 99 additions and 7 deletions
+3
View File
@@ -0,0 +1,3 @@
DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO public;
+49 -5
View File
@@ -480,9 +480,9 @@ jobs:
echo "aurora-cluster-password=${PASS}" >> $GITHUB_OUTPUT
echo "region=${AWS_REGION}" >> $GITHUB_OUTPUT
curl --fail-with-body https://truststore.pki.rds.amazonaws.com/${AWS_REGION}/${AWS_REGION}-bundle.pem -o aws.pem
PROPS+=' -Dkeycloak.connectionsJpa.jdbcParameters=\"?ssl=true&sslmode=verify-ca&sslrootcert=/opt/keycloak/aws.pem\"'
echo "maven_properties=${PROPS}" >> $GITHUB_OUTPUT
JDBC_PARAMS='?ssl=true&sslmode=verify-ca&sslrootcert=/opt/keycloak/aws.pem'
echo "jdbc_params=${JDBC_PARAMS}" >> $GITHUB_OUTPUT
- id: aurora-create
name: Create Aurora DB
@@ -520,8 +520,8 @@ jobs:
run: |
EC2_CLUSTER_NAME=${{ steps.ec2-create.outputs.ec2_cluster }}
AWS_REGION=${{ steps.aurora-init.outputs.region }}
PROPS='${{ steps.aurora-init.outputs.maven_properties }}'
PROPS="-Dkeycloak.connectionsJpa.jdbcParameters=\"${{ steps.aurora-init.outputs.jdbc_params }}\""
PROPS+=" -Dauth.server.db.host=${{ steps.aurora-create.outputs.endpoint }} -Dkeycloak.connectionsJpa.password=${{ steps.aurora-init.outputs.aurora-cluster-password }}"
PROPS+=" -Djdbc.mvn.groupId=software.amazon.jdbc -Djdbc.mvn.artifactId=aws-advanced-jdbc-wrapper -Djdbc.mvn.version=2.3.1 -Djdbc.driver.tmp.dir=target/unpacked/keycloak-${{ env.old-version }}/providers"
@@ -553,7 +553,7 @@ jobs:
run: |
EC2_CLUSTER_NAME=${{ steps.ec2-create.outputs.ec2_cluster }}
AWS_REGION=${{ steps.aurora-init.outputs.region }}
PROPS='${{ steps.aurora-init.outputs.maven_properties }}'
PROPS="-Dkeycloak.connectionsJpa.jdbcParameters=\"${{ steps.aurora-init.outputs.jdbc_params }}\""
PROPS+=" -Dauth.server.db.host=${{ steps.aurora-create.outputs.endpoint }} -Dkeycloak.connectionsJpa.password=${{ steps.aurora-init.outputs.aurora-cluster-password }}"
TESTS=`testsuite/integration-arquillian/tests/base/testsuites/suite.sh database`
@@ -581,6 +581,50 @@ jobs:
name: aurora-integration-tests-mvn-logs
path: .github/scripts/ansible/files
- name: Clear Aurora DB schema
id: aurora-clear-db-schema
run: |
EC2_CLUSTER_NAME=${{ steps.ec2-create.outputs.ec2_cluster }}
AWS_REGION=${{ steps.aurora-init.outputs.region }}
cd .github/scripts/ansible
./mvn_remote_runner.sh ${AWS_REGION} ${EC2_CLUSTER_NAME} "-Pexecute-sql -f tests/base/pom.xml sql:execute@clear-schema -Dautocommit=true -Ddriver=software.amazon.jdbc.Driver -Durl=\"jdbc:aws-wrapper:postgresql://${{ steps.aurora-create.outputs.endpoint }}/keycloak${{ steps.aurora-init.outputs.jdbc_params }}\" -Dusername=keycloak -Dpassword=${{ steps.aurora-init.outputs.aurora-cluster-password }}"
- name: Run Aurora new database tests on EC2
id: aurora-new-integration-tests
run: |
EC2_CLUSTER_NAME=${{ steps.ec2-create.outputs.ec2_cluster }}
AWS_REGION=${{ steps.aurora-init.outputs.region }}
PROPS="-Dkc.test.database=remote -Dkc.test.database.vendor=postgres"
PROPS+=" -Dkc.test.database.user=keycloak"
PROPS+=" -Dkc.test.database.password=${{ steps.aurora-init.outputs.aurora-cluster-password }}"
PROPS+=" -Dkc.test.database.url=\"jdbc:aws-wrapper:postgresql://${{ steps.aurora-create.outputs.endpoint }}/keycloak${{ steps.aurora-init.outputs.jdbc_params }}\""
PROPS+=" -Dkc.test.database.driver=software.amazon.jdbc.Driver"
PROPS+=" -Dkc.test.database.driver.artifact=software.amazon.jdbc:aws-advanced-jdbc-wrapper"
cd .github/scripts/ansible
./mvn_remote_runner.sh ${AWS_REGION} ${EC2_CLUSTER_NAME} "$PROPS package -f tests/pom.xml -Dtest=DatabaseTestSuite"
# Copy returned surefire-report directories to workspace root to ensure they're discovered
results=(files/keycloak/results/*)
rsync -a $results/* ../../../
rm -rf $results
- uses: ./.github/actions/upload-flaky-tests
name: Upload flaky tests
env:
GH_TOKEN: ${{ github.token }}
with:
job-name: AuroraDB IT
- name: EC2 Maven Logs
if: failure()
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: aurora-new-integration-tests-mvn-logs
path: .github/scripts/ansible/files
- name: Delete EC2 Instance
if: always()
working-directory: .github/scripts/ansible
+43
View File
@@ -84,6 +84,11 @@
<groupId>org.keycloak.testframework</groupId>
<artifactId>keycloak-test-framework-db-tidb</artifactId>
</dependency>
<dependency>
<groupId>software.amazon.jdbc</groupId>
<artifactId>aws-advanced-jdbc-wrapper</artifactId>
<version>${aws-jdbc-wrapper.version}</version>
</dependency>
<dependency>
<groupId>org.keycloak.testframework</groupId>
<artifactId>keycloak-test-framework-email-server</artifactId>
@@ -134,4 +139,42 @@
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>execute-sql</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sql-maven-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>software.amazon.jdbc</groupId>
<artifactId>aws-advanced-jdbc-wrapper</artifactId>
<version>${aws-jdbc-wrapper.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql-jdbc.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>clear-schema</id>
<configuration>
<srcFiles>
<srcFile>../../.github/scripts/aws/rds/pg_clear.sql</srcFile>
</srcFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
@@ -12,9 +12,10 @@ import org.keycloak.testframework.server.KeycloakServerConfig;
import org.keycloak.testframework.server.KeycloakServerConfigBuilder;
@KeycloakIntegrationTest(config = CaseSensitiveSchemaTest.CaseSensitiveServerConfig.class)
// Remotely running databases do not support running SQL init scripts.
// MSSQL does not support setting the default schema per session
// TiDb does not support setting the default schema per session.
@DisabledForDatabases({"mssql", "tidb"})
@DisabledForDatabases({ "remote", "mssql", "tidb" })
public class CaseSensitiveSchemaTest extends AbstractDBSchemaTest {
@InjectTestDatabase(config = CaseSensitiveDatabaseConfig.class)
@@ -13,10 +13,11 @@ import org.keycloak.testframework.server.KeycloakServerConfig;
import org.keycloak.testframework.server.KeycloakServerConfigBuilder;
@KeycloakIntegrationTest(config = PreserveSchemaCaseLiquibaseTest.PreserveSchemaCaseServerConfig.class)
// Remotely running databases do not support running SQL init scripts.
// MSSQL does not support setting the default schema per session.
// TiDb does not support setting the default schema per session.
// Oracle image does not support configuring user/databases with '-'
@DisabledForDatabases({ "mssql", "oracle", "tidb" })
@DisabledForDatabases({ "remote", "mssql", "oracle", "tidb" })
public class PreserveSchemaCaseLiquibaseTest extends AbstractDBSchemaTest {
@InjectTestDatabase(config = PreserveSchemaCaseDatabaseConfig.class, lifecycle = LifeCycle.CLASS)