8000 Migrate CLI package to new test framework by michalvavrik · Pull Request #52007 · keycloak/keycloak · GitHub
[go: up one dir, main page]

Skip to content

Migrate CLI package to new test framework - #52007

Merged
shawkins merged 1 commit into
keycloak:mainfrom
michalvavrik:in-review/50756
Sep 4, 2026
Merged

shawkins merged 1 commit into
keycloak:mainfrom
michalvavrik:in-review/50756

Conversation

@michalvavrik
Copy link
Copy Markdown
Member

Copilot AI balanced review requested due to automatic review settings August 24, 2026 21:11
@michalvavrik
michalvavrik requested review from a team as code owners August 24, 2026 21:11
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates CLI integration tests from Arquillian into the new tests/base framework.

Changes:

  • Ports kcadm/kcreg tests, fixtures, and process utilities.
  • Registers CLI tests in base, FIPS, and session suites.
  • Removes obsolete Arquillian CLI coverage.

Reviewed changes

Copilot reviewed 38 out of 46 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
testsuite/integration-arquillian/tests/base/testsuites/volatile-sessions-suite Removes migrated CLI test.
testsuite/integration-arquillian/tests/base/testsuites/fips-suite Removes migrated FIPS tests.
testsuite/integration-arquillian/tests/base/testsuites/clusterless-suite Removes migrated CLI test.
testsuite/integration-arquillian/tests/base/testsuites/base-suite Removes legacy CLI group.
testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/cli/AbstractCliTest.java Deletes legacy base class.
testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/cli/OsUtils.java Removes redundant OS utility.
testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/cli/OsArch.java Removes redundant OS model.
testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/cli/exec/NullInputStream.java Removes obsolete stream helper.
testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/cli/exec/ExecutionException.java Removes obsolete exception.
tests/base/src/test/resources/org/keycloak/tests/cli/testrealm.json Adds CLI test realm fixture.
tests/base/src/test/resources/org/keycloak/tests/cli/kcreg/saml-sp-metadata.xml Adds SAML registration fixture.
tests/base/src/test/resources/org/keycloak/tests/cli/kcreg/reg-cli-keystore.p12 Adds PKCS12 registration key.
tests/base/src/test/resources/org/keycloak/tests/cli/kcreg/reg-cli-keystore.jks Adds JKS registration key.
tests/base/src/test/resources/org/keycloak/tests/cli/kcadm/admin-cli-keystore.p12 Adds PKCS12 admin key.
tests/base/src/test/resources/org/keycloak/tests/cli/kcadm/admin-cli-keystore.jks Adds JKS admin key.
tests/base/src/test/resources/org/keycloak/tests/cli/idp-keycloak-without-sync-mode.json Adds IdP creation fixture.
tests/base/src/test/resources/org/keycloak/tests/cli/idp-keycloak-9167.json Adds IdP update fixture.
tests/base/src/test/java/org/keycloak/tests/suites/VolatileSessionsTestSuite.java Registers CLI session coverage.
tests/base/src/test/java/org/keycloak/tests/suites/FipsStrictTestSuite.java Registers strict-FIPS CLI tests.
tests/base/src/test/java/org/keycloak/tests/suites/FipsNonStrictTestSuite.java Registers non-strict FIPS tests.
tests/base/src/test/java/org/keycloak/tests/suites/ClusterlessTestSuite.java Registers clusterless CLI coverage.
tests/base/src/test/java/org/keycloak/tests/suites/Base2TestSuite.java Includes the CLI package.
tests/base/src/test/java/org/keycloak/tests/cli/TempFileResource.java Adds temporary-file cleanup helper.
tests/base/src/test/java/org/keycloak/tests/cli/registration/KcRegUpdateTokenTest.java Migrates token-update tests.
tests/base/src/test/java/org/keycloak/tests/cli/registration/KcRegUpdateTest.java Migrates registration updates.
tests/base/src/test/java/org/keycloak/tests/cli/registration/KcRegTruststoreTest.java Migrates truststore tests.
tests/base/src/test/java/org/keycloak/tests/cli/registration/KcRegTest.java Migrates core kcreg tests.
tests/base/src/test/java/org/keycloak/tests/cli/registration/KcRegCreateTest.java Migrates registration creation.
tests/base/src/test/java/org/keycloak/tests/cli/registration/KcRegConfigTest.java Migrates configuration tests.
tests/base/src/test/java/org/keycloak/tests/cli/registration/AbstractRegCliTest.java Adapts registration fixtures.
tests/base/src/test/java/org/keycloak/tests/cli/KcRegExec.java Adapts kcreg process execution.
tests/base/src/test/java/org/keycloak/tests/cli/KcAdmExec.java Adapts kcadm process execution.
tests/base/src/test/java/org/keycloak/tests/cli/exec/StreamReaderThread.java Moves process stream reader.
tests/base/src/test/java/org/keycloak/tests/cli/exec/LoggingOutputStream.java Moves logging stream helper.
tests/base/src/test/java/org/keycloak/tests/cli/exec/InteractiveInputStream.java Moves interactive input helper.
tests/base/src/test/java/org/keycloak/tests/cli/exec/AbstractExecBuilder.java Moves process builder.
tests/base/src/test/java/org/keycloak/tests/cli/exec/AbstractExec.java Adds framework-aware execution support.
tests/base/src/test/java/org/keycloak/tests/cli/admin/KcAdmUpdateTest.java Migrates admin update tests.
tests/base/src/test/java/org/keycloak/tests/cli/admin/KcAdmTruststoreTest.java Migrates admin truststore tests.
tests/base/src/test/java/org/keycloak/tests/cli/admin/KcAdmTest.java Migrates core kcadm tests.
tests/base/src/test/java/org/keycloak/tests/cli/admin/KcAdmSessionTest.java Migrates session tests.
tests/base/src/test/java/org/keycloak/tests/cli/admin/KcAdmCreateTest.java Migrates admin creation tests.
tests/base/src/test/java/org/keycloak/tests/cli/admin/AbstractAdmCliTest.java Adapts admin fixtures.
tests/base/src/test/java/org/keycloak/tests/cli/AbstractCliTest.java Adds new-framework CLI base.
tests/base/pom.xml Adds CLI dependencies and distributions.
Suppressed comments (2)

