Skip to content

Feat/e2e composition and multi tenancy#152

Merged
iAlexeze merged 14 commits into
mainfrom
feat/e2e-composition-and-multi-tenancy
Jun 1, 2026
Merged

Feat/e2e composition and multi tenancy#152
iAlexeze merged 14 commits into
mainfrom
feat/e2e-composition-and-multi-tenancy

Conversation

@iAlexeze
Copy link
Copy Markdown
Collaborator

@iAlexeze iAlexeze commented Jun 1, 2026

Summary

This PR introduces a powerful composition model for E2E tests, allowing e2e.yaml files to import other e2e.yaml files. This enables reusable test configurations, modular test suites, and DRY test definitions across complex scenarios like multi-tenancy testing.

Key Features

1. E2E Imports Support

  • e2e.yaml can now specify an imports field to include other e2e configurations
  • Imported configurations are merged with precedence (local overrides imports)
  • Supports relative paths (e.g., ./01-basic-namespacing/e2e.yaml)

2. Validation Framework

  • New ork validate e2e command to validate e2e.yaml files
  • Detects circular imports
  • Validates import paths exist and are accessible
  • Provides clear error messages for invalid configurations

3. Reusable Deployment Helpers

  • ResourceExists() - check any K8s resource exists
  • CheckDeployment() - check deployment health with custom failure conditions
  • SyncDeployment() - restart and wait for rollout completion
  • Consolidates RuntimeDeployed/RuntimeInstalled into single source of truth

4. Gateway & ControlCenter Conditional Fixes

  • Gateway and ControlCenter resources are only added when needed
  • Improves test isolation and reduces resource consumption

5. CRD Conversion E2E Test

  • Added e2e test for CRD conversion with webhooks
  • Validates multi-version CRD storage and conversion behavior

Example: Multi-Tenancy Test Suite

apiVersion: orkestra.orkspace.io/v1
kind: E2E
metadata:
  name: multi-tenancy-suite
  description: >
    Suite for the multi-tenancy use-case track. Runs all three sub-examples
    in the same cluster — basic namespacing, cross-access control, and
    shared platform services.

imports:
  - ./01-basic-namespacing/e2e.yaml
  - ./02-cross-access-control/e2e.yaml
  - ./03-shared-platform/e2e.yaml

New Commands

# Validate e2e.yaml with imports
ork validate e2e -f e2e.yaml

# Run e2e tests with version and values
ork e2e -f e2e.yaml --version v1.2.3 --values values.yaml

# Pass Helm arguments
ork e2e -f e2e.yaml --helm-arg replicas=3

Testing

  • Unit tests for import resolution
  • Circular import detection
  • E2E tests for multi-tenancy suite
  • E2E test for CRD conversion with webhooks
  • Validation command tested with invalid imports

Breaking Changes

None. This feature is additive and backward compatible.

iAlexeze added 14 commits June 1, 2026 01:00
Types:
- KatalogMeta.Namespace — logical tenant scope, defaults to "default"
- KatalogFile.CrossAccess — Katalog-level default for cross reads
- CRDEntry.KatalogNamespace — stamped by merger, propagated through ValidateConfig
- CRDEntry.KatalogDescription — description from source Katalog metadata, falls back
  to Komposer description when the sub-Katalog has none
- CRDEntry.KatalogVersion — version from source Katalog metadata, same fallback pattern
- CRDEntry.CrossAccess — CRD-level override; nil means open (default)

Merger:
- loadKatalog stamps KatalogNamespace, KatalogDescription, KatalogVersion from
  doc.Metadata fields
- Komposer applies Description and Version fallbacks across all imported CRDs when
  the sub-Katalog declares none (same pattern as namespace → "default")
- Applies Katalog-level CrossAccess as default for CRDs that don't declare their own

Runtime:
- BuildKatalogHandler builds namespaces: map[string]KatalogNamespaceSummary
  alongside the flat crds array. ClusterName from kfg.Cluster().Name() included.
- KatalogNamespaceSummary gains Description, Version, Workers, Resources — accumulated
  from CRD entries in the namespace grouping loop
- CRDSummaryResponse gains KatalogNamespace field
- ReadCrossFromInformer checks sourceCrossAccess before returning data
- KatalogRegistry interface gains GetCrossAccessByName; implemented on ResourceKatalog

Control Center:
- KatalogResponse gains Namespaces and ClusterName fields
- KatalogNamespaceSummary CC type mirrors runtime: adds Description, Version, Workers,
  Resources
