Skip to content

fix(e2e-testing): what a team meets in the workshop, end to end - #819

Merged
matbmoser merged 2 commits into
mainfrom
fix/e2e-workshop-walkthrough-findings
Dec 4, 2026
Merged

matbmoser merged 2 commits into
mainfrom
fix/e2e-workshop-walkthrough-findings

Conversation

@matbmoser

@matbmoser matbmoser commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Why

I walked step 2 of the tutorial as a participant would: team 09 (PURIS) with its printed
handout, Bruno against the PURIS mock, the team's own draft in the Test Suite IDE, and the
same TCK with TestLab on a laptop. In the IDE the draft ran with 2 of 5 tests green, and
each red test traced back to the workshop set-up, not to the team's test. This PR fixes what
got in the way.

What changes

Finding Fix
"Reset every scenario" resets every team. One WireMock serves all 17 products, and POST /__admin/scenarios/reset resets them all. Each collection's reset sets only its own scenarios to Started (post-response script). build_mappings.py fails on a scenario name two products share, or on a reset list that differs from the mappings; CI now runs it and checks mocks/deploy.
PURIS mock: reported stocks answered 404 before the refresh; a second refresh answered 404. [] until PURIS has fetched; a repeated refresh answers 200 and keeps the state. Bruno environments now carry the same key as mock.json.
The template's hint path: "items[0].id" silently yields None. items.0.id in the template (and its agent-kit copy). syntax.md explains list paths, what got None means, and that a quantity like 20.0 must be compared with a number.
PURIS's "Done when" asked for 5 green tests; against the mock only 1 can be green. New spec field needsRealProduct: the page says such a test compiles against the mock and turns green in step 3, and "Done when" says so. PURIS uses it on four tests.
PURIS's pull test waits for PURIS to call through its own connector; the mock cannot, so it times out after 2 minutes. Marked needsRealProduct, with the reason. Chapter 6's "Stuck?" names the timeout.
unknown_material_has_no_stock was green against an empty registry. It first finds the known material, so an empty registry no longer passes it.
engine_dataplane_public_url was asked for but was not on the handout; engine_bpnl offered only box C's BPN. Box D prints "Data plane, public API" (dataplanePublicUrl). Chapter 6 says which values come from box D, and that engine_bpnl is typed under "Another BPNL".
PURIS's pull test never published its mock offers. create_mock_asset creates only the asset, so the offer was in no catalog: a rerun with box C as a real consumer found nine offers on box D, none of them the run's. The spec's setup adds two create_policy (Membership; Membership + FrameworkAgreement + UsagePurpose cx.puris.base:1) and one create_contract_definition per asset; teardown removes them. Rerun in the IDE: the offer is now in box D's catalog.
The run asked for six values the "type nothing" rule says the AI fills in. Test 4 needs the test side's BPN and public data plane, but the spec never declared them, and the agent kit said to declare a BPN as an input. The PURIS spec declares engine_bpnl and engine_dataplane_public_url as pre-filled values from box D; the agent kit says to write such a value in. With every value pre-filled, the Run dialog asks nothing.
First sign-in showed a two-factor offer and a welcome window; SUT Setup can say "asks for nothing". Chapters 3 and 6 mention them.

Checked

  • Every step of the "Check and build" workflow passes locally: catalog, specs, archives, agent kit, sample handouts, mkdocs build --strict.
  • Per-product reset on one WireMock that loads all 17 products' mappings: PURIS's reset moved only stock back to Started, portal's only app and sa, and traceability's received kept its state.
  • PURIS mock states walked locally: [] before and after the refresh, 20 pieces once fetched, 401 without the key.
  • A PURIS TCK built from the spec runs green against the local mock with TestLab 1.0.0a25.

Not in this PR

  • Redeploy the ARENA mocks. The reset fix works with the deployed mock as soon as teams take the new collection. The two new PURIS stubs (254 mappings) need a chart bump in cx-playground-infra.
  • Box D terminates box C's negotiations. In the rerun, box C found the run's offer and box D terminated the negotiation, also for an older box D offer with the same constraints. The reason is only in box D's provider log.
  • The engine labels a timeout waiting for the SUT as ENGINE_FAULT. That belongs to the engine; it reads as "the Test Suite broke" when the product never called.

🤖 Generated with Claude Code

Walked step 2 as team 09 (PURIS) with its printed handout: Bruno against the
mock, the team's own draft in the Test Suite IDE, and a TCK run with TestLab
on a laptop. Fixes what got in the way.

- Mocks: "Reset every scenario" resets only the product's own scenarios.
  All products share one WireMock in the workshop, and the global
  /__admin/scenarios/reset also reset the other teams' runs.
  build_mappings.py fails on a scenario name two products share, or a reset
  list that differs from the mappings; CI runs it and checks the cluster set.
- PURIS mock: reported stocks answer [] before PURIS has fetched (was 404),
  and a second refresh answers 200. Bruno environments use mock.json's keys.
- Template: the validate/field hint used items[0].id, which silently yields
  None. TestLab indexes lists as a segment, items.0.id. syntax.md explains it,
  and that a quantity like 20.0 is compared with a number.
- Specs: a test can say needsRealProduct. Its page and "Done when" then say it
  compiles against the mock and turns green in step 3. PURIS uses it for the
  four tests a mock cannot make green; its negative registry test first finds
  the known material, so an empty registry no longer passes it.
- Handouts: box D prints the data plane's public API (dataplanePublicUrl),
  which engine_dataplane_public_url asks for.
- Chapters 3 and 6: the two-factor offer and welcome window, engine_* values
  from box D (engine_bpnl via "Another BPNL"), the SUT Setup that asks for
  nothing, the step that waits for the product and times out, and "got None".

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mathias Moser <mathias.moser@catena-x.net>
@matbmoser
matbmoser requested a review from bmg13 as a code owner December 4, 2026 09:31
github-actions Bot added a commit that referenced this pull request Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Website preview

The preview was removed: this pull request was closed, no longer changes the website, or has the no-preview label. The changes appear on https://eclipse-tractusx.github.io/tutorial-resources/ once main is published.

Running test 4 in the IDE with a real consumer on box C showed why it can
never pass: the spec's setup names only connector/provider/create_mock_asset,
which creates the asset on TestLab's connector but no contract definition, so
the offer is in no catalog and the product cannot find it. CX-0135's TCK pairs
it with two create_policy and a create_contract_definition; the PURIS spec now
does the same, and withdraws them in teardown. The authoring guide in
build_specs.py says so for every consumer-side test.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mathias Moser <mathias.moser@catena-x.net>
github-actions Bot added a commit that referenced this pull request Dec 4, 2026
@matbmoser
matbmoser merged commit d07424d into main Dec 4, 2026
11 checks passed
github-actions Bot added a commit that referenced this pull request Dec 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant