Skip to content

feat: add WithName option for test environment loader#1002

Merged
jkongie merged 1 commit into
mainfrom
test-env-custom-name
May 22, 2026
Merged

feat: add WithName option for test environment loader#1002
jkongie merged 1 commit into
mainfrom
test-env-custom-name

Conversation

@jkongie
Copy link
Copy Markdown
Collaborator

@jkongie jkongie commented May 22, 2026

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

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
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 22, 2026

⚠️ No Changeset found

Latest commit: 1ae9f83

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jkongie jkongie marked this pull request as ready for review May 22, 2026 12:24
@jkongie jkongie requested a review from a team as a code owner May 22, 2026 12:24
Copilot AI review requested due to automatic review settings May 22, 2026 12:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread engine/test/environment/environment.go
@cl-sonarqube-production
Copy link
Copy Markdown

@jkongie jkongie enabled auto-merge May 22, 2026 13:07
@jkongie jkongie added this pull request to the merge queue May 22, 2026
Merged via the queue into main with commit 8634233 May 22, 2026
30 checks passed
@jkongie jkongie deleted the test-env-custom-name branch May 22, 2026 13:58
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