tests/base/src/test/java/org/keycloak/tests/cli/admin/KcAdmTruststoreTest.java:51

  • This HTTPS branch uses the migrated Arquillian truststore, but TlsEnabledConfig leaves ManagedCertificates to generate a fresh random server certificate, so that store cannot trust the server and the -Dtest.intermittent=true path fails with PKIX errors. Configure the test server with the matching migrated key material, or make the generated client truststore available to the CLI test.
    tests/base/src/test/java/org/keycloak/tests/cli/registration/KcRegTruststoreTest.java:51
  • This HTTPS branch uses the migrated Arquillian truststore, but TlsEnabledConfig leaves ManagedCertificates to generate a fresh random server certificate, so that store cannot trust the server and the -Dtest.intermittent=true path fails with PKIX errors. Configure the test server with the matching migrated key material, or make the generated client truststore available to the CLI test.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/base/pom.xml
Comment on lines +160 to +164
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-cli</artifactId>
<scope>test</scope>
</dependency>
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mvn clean install -pl tests/base -am is passing even when I delete keycloak-client-cli-dist-999.0.0-SNAPSHOT.zip from my local .m2. keycloak-client-cli-dist gets in via fw

edewit
edewit previously approved these changes Aug 25, 2026
shawkins
shawkins previously approved these changes Aug 26, 2026
@shawkins shawkins left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @michalvavrik

@shawkins
Copy link
Copy Markdown
Contributor

Let's see if anyone else wants to weigh in from a core team given that they were tagged as reviewers, and if not we'll go ahead and merge by end of week.

Copilot AI review requested due to automatic review settings August 29, 2026 15:31
@michalvavrik
michalvavrik dismissed stale reviews from shawkins and edewit via a07947c August 29, 2026 15:31
@michalvavrik
Copy link
Copy Markdown
Member Author

I resolved merge conflict with testsuite/integration-arquillian/tests/base/testsuites/clusterless-suite, no changes in code. And then, I suggest to just merge it, I am reasonably sure these tests are testing the same thing, I focused on that.

Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 38 out of 46 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

tests/base/src/test/java/org/keycloak/tests/cli/admin/KcAdmTruststoreTest.java:52

  • TlsEnabledConfig generates a fresh random server certificate, but this HTTPS call configures the copied legacy keycloak.truststore. The truststore cannot contain that runtime-generated certificate, so the -Dtest.intermittent=true branch will fail TLS validation; configure the server with a certificate trusted by this store or make the generated client truststore available to the CLI.
    tests/base/src/test/java/org/keycloak/tests/cli/registration/KcRegTruststoreTest.java:52
  • TlsEnabledConfig generates a fresh random server certificate, but this HTTPS call configures the copied legacy keycloak.truststore. The truststore cannot contain that runtime-generated certificate, so the -Dtest.intermittent=true branch will fail TLS validation; configure the server with a certificate trusted by this store or make the generated client truststore available to the CLI.

Copilot AI review requested due to automatic review settings August 29, 2026 15:41
Copilot AI left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 47 changed files in this pull request and generated no new comments.

Suppressed comments (1)

tests/base/src/test/java/org/keycloak/tests/cli/registration/KcRegCreateTest.java:75

  • This stores the initial token under the HTTPS keycloakUrls.getBase() endpoint, but the delete and verification later in this method use the HTTP serverUrl. Consequently the HTTPS token is never deleted and the assertion only checks a different, already-empty endpoint; use the same server URL for all three operations.

closes: keycloak#50756

Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
@shawkins
shawkins enabled auto-merge (squash) September 4, 2026 11:44
@shawkins
shawkins self-requested a review September 4, 2026 11:44
@shawkins shawkins left a comment •
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shawkins
shawkins merged commit 4503201 into keycloak:main Sep 4, 2026
97 checks passed
@michalvavrik
michalvavrik deleted the in-review/50756 branch September 4, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate cli package to the new test framework

4 participants

0