Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/e2e-testing-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ jobs:
- name: The agent kit carries the current template and example
run: python tools/build_agent_kit.py --check

- name: The mocks' cluster set is current, and each product resets only its own scenarios
run: |
python mocks/deploy/build_mappings.py
git diff --exit-code -- mocks/deploy

- name: The sample handouts build
run: python admin/handouts/build_handouts.py --inventory admin/handouts/inventory.sample.json --no-pdf --out "${RUNNER_TEMP}/handouts"

Expand Down
1 change: 1 addition & 0 deletions e2e-testing/admin/handouts/build_handouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
("Management API", "managementUrl"),
("API key", "apiKey"),
("DSP address", "dspUrl"),
("Data plane, public API", "dataplanePublicUrl"),
("Participant ID", "participantId"),
("BPN", "bpn"),
("Digital Twin Registry", "dtrUrl"),
Expand Down
5 changes: 5 additions & 0 deletions e2e-testing/admin/handouts/inventory.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"managementUrl": "https://consumer-management.team-01.example.org/management",
"apiKey": "sample-key-consumer-01",
"dspUrl": "https://consumer-dsp.team-01.example.org/api/v1/dsp/2025-1",
"dataplanePublicUrl": "https://consumer-dataplane.team-01.example.org/api/public",
"participantId": "did:web:consumer.team-01.example.org:identityhub:BPNL000000000201",
"bpn": "BPNL000000000201"
}
Expand All @@ -52,6 +53,7 @@
"managementUrl": "https://consumer-management.team-02.example.org/management",
"apiKey": "sample-key-consumer-02",
"dspUrl": "https://consumer-dsp.team-02.example.org/api/v1/dsp/2025-1",
"dataplanePublicUrl": "https://consumer-dataplane.team-02.example.org/api/public",
"participantId": "did:web:consumer.team-02.example.org:identityhub:BPNL000000000202",
"bpn": "BPNL000000000202"
}
Expand All @@ -75,6 +77,7 @@
"managementUrl": "https://consumer-management.team-03.example.org/management",
"apiKey": "sample-key-consumer-03",
"dspUrl": "https://consumer-dsp.team-03.example.org/api/v1/dsp/2025-1",
"dataplanePublicUrl": "https://consumer-dataplane.team-03.example.org/api/public",
"participantId": "did:web:consumer.team-03.example.org:identityhub:BPNL000000000203",
"bpn": "BPNL000000000203"
}
Expand All @@ -98,6 +101,7 @@
"managementUrl": "https://consumer-management.team-04.example.org/management",
"apiKey": "sample-key-consumer-04",
"dspUrl": "https://consumer-dsp.team-04.example.org/api/v1/dsp/2025-1",
"dataplanePublicUrl": "https://consumer-dataplane.team-04.example.org/api/public",
"participantId": "did:web:consumer.team-04.example.org:identityhub:BPNL000000000204",
"bpn": "BPNL000000000204"
}
Expand All @@ -121,6 +125,7 @@
"managementUrl": "https://consumer-management.team-05.example.org/management",
"apiKey": "sample-key-consumer-05",
"dspUrl": "https://consumer-dsp.team-05.example.org/api/v1/dsp/2025-1",
"dataplanePublicUrl": "https://consumer-dataplane.team-05.example.org/api/public",
"participantId": "did:web:consumer.team-05.example.org:identityhub:BPNL000000000205",
"bpn": "BPNL000000000205"
}
Expand Down
5 changes: 5 additions & 0 deletions e2e-testing/admin/handouts/inventory.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@
"type": "string",
"format": "uri"
},
"dataplanePublicUrl": {
"description": "Public API of the connector's data plane, ending in /api/public. A TCK whose product calls TestLab through its own connector asks for the partner side's as engine_dataplane_public_url.",
"type": "string",
"format": "uri"
},
"participantId": {
"description": "The connector's participant id, a DID for current connectors.",
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ execution:
# TODO: check what your product promises, not only that it answers.
# For example a field of the answer:
# - uses: validate/field
# with: { input: body, path: "items[0].id", operator: not_null }
# with: { input: body, path: "items.0.id", operator: not_null }

teardown:
- id: delete_contract
Expand Down
Binary file modified e2e-testing/docs/downloads/e2e-test-template.zip
Binary file not shown.
9 changes: 9 additions & 0 deletions e2e-testing/docs/reference/syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ product refuses a caller that did not sign in.

Common operators: `equals`, `contains`, `not_empty`, `gt`, `lt`, `matches_regex`.

**A `path` into a list takes the index as a segment of its own:** `items.0.id`, and `0.quantity`
when the answer itself is a list. Brackets pick an element by a field instead:
`endpoints[interface='SUBMODEL-3.0']`. A path that leads nowhere is not an error: it yields
`None`, and the check fails with `Expected …, got None`. Seeing `got None` for a field you can see in
the answer means the path is wrong, not the product.

**Compare numbers with numbers.** A quantity the product answers as `20.0` does not equal the
string `"20"`. Give such a value a `variable/type/number`, or write it without quotes.

## Commands

```bash
Expand Down
2 changes: 1 addition & 1 deletion e2e-testing/docs/specs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ No system at all, API tests only: Business Partner Data Management (BPDM), Datas
| At least **five tests**, with at least one **positive** and one **negative** | A test that only ever says yes proves nothing, and each person of the team builds at least one |
| **Both sides** when the product does both: tests as **provider** and tests as **consumer** (`side`) | The team can split: one builds the provider side, one the consumer side |
| **Provider side**: the product offers known data, TestLab takes it as the partner, and the checks compare what arrived with what was offered | It proves the data really left the product, unchanged |
| **Consumer side**: TestLab mocks the provider with known data (`mock/api`, `mock/dtr`, offered with `connector/provider/create_mock_asset`), waits for the product to take it (`mock/wait/*`), and the checks confirm the product got exactly that data | It proves the product really fetched it, not that it only said so |
| **Consumer side**: TestLab mocks the provider with known data (`mock/api`, `mock/dtr`, offered with `connector/provider/create_mock_asset` plus its policies and a `connector/provider/create_contract_definition`: without one the offer is in no catalog), waits for the product to take it (`mock/wait/*`), and the checks confirm the product got exactly that data | It proves the product really fetched it, not that it only said so |
| Checks look at **content, shape and side effects**: the values sent come back, the answer matches the OpenAPI (`labs/validate/api_response`) or, for documents without one such as a DID document or a credential, a JSON schema in `schemas/`, copied from the ready ones in [`e2e-testing/schemas`](https://github.com/eclipse-tractusx/tutorial-resources/tree/main/e2e-testing/schemas), and a refused call leaves nothing behind | A status code alone proves little |
| Each test **file** is listed under `tests:` in the manifest, and repeats its `id` as `namespace` | Otherwise it is not part of the project |
| Only **steps the spec names** | They are TestLab's ready-made steps. An invented step does not compile |
Expand Down
31 changes: 23 additions & 8 deletions e2e-testing/docs/specs/puris.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Repository: [`puris`](https://github.com/eclipse-tractusx/puris) · Spec 1.0 · **Draft** · [Raw spec for your AI](puris.yaml) · [All specs](index.md)

> [!NOTE]
> Not run yet. Two PURIS instances, each with a connector and a Digital Twin Registry, are not in the workshop environment. Build and compile it in the workshop; run it where the product is deployed. Check each path against the OpenAPI of the release you test.
> Against the workshop mock only puris_backend_needs_key can be green: the other tests need PURIS itself to act through its connector. Build and compile them in the workshop; they turn green with the real product in step 3. Check paths against the release's OpenAPI.

## 1 · The product in brief

Expand Down Expand Up @@ -105,6 +105,8 @@ Every row is one step. Every ☐ is one `validate` entry. The step names are Tes

**Proves:** PURIS publishes its data through the connector, where partners can find it.

**Against the mock (box M):** build and compile it, it cannot be green there. PURIS creates these offers in its own connector. The mock has no connector, so the catalog of connector C holds no PURIS offer. It turns green with the real product in step 3.

**execution**

| # | What happens | Step | Must be true |
Expand All @@ -117,6 +119,8 @@ Every row is one step. Every ☐ is one `validate` entry. The step names are Tes

**Proves:** The short-term data actually reaches the partner, for the right material.

**Against the mock (box M):** build and compile it, it cannot be green there. PURIS registers the material twin in its own registry. The workshop registry holds none. It turns green with the real product in step 3.

**execution**

| # | What happens | Step | Must be true |
Expand Down Expand Up @@ -144,13 +148,18 @@ Every row is one step. Every ☐ is one `validate` entry. The step names are Tes

**Proves:** PURIS works as a customer too: it finds the partner's twin, pulls its ItemStock and shows the quantities the partner offered.

**Against the mock (box M):** build and compile it, it cannot be green there. At "Wait for PURIS's request" PURIS must find TestLab's offer, negotiate it and call it through its own connector. The mock cannot call out: the run waits two minutes and fails with a timeout. It turns green with the real product in step 3.

**setup**

| # | What happens | Step | Must be true |
| --- | --- | --- | --- |
| 1 | Register a mock registry with a material twin for material_number and an ItemStock submodel. | `mock/dtr` | – |
| 2 | Register a mock that answers the ItemStock submodel with a known quantity. | `mock/api` | – |
| 3 | Offer the registry and the submodel mock on TestLab's connector. | `connector/provider/create_mock_asset` | – |
| 3 | Turn the registry mock and the submodel mock into assets on TestLab's connector. | `connector/provider/create_mock_asset` | – |
| 4 | Create the access policy: Membership active. | `connector/provider/create_policy` | – |
| 5 | Create the usage policy, with the framework agreement Puris. | `connector/provider/create_policy` | – |
| 6 | Publish both assets under both policies, one contract definition each. An asset without a contract definition is in no catalog: PURIS cannot find it, and the wait below times out. | `connector/provider/create_contract_definition` | – |

**execution**

Expand All @@ -164,20 +173,25 @@ Every row is one step. Every ☐ is one `validate` entry. The step names are Tes

| # | What happens | Step | Must be true |
| --- | --- | --- | --- |
| 1 | Delete the mock assets and their offers. | `connector/provider/delete_asset` | – |
| 1 | Withdraw both contract definitions. | `connector/provider/delete_contract_definition` | – |
| 2 | Delete the mock assets. | `connector/provider/delete_asset` | – |
| 3 | Delete both policies. | `connector/provider/delete_policy` | – |

### Test 5 · A material number the supplier never registered has no twin

`tests/unknown_material_has_no_stock.yaml` · id `unknown-material-has-no-stock` · **Negative** · **Product as provider**

**Proves:** PURIS does not publish twins for materials it does not know.

**Against the mock (box M):** build and compile it, it cannot be green there. It first finds the twin of the known material, which only the real PURIS registers. It turns green with the real product in step 3.

**execution**

| # | What happens | Step | Must be true |
| --- | --- | --- | --- |
| 1 | Negotiate access to the supplier's registry. | `connector/discover/digital-twin-registry/auth` | – |
| 2 | Look up a material number that is new in every run. | `digital-twin-registry/consumer/dataplane/lookup_shell` | ☐ The list of shell ids is empty. |
| 2 | Look up material_number, the material both sides know. | `digital-twin-registry/consumer/dataplane/lookup_shell` | ☐ One twin is found, so the empty answer below is a refusal and not an empty registry. |
| 3 | Look up a material number that is new in every run. | `digital-twin-registry/consumer/dataplane/lookup_shell` | ☐ The list of shell ids is empty. |

## 5 · Break it on purpose

Expand All @@ -191,6 +205,7 @@ A check that cannot fail proves nothing. Make each change once, see the test go

- Both sides need the same material in their master data, and a partner relationship to each other, before the run.
- The PURIS usage policy names the framework agreement Puris: check the version the release uses.
- A quantity comes back as a number (20.0). Compare it with a number, not with the string "20": give the expected quantity a variable/type/number.

## 7 · Not in this spec

Expand All @@ -215,11 +230,11 @@ Compile after each file and fix what the compiler reports.

The [definition of done](index.md#done-when) for every product, and:

- [ ] `tests/offers_in_catalog.yaml` is green.
- [ ] `tests/customer_reads_item_stock.yaml` is green.
- [ ] `tests/offers_in_catalog.yaml` compiles; it is green with the real product (step 3).
- [ ] `tests/customer_reads_item_stock.yaml` compiles; it is green with the real product (step 3).
- [ ] `tests/puris_backend_needs_key.yaml` is green.
- [ ] `tests/puris_pulls_partner_stock.yaml` is green.
- [ ] `tests/unknown_material_has_no_stock.yaml` is green.
- [ ] `tests/puris_pulls_partner_stock.yaml` compiles; it is green with the real product (step 3).
- [ ] `tests/unknown_material_has_no_stock.yaml` compiles; it is green with the real product (step 3).

## Sources

Expand Down
39 changes: 34 additions & 5 deletions e2e-testing/docs/specs/puris.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ product: puris
specVersion: '1.0'
status: draft
statusNote: >-
Not run yet. Two PURIS instances, each with a connector and a Digital Twin Registry, are not
in the workshop environment. Build and compile it in the workshop; run it where the product
is deployed. Check each path against the OpenAPI of the release you test.
Against the workshop mock only puris_backend_needs_key can be green: the other tests need PURIS
itself to act through its connector. Build and compile them in the workshop; they turn green with
the real product in step 3. Check paths against the release's OpenAPI.
inOneSentence: >-
A supplier's PURIS offers its stock and forecasts through its connector, and the customer's
PURIS finds those offers and reads the item stock for a shared material.
Expand Down Expand Up @@ -91,6 +91,9 @@ tests:
- contract
proves: PURIS publishes its data through the connector, where partners can find it.
side: provider
needsRealProduct: >-
PURIS creates these offers in its own connector. The mock has no connector, so the catalog of
connector C holds no PURIS offer.
execution:
- do: Query the supplier's catalog from the customer's connector.
step: connector/consumer/query_catalog
Expand All @@ -106,6 +109,8 @@ tests:
- contract
proves: The short-term data actually reaches the partner, for the right material.
side: provider
needsRealProduct: >-
PURIS registers the material twin in its own registry. The workshop registry holds none.
execution:
- do: Negotiate access to the supplier's registry.
step: connector/discover/digital-twin-registry/auth
Expand Down Expand Up @@ -144,13 +149,24 @@ tests:
- positive
proves: "PURIS works as a customer too: it finds the partner's twin, pulls its ItemStock and shows the quantities the partner offered."
side: consumer
needsRealProduct: >-
At "Wait for PURIS's request" PURIS must find TestLab's offer, negotiate it and call it through
its own connector. The mock cannot call out: the run waits two minutes and fails with a timeout.
setup:
- do: Register a mock registry with a material twin for material_number and an ItemStock submodel.
step: mock/dtr
- do: Register a mock that answers the ItemStock submodel with a known quantity.
step: mock/api
- do: Offer the registry and the submodel mock on TestLab's connector.
- do: Turn the registry mock and the submodel mock into assets on TestLab's connector.
step: connector/provider/create_mock_asset
- do: "Create the access policy: Membership active."
step: connector/provider/create_policy
- do: Create the usage policy, with the framework agreement Puris.
step: connector/provider/create_policy
- do: >-
Publish both assets under both policies, one contract definition each. An asset without a
contract definition is in no catalog: PURIS cannot find it, and the wait below times out.
step: connector/provider/create_contract_definition
execution:
- do: "Ask PURIS to refresh its partners' data: GET {puris_url}/materials/refresh with the X-API-KEY header."
step: http/http_request
Expand All @@ -166,18 +182,28 @@ tests:
- The answer is 200.
- One entry is reported by TestLab's BPN, with exactly the quantity and unit the mock answered.
teardown:
- do: Delete the mock assets and their offers.
- do: Withdraw both contract definitions.
step: connector/provider/delete_contract_definition
- do: Delete the mock assets.
step: connector/provider/delete_asset
- do: Delete both policies.
step: connector/provider/delete_policy
- file: unknown_material_has_no_stock.yaml
id: unknown-material-has-no-stock
name: A material number the supplier never registered has no twin
kinds:
- negative
proves: PURIS does not publish twins for materials it does not know.
side: provider
needsRealProduct: >-
It first finds the twin of the known material, which only the real PURIS registers.
execution:
- do: Negotiate access to the supplier's registry.
step: connector/discover/digital-twin-registry/auth
- do: Look up material_number, the material both sides know.
step: digital-twin-registry/consumer/dataplane/lookup_shell
check:
- One twin is found, so the empty answer below is a refusal and not an empty registry.
- do: Look up a material number that is new in every run.
step: digital-twin-registry/consumer/dataplane/lookup_shell
check:
Expand All @@ -195,6 +221,9 @@ pitfalls:
before the run.
- >-
The PURIS usage policy names the framework agreement Puris: check the version the release uses.
- >-
A quantity comes back as a number (20.0). Compare it with a number, not with the string "20":
give the expected quantity a variable/type/number.
sources:
- label: PURIS repository
url: https://github.com/eclipse-tractusx/puris
Expand Down
3 changes: 2 additions & 1 deletion e2e-testing/docs/tutorial/03-your-product.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ Raise your hand if a box is empty. Do not go on without it.
> **At the Tractus-X Community Days 2026, ARENA2036.** The IDE is the workshop's Test Suite,
> <https://test-suite-txcd.test.tractus-x.com>. Sign in with the account in box **B**: the
> first sign-in asks you to accept the privacy policy. One account per team; every
> teammate may sign in with it.
> teammate may sign in with it. It may offer two-factor authentication: press **Not now**,
> since the whole team shares the account. Close the welcome window that follows.

## Steps

Expand Down
Loading
Loading