+
Skip to content

Conversation

hmlnarik
Copy link
Contributor

@hmlnarik hmlnarik commented Jun 11, 2024

⚠️ EDIT: Since the functional changes have been merged in #31402, this PR has changed to testsuite-only changes. ⚠️

The fixes (mostly selectors) needed for tests.

In the future, to switch the default login theme to keycloak.v2, do the following:

  • Update ThemeSelectorProvider: Uncomment the relevant lines
  • Update testsuite/integration-arquillian/tests/pom.xml: Revert the change in <login.theme.default> property
  • Update ThemeSelectorTest per comment
  • Update UncaughtErrorPageTest per comment

With the prior removal of alpine.js, htmlunit is used again, and the workflow run times are similar to those with original keycloak login theme

Fixes: #29009

Copy link

@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#multiTenant1SamlTest

Keycloak CI - Base IT

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for wrapped: text ('principal=user-tenant1') to be present in text in element found by By.xpath: //body (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1021-azure', java.version: '21.0.3'
Driver info: org.openqa.selenium.chrome.ChromeDriver_ByGraphene
...

Report flaky test

@hmlnarik hmlnarik force-pushed the 29009-Switch-login-theme-to-keycloak-v2-Stabilize-testsuite-after-the-switch-main branch 5 times, most recently from f27f246 to 082f0d2 Compare June 11, 2024 12:03
Copy link

@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest#claimIsPropagatedOnAllLoginsWhenNameMatchesAndSyncModeIsForce

Keycloak CI - Store IT

java.lang.RuntimeException: Failed to deserialize token
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.toAccessToken(OidcClaimToUserSessionNoteMapperTest.java:154)
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.login(OidcClaimToUserSessionNoteMapperTest.java:145)
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.claimIsPropagatedOnAllLoginsWhenNameMatchesAndSyncModeIsForce(OidcClaimToUserSessionNoteMapperTest.java:109)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
...

Report flaky test

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#multiTenant1SamlTest

Keycloak CI - Base IT

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for wrapped: text ('principal=user-tenant1') to be present in text in element found by By.xpath: //body (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1021-azure', java.version: '21.0.3'
Driver info: org.openqa.selenium.chrome.ChromeDriver_ByGraphene
...

Report flaky test

@hmlnarik hmlnarik force-pushed the 29009-Switch-login-theme-to-keycloak-v2-Stabilize-testsuite-after-the-switch-main branch from 173151e to 6bee030 Compare June 11, 2024 16:15
Copy link

@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest#claimIsPropagatedOnFirstLoginOnlyWhenNameMatchesAndSyncModeIsImport

Keycloak CI - Store IT

java.lang.RuntimeException: Failed to deserialize token
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.toAccessToken(OidcClaimToUserSessionNoteMapperTest.java:154)
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.login(OidcClaimToUserSessionNoteMapperTest.java:145)
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.claimIsPropagatedOnFirstLoginOnlyWhenNameMatchesAndSyncModeIsImport(OidcClaimToUserSessionNoteMapperTest.java:98)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
...
java.lang.RuntimeException: Failed to deserialize token
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.toAccessToken(OidcClaimToUserSessionNoteMapperTest.java:154)
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.login(OidcClaimToUserSessionNoteMapperTest.java:145)
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.claimIsPropagatedOnFirstLoginOnlyWhenNameMatchesAndSyncModeIsImport(OidcClaimToUserSessionNoteMapperTest.java:98)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
...

Report flaky test

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#multiTenant1SamlTest

Keycloak CI - Base IT

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for wrapped: text ('principal=user-tenant1') to be present in text in element found by By.xpath: //body (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1021-azure', java.version: '21.0.3'
Driver info: org.openqa.selenium.chrome.ChromeDriver_ByGraphene
...

Report flaky test

Copy link

@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#multiTenant1SamlTest

Keycloak CI - Base IT

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for wrapped: text ('principal=user-tenant1') to be present in text in element found by By.xpath: //body (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1021-azure', java.version: '21.0.3'
Driver info: org.openqa.selenium.chrome.ChromeDriver_ByGraphene
...

Report flaky test

@hmlnarik hmlnarik force-pushed the 29009-Switch-login-theme-to-keycloak-v2-Stabilize-testsuite-after-the-switch-main branch from 9e7a645 to 2d55a1f Compare June 11, 2024 18:59
Copy link

@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#multiTenant1SamlTest

Keycloak CI - Base IT

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for wrapped: text ('principal=user-tenant1') to be present in text in element found by By.xpath: //body (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1021-azure', java.version: '21.0.3'
Driver info: org.openqa.selenium.chrome.ChromeDriver_ByGraphene
...

Report flaky test

Copy link

@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest#claimIsPropagatedOnAllLoginsWhenNameMatchesAndSyncModeIsForce

Keycloak CI - Store IT

java.lang.RuntimeException: Failed to deserialize token
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.toAccessToken(OidcClaimToUserSessionNoteMapperTest.java:154)
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.login(OidcClaimToUserSessionNoteMapperTest.java:145)
	at org.keycloak.testsuite.broker.OidcClaimToUserSessionNoteMapperTest.claimIsPropagatedOnAllLoginsWhenNameMatchesAndSyncModeIsForce(OidcClaimToUserSessionNoteMapperTest.java:119)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
...

Report flaky test

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#multiTenant1SamlTest

Keycloak CI - Base IT

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for wrapped: text ('principal=user-tenant1') to be present in text in element found by By.xpath: //body (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1021-azure', java.version: '21.0.3'
Driver info: org.openqa.selenium.chrome.ChromeDriver_ByGraphene
...

