Repository navigation
feat(#11): Add multi-version traffic splitting E2E test, unit tests, and docs - #58
Merged
Merged
Conversation
…and docs - Add 4-spec E2E test covering v1→canary(80/20)→promote(v2)→decommission(v1) - Verify primary/canary/direct Ingresses created with correct nginx annotations - Assert status reflects traffic split and cleanup on promotion - Test ConfigMap garbage collection when definition deleted - Add 6 unit tests for traffic target selection logic - Cover primary selection (higher weight wins) - Test deterministic primary at equal weights (prevents flapping) - Verify order preservation and weight accuracy - Add concepts/traffic-splitting.adoc guide - Version model: each LFD = separate ConfigMap mounted to distinct directory - Routing modes: nginx (2 versions), Gateway API (N), OpenShift (1) - Direct version access: /v/<version> bypass for testing - 4-step canary runbook with examples - Constraints and edge cases documented - Add make test-e2e-traffic target for focused test runs Closes #11 (routing/canary portion; per-version health deferred to #57) Fixes ginkgo-linter issues with proper test structure
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The decommission E2E does not verify that v2 remains executable, and the documentation overstates gateway reference immutability.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds multi-version traffic-splitting verification and user guidance for LogicFlowService.
Changes:
- Adds a four-stage canary rollout E2E scenario and focused unit tests.
- Adds a dedicated E2E Make target.
- Documents routing modes, direct access, and rollout procedures.
| File | Description |
|---|---|
test/e2e/logicflowservice_test.go |
Adds multi-version rollout E2E coverage. |
test/e2e/e2e_test.go |
Registers the new E2E context. |
Makefile |
Adds the traffic-splitting E2E target. |
internal/controller/logicflowservice_objects_test.go |
Tests traffic-target selection and ordering. |
docs/antora/modules/ROOT/pages/concepts/traffic-splitting.adoc |
Documents traffic splitting and canary rollouts. |
docs/antora/modules/ROOT/nav.adoc |
Adds the new concept page to navigation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Clarify the immutability of ingress.gatewayRef after creation. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…and runtime status Replace workflow invocation with direct state checks: - Verify lfd-e2e-mv-def-v2 ConfigMap exists (not garbage collected) - Verify runtime.status.definitions contains v1.1.0 (proven loaded and active) This avoids timeout issues from workflow execution and directly proves v2 remains operational after v1 deletion, addressing the original concern that a stale Ingress annotation alone doesn't prove v2 can serve requests.
…sion tests Add 1-second polling intervals to Consistently/Eventually blocks: - Promotion check: poll every 1s instead of default ~100ms - Canary cleanup check: poll every 1s instead of default ~100ms This reduces kubectl command spam in test logs while maintaining reliability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Overview
Completes feature #11 (Multi-Version Support & Traffic Splitting) with end-to-end testing, unit test coverage, and user-facing documentation.
Scope: Routing objects (Ingress/Route/HTTPRoute) and canary mechanics. Per-version health tracking deferred to #57.
Changes
E2E Test (4 specs, all passing)
paymentdefinitions (v1.0.0 / v1.1.0)defaultDefinition→ primary Ingress only, no canaryUnit Tests (6 new)
TestSplitTrafficTargets_HigherWeightIsPrimary— 80/20 selects higher weightTestSplitTrafficTargets_HigherWeightSecondIsPrimary— 30/70 selects v2 as primaryTestSplitTrafficTargets_EqualWeightsDeterministic— 50/50 deterministic primary (prevents flapping)TestBuildTrafficTargets_DefaultDefinition— single versionTestBuildTrafficTargets_PreservesOrderAndWeights— order preservationDocumentation
concepts/traffic-splitting.adoc/v/<version>bypassMakefile
make test-e2e-traffictargetVerification
✅ All 4 E2E specs pass (KIND cluster, real Ingress reconciliation)
✅ 6 unit tests pass
✅
go build ./...,go vet,golangci-lintclean✅ Ginkgo dry-run confirms focus selects exactly 4 specs
Related Issues