keycloak-scim/testsuite/integration-arquillian/tests/other/server-config-migration
2018-05-02 14:32:20 +02:00
..
src KEYCLOAK-5678 configs for rh-sso and keycloak are different, skip test interfaces for now 2017-11-14 11:27:03 +01:00
pom.xml Bump version to 4.0.0.Beta3-SNAPSHOT (#5185) 2018-05-02 14:32:20 +02:00
README.md KEYCLOAK-5672 rewrite server-config-migration module to use offline mode 2017-10-16 22:51:59 +02:00

Keycloak Server Config Migration Testsuite

Test workflow

There are performed several steps before actual test is executed. The steps are divided into different maven lifecycle phases to make sure it goes in specified wanted order.

process-resources

Unpack clean keycloak-server-dist

compile

Copy standalone/domain resources to ${jbossHome}/standalone/configuration and ${jbossHome}/domain/configuration

process-classes

maven-exec-plugin is used to read current master configs and saves the output to ${project.build.directory}/master-${config.name}.txt

generate-test-sources

Files ${jbossHome}/standalone/configuration/keycloak-server.json and ${jbossHome}/domain/configuration/keycloak-server.json are created.

Configuration files (standalone.xml, standalone-ha.xml, domain.xml, host-master.xml) are overwritten by those from previous version.

process-test-sources

Migration scripts are applied using offline mode. Temporary data are removed.

generate-test-resources

wildfly-maven-plugin is used to start and shutdown container with different configs. It is done to let subsystems to upgrade themselves during first run.

process-test-resources

maven-exec-plugin is used to read migrated configs and saves the output to ${project.build.directory}/migrated-${config.name}.txt

default-test

org.keycloak.test.config.migrationConfigMigrationTest is executed. It compares generated outputs from ${project.build.directory}

If config outputs don't equal to each other, by default the test will compare outputs more deeply to get more readable output. It fails on first found difference.

This can be overwritten by adding property: -Dget.simple.full.comparison=true to the test command. In that case it'll perform assert on the two config outputs.

Properties

maven

  • jbossHome
    • default: ${project.build.directory}/keycloak-${project.version}
    • specifies path to jbossHome dir
  • migrated.version
    • default: 1.8.1
    • specifies version it is migrated from
  • master.version
    • default: ${project.version}
    • specifies version it is migrated to

How to run tests

note: keycloak-server-dist module has to be build first (mvn install -f keycloak/pom.xml -Pdistribution)

  • mvn clean install tests migration from 1.8.1.Final to current master. It goes thru whole test workflow. Deep comparison is done.
  • mvn clean install -Dget.simple.full.comparison=true does assert on outputs instead of deep comparison.
  • mvn clean process-test-sources -Dskip.rename.configs=true applies migration scripts to current master. It can be used to make sure the current keycloak version doesn't break the scripts.
  • mvn clean install -Dskip.rename.configs=true applies scripts to current master and verifies the scripts doesn't actually change anything.