Commit 2e2e4bb
authored
test(e2e): add insights and online-insights lifecycle tests (#1599)
* test(e2e): add insights and online-insights lifecycle tests
Adds end-to-end coverage for the Lens/Insights feature shipped in the NYS
summit release. Two independent sequential suites in
e2e-tests/insights-lifecycle.test.ts, each owning its own deployed agent
and CFN stack so a deploy failure in one suite does not blank the other:
- online-insights lifecycle: add online-insights -> deploy -> invoke ->
pause -> resume -> teardown. Verifies live executionStatus toggling
through the control plane.
- run-insights and recommendation chain: deploy -> invoke ->
run insights (async) -> view list -> view detail -> archive ->
run insights --wait -> run recommendation --from-insights -> teardown.
Covers async submission, local job storage, view/archive round-trip,
and the chain from a completed insights job into a system-prompt
recommendation. The chain step accepts either success or a service
error indicating the upstream job had no usable sessions, since real
trace volume is not guaranteed seconds after invoke; flag-parsing
errors fail hard.
* test(e2e): assert insights detail returns arn, not region
JobRecordBase does not store region — region is parsed from arn. The
view insights <id> --json output therefore has no region field. Switch
the detail-call assertion to match arn against the bedrock-agentcore
ARN shape and update the InsightsJobJson interface accordingly.
* test(e2e): drop --evaluator from run insights, supply on recommendation step
The BatchEvaluation API rejects `--insights` and `--evaluator` together
("evaluators and insights are mutually exclusive"), so the --wait submit
exited 1 with success:false and waitJobId stayed undefined. The follow-up
recommendation chain test then ran with id=undefined and tripped the
recommendation handler's 'exactly one evaluator' check. Pass --evaluator
on the recommendation invocation instead, where the handler actually
requires it for system-prompt type.
* test(e2e): skip insights tests gracefully when invoke setup fails
Instead of failing the entire insights suite when invoke breaks,
catch the invoke error and use ctx.skip() to mark dependent tests
as skipped with a clear warning message.1 parent 7a9bcbd commit 2e2e4bb
1 file changed
Lines changed: 440 additions & 0 deletions
0 commit comments