-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
area/testsuiteIndicates an issue on the Testsuite areaIndicates an issue on the Testsuite areahelp wantedkind/bugCategorizes a PR related to a bugCategorizes a PR related to a bugpriority/normalrelease/26.3.0status/auto-bumpstatus/auto-expireteam/cloud-native
Description
Before reporting an issue
- I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.
Area
testsuite
Describe the bug
When making a distribution run with non-zero exit in the testsuite the RawKeycloakDistribution
does not provide correct exit code.
Version
main
Regression
- The issue is a regression
Expected behavior
When running this distribution run:
keycloak/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/UpdateCommandDistTest.java
Line 96 in 3c0fc83
var result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, UpdateCompatibilityCheck.INPUT_OPTION_NAME, jsonFile.getAbsolutePath(), ENABLE_FEATURE); |
the expected call to result.exitCode()
should return non-zero exit code.
Actual behavior
The run return 0.
How to Reproduce?
Run the following test in debug mode:
keycloak/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/UpdateCommandDistTest.java
Lines 87 to 107 in 3c0fc83
public void testWrongVersions(KeycloakDistribution distribution) throws IOException { | |
var jsonFile = createTempFile("wrong-versions"); | |
// incompatible keycloak version | |
var info = new ServerInfo(); | |
info.setVersions(Map.of(CompatibilityManagerImpl.KEYCLOAK_VERSION_KEY, "0.0.0.Final", | |
CompatibilityManagerImpl.INFINISPAN_VERSION_KEY, org.infinispan.commons.util.Version.getVersion())); | |
JsonSerialization.mapper.writeValue(jsonFile, info); | |
var result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, UpdateCompatibilityCheck.INPUT_OPTION_NAME, jsonFile.getAbsolutePath(), ENABLE_FEATURE); | |
result.assertError("[Versions] Rolling Upgrade is not available. 'keycloak' is incompatible: Old=0.0.0.Final, New=%s".formatted(Version.VERSION)); | |
// incompatible infinispan version | |
info.setVersions(Map.of( | |
CompatibilityManagerImpl.KEYCLOAK_VERSION_KEY, Version.VERSION, | |
CompatibilityManagerImpl.INFINISPAN_VERSION_KEY, "0.0.0.Final")); | |
JsonSerialization.mapper.writeValue(jsonFile, info); | |
result = distribution.run(UpdateCompatibility.NAME, UpdateCompatibilityCheck.NAME, UpdateCompatibilityCheck.INPUT_OPTION_NAME, jsonFile.getAbsolutePath(), ENABLE_FEATURE); | |
result.assertError("[Versions] Rolling Upgrade is not available. 'infinispan' is incompatible: Old=0.0.0.Final, New=%s".formatted(org.infinispan.commons.util.Version.getVersion())); | |
} |
The result on line 96 should have non-zero exit code, however, the exit code is 0.
Anything else?
No response
keycloak-github-bot
Metadata
Metadata
Assignees
Labels
area/testsuiteIndicates an issue on the Testsuite areaIndicates an issue on the Testsuite areahelp wantedkind/bugCategorizes a PR related to a bugCategorizes a PR related to a bugpriority/normalrelease/26.3.0status/auto-bumpstatus/auto-expireteam/cloud-native