- Removed NamespaceGroup, HasMultipleNamespaces, NamespaceGroups from KatalogData
- KatalogSummary gains NamespaceDetails map[string]KatalogNamespaceSummary
- handleKatalogPanel reads ?ns= query param; filters CRDs to that namespace, recomputes
  TotalCRDs, TotalWorkers, TotalResources, StatusCounts from the filtered slice
- computeStatusCounts helper added
- handleIndex wires NamespaceDetails: kat.Namespaces into each KatalogSummary
- index.html: when a Katalog has >1 namespace, renders one card per namespace — title
  is the namespace name, subtitle pill is the Katalog name, stats and description are
  per-namespace from NamespaceDetails, link goes to /katalog/{name}?ns={ns}
- katalog.html: unchanged — flat CRD grid; namespace filtering is backend-side via ?ns=
- CSS: cc-card is now display:flex/column so footer sticks to bottom; list-view
  rewritten to 3-section row (name·badge·pills | stats flex-1 | button far-right);
  cc-dropdown gets opaque background and shadow; cc-check-row layout rules added

Examples:
- examples/use-cases/multi-tenancy/ — 3 progressive examples + root komposer
- Sub-example READMEs corrected: removed helm install step and -f komposer.yaml flag;
  use ork validate / ork run / ork control throughout
Docs: documentation/concepts/operatorbox/08-multi-tenancy/index.md
Add end-to-end test configurations for all use-case examples:
- crd-conversion (with/without webhooks)
- enrich (pod-health, warning-events, rollout-observer)
- external (health-gate, config-inject, image-signing)
- full-stack-app (multi-region, cross-crd, once-secret, anyof)
- multi-region-map
- multi-tenancy (basic-namespacing, cross-access-control, shared-platform)
- normalize (string-cleanup, image-normalization, defaults-without-webhook)
- profiles (resource, security, probes, rolling-update, pdb)

These enable automated testing of all use-case scenarios.
Add start command to launch the Orkestra development server,
enabling local testing and development workflows.
- Add --version, --values, and --helm-arg flags to e2e command
- Update Runner to accept and pass through Orkestra installation options
- Add reusable deployment helpers (ResourceExists, CheckDeployment, SyncDeployment)
- Consolidate RuntimeDeployed/Installed into single check
- Make health checks reusable for any deployment
- Update README examples for better clarity and guidance
- Enhance dependency, service account, and komposer examples documentation
- Improve steady-state simulation documentation
- Clean up registry_push CLI command
- Add new concept documentation for e2e testing
- Document e2e.yaml imports feature allowing test composition
- Update e2e schema reference with imports specification
- Add examples of importing and reusing e2e test configurations
- Improve e2e documentation structure and navigation

This enables test authors to:
  - Share common test configurations across multiple e2e files
  - Compose complex test scenarios from reusable pieces
  - Maintain DRY test definitions
Add e2e.yaml files demonstrating the new imports/composition model:
- full-stack-app/e2e.yaml: Shows complex application testing with imports
- multi-tenancy/e2e.yaml: Demonstrates multi-tenancy test composition

These examples illustrate how to:
  - Import base test configurations
  - Reuse common setup across multiple test scenarios
  - Compose complex e2e tests from reusable pieces
  - Maintain DRY test definitions for multi-tenancy scenarios
- Add e2e.yaml validation with imports resolution
- Validate import paths and detect circular dependencies
- Wire validation to CLI (ork validate e2e command)
- Fix conditional additions for gateway and controlcenter
- Add helper functions for deployment management

Features:
  - Imports must reference valid e2e.yaml files
  - Detect and prevent circular imports
  - Merge imported configurations with proper precedence
  - CLI validation provides clear error messages
  - Gateway and controlcenter are only added when needed

This enables modular e2e test definitions where common
configurations can be imported and validated before execution.
…h webhooks

- Clean up pkg/e2e/runner.go (remove dead code, improve error handling)
- Add e2e.yaml test for crd-conversion with-webhooks scenario
- Ensure proper version conversion testing for CRD webhooks

Changes:
  - Remove unused functions and simplify runner logic
  - Improve error messages and context propagation
  - Add test coverage for CRD conversion with webhook validation
  - Validate version conversion behavior in e2e tests
@iAlexeze iAlexeze merged commit e1c95fe into main Jun 1, 2026
3 of 4 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.

1 participant