test: read the bootstrap topology fixture from this repo

flowchart LR
  T["test_topology_bootstrap.py<br/>test_tfsdk_registry_wiring.py"] -- "before: ../tf-sdk/tests/contract/bootstrap_example.yaml" --> X["only exists with a tf-sdk checkout<br/>next to SRM (not in CI)"]
  T -- "now: tests/fixtures/tf_sdk_bootstrap_example.yaml" --> F["copied into this repo, unchanged"]

Every pipeline on refactor/tf-sdk-wiring fails test on the same 6 tests (e.g. pipeline 28530). They read their topology fixture from a tf-sdk checkout next to SRM, and CI only clones SRM. This MR copies the file into tests/fixtures/ unchanged (same content as tf-sdk's refactor/tfsdk-architecture-alignment) and points both tests at the copy.

CI job, run locally refactor/tf-sdk-wiring (pipeline 28530) this MR this MR + SRM !37 (merged)
test 477 passed, 6 failed 483 passed 486 passed
type (mypy) clean clean clean
architecture (lint-imports) 2 kept 2 kept 2 kept
lint, format (ruff) clean clean clean

When tf-sdk's example changes, update the copy. After this merges, rebase SRM !37 (merged) so its pipeline goes green.

Merge request reports

Loading
+3 −3
Changes for tests/application/test_topology_bootstrap.py: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -36,9 +36,9 @@ from tests.unit.fakes import (
    InMemoryZoneRepository,
)

_BOOTSTRAP_YAML = (
    Path(__file__).resolve().parents[3] / "tf-sdk" / "tests" / "contract" / "bootstrap_example.yaml"
)
# A copy of tf-sdk's tests/contract/bootstrap_example.yaml, so the suite runs without a
# tf-sdk checkout next to this repo (CI has none).
_BOOTSTRAP_YAML = Path(__file__).resolve().parents[1] / "fixtures" / "tf_sdk_bootstrap_example.yaml"


def _repos() -> tuple[
+88 −0
Changes for tests/fixtures/tf_sdk_bootstrap_example.yaml: 88 added lines, 0 removed lines.
Original line number Diff line number Diff line
version: openop.srm.bootstrap/v1

platform_instance_id: local-openop

control_paths:
  # Runtime-only configuration.
  # These entries initialize the SRM ControlPathRegistry.
  # They are not persisted as adapter configuration in SRM DB.
  #
  # The database stores only:
  #   control_path_binding.control_path_ref
  #
  # At runtime SRM resolves:
  #   control_path_ref -> ControlPathRegistry -> TF-SDK adapter -> infrastructure

  - ref: k8s-athens-edge
    adapter_family: compute
    adapter_type: kubernetes
    adapter_contract_version: v1

    invocation:
      adapter_class: openop_tfsdk.adapters.kubernetes.KubernetesComputeAdapter

    infrastructure:
      api_server: https://k8s-athens-edge.example.local:6443
      kubeconfig_ref: secret://openop/k8s-athens-edge/kubeconfig
      namespace: openop-services
      default_storage_class: fast-edge-ssd
      registry_mirror: registry.athens-edge.example.local
      tls_verify: true
      timeout_seconds: 30

    retry:
      transient_attempts: 3
      transient_backoff_seconds: 2


zones:
  - ref: rz-athens-edge
    name: Athens Edge Resource Zone
    kind: resource
    state: active

    metadata:
      zone_type: edge
      location:
        city: Athens
        country: GR
      labels:
        region: athens
        environment: edge

    domains:
      - ref: compute-athens-edge
        name: Athens Edge Compute Domain
        kind: compute
        state: active

        metadata:
          backend_family: kubernetes
          labels:
            runtime: k8s
            placement_scope: edge

        capabilities:
          - ref: query-available-resources
            name: Query Available Resources
            kind: query_available_resources
            state: active

            control_path_bindings:
              - ref: query-available-resources-via-k8s-athens-edge
                control_path_ref: k8s-athens-edge
                priority: 100
                is_default: true
                state: active

          - ref: deploy-workload
            name: Deploy Workload
            kind: workload
            state: active

            control_path_bindings:
              - ref: deploy-workload-via-k8s-athens-edge
                control_path_ref: k8s-athens-edge
                priority: 100
                is_default: true
                state: active
+3 −3
Changes for tests/unit/test_tfsdk_registry_wiring.py: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -55,9 +55,9 @@ from srm.domain.ports.transformation_functions import (
)
from srm.domain.ports.transformation_functions.enums import DeploymentUnitType

_BOOTSTRAP_YAML = (
    Path(__file__).resolve().parents[3] / "tf-sdk" / "tests" / "contract" / "bootstrap_example.yaml"
)
# A copy of tf-sdk's tests/contract/bootstrap_example.yaml, so the suite runs without a
# tf-sdk checkout next to this repo (CI has none).
_BOOTSTRAP_YAML = Path(__file__).resolve().parents[1] / "fixtures" / "tf_sdk_bootstrap_example.yaml"


def _parameters() -> Parameters:
Loading