Repository navigation
test(traefik): add TestCustomProjectConfig for custom project-level Traefik configuration - #8114
Merged
Merged
Conversation
…nfiguration ## The Issue Custom project-level Traefik configuration (after removing #ddev-generated) lacked automated testing to verify the complete workflow. The existing tests covered global custom configuration but not project-specific customization. ## How This PR Solves The Issue Adds `TestCustomProjectConfig` which: - Generates default project Traefik config with #ddev-generated marker - Removes the marker to take ownership of the configuration - Modifies config to enable HTTP→HTTPS redirect middleware (commented out by default) - Verifies the custom config propagates to: - Project's .ddev/traefik/config/ directory - Global ~/.ddev/traefik/config/ directory - Router container's /mnt/ddev-global-cache/traefik/config/ volume - Validates actual behavior change by confirming HTTP requests redirect to HTTPS ## Manual Testing Instructions ```bash make testpkg TESTARGS="-run TestCustomProjectConfig" ``` The test should pass and demonstrate that: 1. Custom project config (without #ddev-generated) is not overwritten 2. The config is properly deployed to all expected locations 3. Traefik actually uses the custom configuration (HTTP→HTTPS redirect works) ## Automated Testing Overview The new test covers the complete end-to-end workflow for custom project-level Traefik configuration as documented in docs/users/extend/traefik-router.md. Key validations: - File propagation through the entire config chain - Traefik loads and applies the custom configuration - Behavior changes as expected (HTTP→HTTPS redirect) - Cleanup removes custom config so it regenerates properly ## Release/Deployment Notes No deployment impact. This is purely a test enhancement to improve coverage of an existing feature (custom project-level Traefik configuration). Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
|
Download the artifacts for this pull request:
See Testing a PR. |
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.
The Issue
We didn't have adequate test coverage for custom project traefik configuration.
Custom project-level Traefik configuration (after removing #ddev-generated) lacked automated testing to verify the complete workflow. The existing tests covered global custom configuration but not project-specific customization.
How This PR Solves The Issue
Adds
TestCustomProjectConfigwhich:Related to test attempts in
Hopefully we can figure out where we're at with current HEAD and this test, when we understand that and have good testing the related PRs may be able to proceed.
Manual Testing Instructions
make testpkg TESTARGS="-run TestCustomProjectConfig"The test should pass and demonstrate that:
Automated Testing Overview
TestCustomProjectConfig covers the complete end-to-end workflow for custom project-level Traefik configuration as documented in docs/users/extend/traefik-router.md.
Key validations:
Release/Deployment Notes
No deployment impact. This is purely a test enhancement to improve coverage of an existing feature (custom project-level Traefik configuration).