Skip to content

Add a validation test for control-plane example bundles #72

Description

@MuttleyD

Labels: good first issue, help wanted, type/test, area/control-plane, area/testing, priority/near-term

Context

MIDAS now includes five self-contained control-plane example bundles under examples/control-plane/.

These bundles are intended to help users validate the core MIDAS flow:

plan → apply → approve Surface/Profile → evaluate → verify evidence

A narrow test already validates that the bundles parse and plan successfully. This issue is to make that validation easier to maintain and extend, without requiring a live MIDAS server.

Scope

Add or improve tests that load every YAML bundle under examples/control-plane/ and verify that each bundle can be parsed and planned as valid control-plane input.

The test should cover:

  • all files under examples/control-plane/*.yaml;
  • successful parsing;
  • successful planning;
  • expected number of resources per bundle;
  • expected resource kinds per bundle;
  • expected create actions on a clean in-memory or test-backed plan service, if supported by the existing test structure.

Recommended area to inspect first:

internal/controlplane/apply/example_bundles_test.go
internal/controlplane/parser
internal/controlplane/validate
examples/control-plane/

Acceptance Criteria

  • The test discovers or explicitly covers all five control-plane example bundles.
  • Each bundle is parsed successfully.
  • Each bundle produces a valid plan.
  • Each bundle contains the expected core resource chain:
    • BusinessService
    • Capability
    • BusinessServiceCapability
    • Process
    • Surface
    • Agent
    • Profile
    • Grant
  • The test fails clearly if a bundle is renamed, removed, malformed, or no longer validates.
  • The test uses existing repository test patterns.
  • go test ./internal/controlplane/parser ./internal/controlplane/validate ./internal/controlplane/apply passes.
  • git diff --check passes.

Out of Scope

  • Running a live MIDAS server.
  • Applying bundles to a real Postgres database.
  • Calling /v1/evaluate.
  • Adding shell or PowerShell scripts.
  • Changing the YAML bundle content unless the test reveals a clear existing defect.
  • Changing control-plane behaviour.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions