Changes for README.md: 17 added lines, 9 removed lines.
Original line number
Diff line number
Diff line
@@ -42,10 +42,10 @@ Each orchestrator runs a full E2E lifecycle for a given cluster type:
Each individual orchestrator (Private/Public/OCM) follows the same general shape:
1. Authenticate and fetch the acting individual.
2. Run shared setup (org, peering, registry secrets, service specs) and fabric controller creation/polling — unless skipped (see **Skip Flags** below).
2. Run shared setup (org, peering, registry secrets, service specs) and fabric controller creation/polling, unless skipped (see **Skip Flags** below).
3. Create a K8s resource service order, poll until active.
4. Create an end-user service order on top of it, poll until active.
5. Validate service/resource inventory and telemetry (Grafana dashboards, Prometheus metrics — Public and Private only; OCM checks logs only).
5. Validate service/resource inventory and telemetry (Grafana dashboards, Prometheus metrics - Public and Private only; OCM checks logs only).
6. Update the service (Helm package config / cluster metadata) and re-poll.
7. Terminate the end-user service, then the resource service, polling each down to `TERMINATED`.
8. Delete the two service orders created during the run.
@@ -56,16 +56,16 @@ Cleanup logic lives in `cleanUp.feature` and `deleteAll.feature`, and is designe
***`deleteAll.feature`**: Contains the low-level, single-resource delete scenarios (`@deleteOrganizationbyId`, `@deletePeeringbyId`, `@deleteFabricNetwork`, `@deleteRegistryImagebyId`, `@deleteRegistryPackagebyId`, `@deleteServicebyId`, `@deleteServiceOrder`, etc.). Each accepts the relevant id as a parameter and tolerates `404` (already deleted) as a pass, so cleanup is idempotent and safe to re-run.
***`cleanUp.feature`**: Contains the higher-level workflows:
*`@cleanupTerminate` — terminates any services currently `ACTIVE` or `FEASIBILITY_CHECKED` (both CFS and OSL-named services) before deletion is attempted, since a service generally can't be deleted while still active.
*`@cleanupAll` — loops over arrays of ids (organizations, peerings, network controllers, registry image/package secrets, services, orders) and deletes each one via `karate.forEach`, calling the matching `deleteAll.feature` scenario per item with a short sleep between calls.
*`@clean-up-workflow` — the full, self-contained cleanup entry point: authenticates, fetches the current state of every resource type (`getOrganizations`, `getControllers`, `getPeerings`, `getRegistries`, `getAllServices`, `getAllCfsandOslServices`, `getAllServiceOrders`), then calls `@cleanupTerminate` followed by `@cleanupAll` with the resulting id arrays.
*`@cleanupTerminate`: terminates any services currently `ACTIVE` or `FEASIBILITY_CHECKED` (both CFS and OSL-named services) before deletion is attempted, since a service generally can't be deleted while still active.
*`@cleanupAll`: loops over arrays of ids (organizations, peerings, network controllers, registry image/package secrets, services, orders) and deletes each one via `karate.forEach`, calling the matching `deleteAll.feature` scenario per item with a short sleep between calls.
*`@clean-up-workflow`: the full, self-contained cleanup entry point: authenticates, fetches the current state of every resource type (`getOrganizations`, `getControllers`, `getPeerings`, `getRegistries`, `getAllServices`, `getAllCfsandOslServices`, `getAllServiceOrders`), then calls `@cleanupTerminate` followed by `@cleanupAll` with the resulting id arrays.
### How cleanup is triggered
***Individual orchestrators** (Private/Public/OCM/Portal) each configure `afterScenario` in their own `Background` to call `afterScenario.js`, so running any one of them standalone always leaves the environment clean, pass or fail.
***The master nightly orchestrator** does **not** rely on Karate's `afterScenario` hook for its own cleanup. Because `configure afterScenario` is shared, mutable state across a call chain, a sub-orchestrator's own `Background` will silently overwrite whatever the master configured — so relying on the hook at the master level is unreliable once sub-orchestrators are involved. Instead, the master:
***The master nightly orchestrator** does **not** rely on Karate's `afterScenario` hook for its own cleanup. Because `configure afterScenario` is shared, mutable state across a call chain, a sub-orchestrator's own `Background` will silently overwrite whatever the master configured, so relying on the hook at the master level is unreliable once sub-orchestrators are involved. Instead, the master:
1. Calls each sub-orchestrator with `{ skipCleanup: true }`, so their individual `afterScenario` hooks defer instead of running.
2. Wraps the whole sequence in a JS `try / catch / finally`, calling `cleanUp.feature@clean-up-workflow` unconditionally inside `finally`.
3. Re-throws the original error (if any) after cleanup completes, so the test still correctly reports as failed — cleanup happening doesn't hide a real failure.
3. Re-throws the original error (if any) after cleanup completes, so the test still correctly reports as failed - cleanup happening doesn't hide a real failure.
This guarantees **exactly one cleanup pass**, at the very end of the run, whether every orchestrator passed or one of them failed partway through.
@@ -78,12 +78,14 @@ Some orchestrator steps can be skipped by passing flags into the `call read(...)
| `skipCleanup` | Skips that orchestrator's own `afterScenario` cleanup (used when a master orchestrator will handle cleanup itself, once, at the end). |
| `skipInitSteps` | Skips org/peering/registry/fabric-controller setup steps, reusing values passed in instead (used when a prior orchestrator in the same run already did this setup). |
| `skipTerminateSteps` | Skips the end-of-run service termination steps. |
| `skipDeleteWorkflow` | Skips get and delete steps at the end of orcehstrator, in case you don't want to test get and delete methods. |
Example — calling Private normally, then Public/OCM reusing Private's setup and deferring cleanup to the master:
Example: calling Private normally, then Public/OCM reusing Private's setup and deferring cleanup to the master:
@@ -123,7 +131,7 @@ mvn test "-Dkarate.options=src/test/resources/hypo/auth.feature --name 'Get Hypo
```
> Tags are resolved across the whole classpath regardless of folder structure.
> If a feature file was recently edited and the change doesn't seem to take effect, run with `mvn clean test` instead of `mvn test` — this guarantees a fresh copy of every resource file is used rather than a possibly stale one from a previous build in `target/`.
> If a feature file was recently edited and the change doesn't seem to take effect, run with `mvn clean test` instead of `mvn test` guarantees a fresh copy of every resource file is used rather than a possibly stale one from a previous build in `target/`.