feat(security,tests): add basic UIAM Scout API tests#244518
feat(security,tests): add basic UIAM Scout API tests#244518azasypkin merged 7 commits intoelastic:mainfrom
Conversation
191b3c4 to
cd7e0ac
Compare
9cfdbde to
cf76cb7
Compare
cf76cb7 to
775e81f
Compare
1c81709 to
1d96295
Compare
b2f6b45 to
bdb6be8
Compare
cd10a79 to
b9f7149
Compare
| }); | ||
| }); | ||
|
|
||
| apiTest.describe('[LOCAL-ONLY] Refresh UIAM session', { tag: ['@svlSecurity'] }, () => { |
There was a problem hiding this comment.
we restrict using 2 root describe blocks in spec file because our CI bot is limited to find the verify first one while running /skip command.
You have few options:
- merge under the same
describeblock - move to the separate file (and maybe even run them in parallel?)
There was a problem hiding this comment.
Ah, good to know, thanks! I've switched to separate files and parallel running (my tests don't need to access SOs, so I didn't use spaceTest helper) - let's see how it goes!
There was a problem hiding this comment.
Btw, I see tests have passed, but I see this in the logs:
2025-12-13 12:12:08 UTC
proc [playwright] Error in reporter Error: Invalid path: "scout" directory not found in /..../elastic/kibana-pull-request/kibana/x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts.
2025-12-13 12:12:08 UTC
proc [playwright] Ensure playwright configuration file is in the plugin directory: '/plugins/<plugin-name>/test/scout/ui/<config-file>'
Can this be ignored?
There was a problem hiding this comment.
I think we need to fix reporter
b9f7149 to
d25a721
Compare
9be888d to
1ef38b0
Compare
| source .buildkite/scripts/steps/functional/common.sh | ||
|
|
||
| echo '--- Running Scout UIAM Integration Tests' | ||
| node scripts/scout.js run-tests --serverless security --config x-pack/platform/plugins/shared/security/test/scout_uiam_local/api/parallel.playwright.config.ts --kibana-install-dir "$KIBANA_BUILD_LOCATION" |
There was a problem hiding this comment.
note: we run these tests only against Security project type which is enough for the time being.
...ins/shared/security/test/scout_uiam_local/api/parallel_tests/uiam_invalidate_session.spec.ts
Outdated
Show resolved
Hide resolved
|
@elasticmachine merge upstream |
|
|
||
| import { globalSetupHook } from '@kbn/scout'; | ||
|
|
||
| globalSetupHook('To make ESLint happy', async () => {}); |
There was a problem hiding this comment.
With #247630 the hook can be moved to opt-in option, but it will require another PR to remove ESLint rule and update Scout test runner.
Thank you for pointing out the UX issue!
There was a problem hiding this comment.
Good to know, thanks!
dmlemeshko
left a comment
There was a problem hiding this comment.
kbn/scout changes LGTM
| userSessionCookie = `sid=${await samlAuth.session.getInteractiveUserSessionCookieWithRoleScope( | ||
| 'viewer' | ||
| )}`; |
There was a problem hiding this comment.
You should now be able to use the new samlAuth.asInteractiveUser() method to retrieve a cookie-based authc header (so you don't have to compute the sid= string yourself):
const { cookieHeader } = await samlAuth.asInteractiveUser('viewer');
const response = await apiClient.get('internal/endpoint', {
headers: { ...cookieHeader }
);Ensure you pull changes from main. Thanks for your feedback with respect to naming / UX!
There was a problem hiding this comment.
Nice, thanks! Switched to samlAuth.asInteractiveUser in a3b3c56
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
History
cc @azasypkin |
## Summary Add basic UIAM Scout API tests: * ✅ It should be possible to login via UIAM flow * ✅ It should be possible to invalidate UIAM session token * ✅ It should be possible to refresh UIAM session token ~~__Blocked By:__ elastic#244306 and elastic#243752 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
## Summary Add basic UIAM Scout API tests: * ✅ It should be possible to login via UIAM flow * ✅ It should be possible to invalidate UIAM session token * ✅ It should be possible to refresh UIAM session token ~~__Blocked By:__ elastic#244306 and elastic#243752 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
## Summary Add basic UIAM Scout API tests: * ✅ It should be possible to login via UIAM flow * ✅ It should be possible to invalidate UIAM session token * ✅ It should be possible to refresh UIAM session token ~~__Blocked By:__ elastic#244306 and elastic#243752 --------- Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Dzmitry Lemechko <dzmitry.lemechko@elastic.co>
Summary
Add basic UIAM Scout API tests:
Blocked By: #244306 and #243752