feat: add WithName option for test environment loader#1002
Conversation
Allow tests to set a custom environment name via `WithName`, falling back to the default name when unset. The default name has also been exposed as a public constant
|
There was a problem hiding this comment.
Pull request overview
This PR adds a WithName loader option so tests can override the test environment’s Environment.Name, while preserving the existing default name when no override is provided. It also makes the default name available to external callers via a new exported constant.
Changes:
- Added
WithName(string)load option to set the environment name via loader components. - Exposed the default environment name as
DefaultEnvironmentName. - Updated loader to use the configured name when present, otherwise defaulting to
DefaultEnvironmentName, and added a unit test for the override path.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
engine/test/environment/options.go |
Adds the WithName LoadOpt to set components.Name. |
engine/test/environment/environment.go |
Exports DefaultEnvironmentName and applies name override/defaulting during Load. |
engine/test/environment/environment_test.go |
Adds coverage for the WithName option setting env.Name. |
engine/test/environment/components.go |
Extends components with a Name field consumed by the loader. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|




Allow tests to set a custom environment name via
WithName, falling back to the default name when unset.The default name has also been exposed as a public constant