Report flaky test

@hmlnarik hmlnarik force-pushed the 29009-Switch-login-theme-to-keycloak-v2-Stabilize-testsuite-after-the-switch-main branch from 2d55a1f to 718c817 Compare June 12, 2024 07:48
Copy link

@keycloak-github-bot keycloak-github-bot bot left a comment

Choose a reason for hiding this comment

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

Unreported flaky test detected, please review

@keycloak-github-bot
Copy link

Unreported flaky test detected

If the flaky tests below are affected by the changes, please review and update the changes accordingly. Otherwise, a maintainer should report the flaky tests prior to merging the PR.

org.keycloak.testsuite.adapter.servlet.SAMLServletAdapterTest#multiTenant1SamlTest

Keycloak CI - Base IT

org.openqa.selenium.TimeoutException: 
Expected condition failed: waiting for wrapped: text ('principal=user-tenant1') to be present in text in element found by By.xpath: //body (tried for 5 second(s) with 500 milliseconds interval)
Build info: version: '4.21.0', revision: '79ed462ef4'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '6.5.0-1021-azure', java.version: '21.0.3'
Driver info: org.openqa.selenium.chrome.ChromeDriver_ByGraphene
...

Report flaky test

@hmlnarik hmlnarik force-pushed the 29009-Switch-login-theme-to-keycloak-v2-Stabilize-testsuite-after-the-switch-main branch from 718c817 to dea8f2c Compare June 12, 2024 09:14
@hmlnarik hmlnarik force-pushed the 29009-Switch-login-theme-to-keycloak-v2-Stabilize-testsuite-after-the-switch-main branch from c911eaf to 62103be Compare July 17, 2024 08:24
@hmlnarik hmlnarik changed the title Switch login theme to keycloak v2 Switch login theme to keycloak v2 (removed alpine.js) Jul 17, 2024
@hmlnarik hmlnarik force-pushed the 29009-Switch-login-theme-to-keycloak-v2-Stabilize-testsuite-after-the-switch-main branch 2 times, most recently from 49ace1f to 36d9e32 Compare July 17, 2024 08:59
@hmlnarik
Copy link
Contributor Author

@stianst @vmuzikar The issue with the workflow run time has been addressed. Can you please revisit your review?

@hmlnarik hmlnarik marked this pull request as ready for review July 17, 2024 13:02
edewit
edewit previously approved these changes Jul 18, 2024
@hmlnarik
Copy link
Contributor Author

This PR is being split into #31402 and the testsuite and GHA changes which will be present here.

@hmlnarik hmlnarik marked this pull request as draft July 18, 2024 10:19
@hmlnarik hmlnarik force-pushed the 29009-Switch-login-theme-to-keycloak-v2-Stabilize-testsuite-after-the-switch-main branch from 36d9e32 to 259831b Compare July 19, 2024 14:03
@hmlnarik hmlnarik changed the title Switch login theme to keycloak v2 (removed alpine.js) Switch testsuite to test with keycloak v2 login theme Jul 19, 2024
The fixes (mostly selectors) are needed for tests.

In the future, to switch the keycloak.v2 to the default theme, do
the following:

- Update `ThemeSelectorProvider`: Uncomment relevant lines
- Update `testsuite/integration-arquillian/tests/pom.xml`: Revert the change in `<login.theme.default>` property
- Update `ThemeSelectorTest` per comment

Signed-off-by: Hynek Mlnarik <hmlnarik@redhat.com>
@hmlnarik hmlnarik force-pushed the 29009-Switch-login-theme-to-keycloak-v2-Stabilize-testsuite-after-the-switch-main branch from 259831b to 04041fa Compare July 19, 2024 19:34
@hmlnarik hmlnarik marked this pull request as ready for review July 29, 2024 14:19
@hmlnarik hmlnarik requested review from stianst and vmuzikar July 29, 2024 14:20
Copy link
Contributor

@ssilvert ssilvert left a comment

Choose a reason for hiding this comment

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

We need to merge this to make progress on Login V2. It changes most of the tests to use Login V2. It only affects how tests are run.

We plan to follow up with a PR that will fully test both Login V1 and Login V2 in the nightly build.

Meanwhile, Login V1 is still tested with FIPS tests and Docker tests, which provides us a nice sanity check on Login V1.

Copy link
Contributor

@vmuzikar vmuzikar left a comment

Choose a reason for hiding this comment

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

The changes as such LGTM, nice work @hmlnarik with resolving the issue with htmlunit!

My only concern is that we'll be now testing with a different theme that we ship as the default. I understand it's only temporary which is ok. But I wonder if we'll be able to make v2 the default before the next major release, i.e. Keycloak 26, so that we'd test the default.

@ssilvert
Copy link
Contributor

The changes as such LGTM, nice work @hmlnarik with resolving the issue with htmlunit!

My only concern is that we'll be now testing with a different theme that we ship as the default. I understand it's only temporary which is ok. But I wonder if we'll be able to make v2 the default before the next major release, i.e. Keycloak 26, so that we'd test the default.

@vmuzikar Regardless of which login theme is the default, we need to keep both around for awhile. Login V2 needs to be fully vetted in the community before we make it the default for new realms. However, V1 is pretty stable and should require less regression testing. So we want to start testing against V2 as soon as possible because that's where the new development is happening.

For performance reasons, we don't want to run the tests against both versions each time a PR is submitted. But we do plan to run both in the nightly build.

@vmuzikar
Copy link
Contributor

@ssilvert Ok, makes sense. Thanks for clarifying.

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.

Switch login theme to keycloak.v2: Stabilize testsuite after the switch

8 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载