Skip to content

test: add test harness, workspace validation, and integration tests#9

Merged
digimaun merged 5 commits intoAzure:mainfrom
digimaun:test_harness_and_coverage
Apr 15, 2026
Merged

test: add test harness, workspace validation, and integration tests#9
digimaun merged 5 commits intoAzure:mainfrom
digimaun:test_harness_and_coverage

Conversation

@digimaun
Copy link
Copy Markdown
Member

@digimaun digimaun commented Apr 8, 2026

Add three layers of testing and consolidate CI overlay generation.

Engine unit tests:

  • Properties deep merge in overlays and inheritance
  • Duplicate step name validation (bug fix: was silently accepted)
  • Condition edge cases (enableSecretSync, missing paths, string "false")
  • Malformed JSON handling, deep nested output chaining, all-steps-skipped
  • Type annotation cleanup and proxy cleanup logging

Workspace content tests (tests/workspace/):

  • All manifests validate against real workspace files
  • Site inheritance resolves with complete deployOptions
  • Parameter chaining references valid steps and Bicep outputs
  • Conditional step properties exist in base-site.yaml

Integration test framework (tests/integration/):

  • Site-agnostic: deploys to all matched sites
  • Session-scoped fixtures with manifest dependency chain
  • Reusable helpers: find_step, assert_step_succeeded, assert_output_exists
  • On-demand CI workflows for GHA and ADO with manifest/selector/skip-cleanup inputs
  • Skips gracefully when no Azure config is available

Shared overlay generation (scripts/generate-site-overrides.py):

  • Consolidates SITE_OVERRIDES dot-notation expansion into a single script
  • Site name validation, yaml.safe_dump, stdin/env/file input modes
  • GHA and ADO deploy workflows updated to use the shared script

digimaun added 4 commits April 3, 2026 17:20
…otations

Tests:
- Properties deep merge preserves sibling keys (overlays + inheritance)
- Three-level inheritance preserves deep properties from all ancestors
- enableSecretSync truthy/falsy condition evaluation
- Missing intermediate property path in conditions
- Deep nested output chaining (3+ levels) and missing mid-path
- Malformed/truncated JSON stdout handled gracefully
- All-steps-skipped manifest completes successfully
- Duplicate step names detected by validation

Bug fix:
- Duplicate step names now produce a validation error (previously silent)

Code quality:
- Add missing type annotations across cli.py, orchestrator.py, models.py
- Log proxy kill failures instead of silently swallowing (executor.py)
…nd chaining

- All manifests pass orchestrator validation
- Site inheritance resolves with complete deployOptions
- Parameter chaining files reference valid steps and outputs
- Conditional step properties exist in base-site.yaml
…arness

Add site-agnostic integration test framework that deploys real manifests
against Azure and asserts orchestrator outputs across all matched sites.

Framework:
- tests/integration/conftest.py: session-scoped deploy fixtures, site
  overlay generation from SITE_OVERRIDES, graceful skip when unconfigured
- tests/integration/helpers/assertions.py: find_step, assert_step_succeeded,
  assert_output_exists with ARM output unwrapping

Manifest tests:
- test_aio_install_manifest.py: step outputs, conditional gating, idempotency
- test_secretsync_manifest.py: resolve-aio outputs, SPC/MI/KV creation, idempotency
- test_opc_ua_solution_manifest.py: deployment, conditionals, idempotency

CI workflows:
- .github/workflows/integration-test.yaml (GHA)
- .pipelines/integration-test.yaml (ADO)
- On-demand dispatch with manifest, skip-cleanup, and selector inputs
…cript

Replace three copies of dot-notation expansion logic with a single
reusable script (scripts/generate-site-overrides.py).

- Supports stdin, --from-env, and --file input modes
- Validates site names against path traversal (^[a-zA-Z0-9_-]+$)
- Uses yaml.safe_dump (fixes yaml.dump in test conftest)
- GHA and ADO deploy workflows now pipe to the script
- Integration test conftest calls the script via subprocess
- Platform-specific log masking remains in workflow YAML
@digimaun digimaun changed the title test: add test harness, workspace validation, and integration test framework test: add test harness, workspace validation, and integration tests Apr 8, 2026
Comment thread .github/workflows/integration-test.yaml Fixed
@digimaun digimaun force-pushed the test_harness_and_coverage branch 2 times, most recently from bb7fa48 to 2b38d6f Compare April 9, 2026 00:04
@digimaun digimaun force-pushed the test_harness_and_coverage branch from 2b38d6f to eec03dd Compare April 15, 2026 00:57
@digimaun digimaun marked this pull request as ready for review April 15, 2026 03:16
@digimaun digimaun merged commit 12917dc into Azure:main Apr 15, 2026
6 of 8 checks passed
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.

3 participants