[Observability] Update alert details context test for empty no-params result - #290503
[Observability] Update alert details context test for empty no-params result#290503kibanamachine wants to merge 1 commit into
Conversation
Update the "no params" case to expect an empty context, matching the hasEntityFilters gate added in #290244. Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
⏭️ Flaky-fix verification skippedThe failure is deterministic: #290244 added a Why the flaky test runner wasn't usedThe How release-note and backport labels were chosenApplied
|
💔 Build Failed
Failed CI Steps
Metrics [docs]
Test Failures
History |
Fixes #290496
Summary
returns a single log category when no params are specifiedassertedexpect(alertContext).toHaveLength(1)but received[], failing deterministically on the#290244merge build.toStrictEqual([])) and renames it toreturns nothing when no params are specified, matching the product's new contract.Relevant history
hasEntityFiltersgate (get_observability_alert_details_context/index.ts:133) that now wraps the log-rate and log-categories fetchers (index.ts:173), so a query with no entity params returns an empty context — the exact "no params" case this test exercises.Context
serviceName/hostName/containerId/kubernetesPodNameare allundefined, sohasEntityFiltersisfalse; log categories are skipped and the remaining unconditional fetchers return empty data filtered out atindex.ts:328, yielding[]. The oldtoHaveLength(1)expectation asserted a log category the product no longer promises — the assertion was the bug, so it is corrected (not weakened), mirroring the existing "non-existing container id" case at L173-L178.hasEntityFiltersgate and theisEmpty(item.data)filter against currentmain.kibana-on-mergebuild 109422 (the merge build for [Obs AI Assistant] Skip log rate analysis and log categories when no entity filters are present #290244) on both thelocal-serverless-observability_completeandlocal-stateful-classictargets.Verification
Verified locally
node scripts/eslint x-pack/solutions/observability/plugins/observability/test/scout/api/tests/alert_details_context_logs_without_service_name.spec.tsNot verified locally
Note
Share feedback in #kibana-qa. Mention
@copilotto make quick changes.