feat(testing): support envconfig in integration test harness#794
Open
THardy98 wants to merge 4 commits into
Open
feat(testing): support envconfig in integration test harness#794THardy98 wants to merge 4 commits into
THardy98 wants to merge 4 commits into
Conversation
THardy98
force-pushed
the
feat/integration-tests-on-cloud
branch
from
July 20, 2026 18:28
a97c498 to
b6e3671
Compare
THardy98
force-pushed
the
feat/integration-tests-on-cloud
branch
from
July 20, 2026 19:17
b6e3671 to
6d7f9b9
Compare
THardy98
marked this pull request as ready for review
July 20, 2026 19:51
jmaeagle99
reviewed
Jul 20, 2026
| { | ||
| // If an existing target is given via environment variable, use that | ||
| if (Environment.GetEnvironmentVariable("TEMPORAL_TEST_CLIENT_TARGET_HOST") is string host) | ||
| if (string.Equals( |
Contributor
There was a problem hiding this comment.
It looks a little strange to have to (1) set envConfigOptions in the ctor, (2) set an environment variable, and then (3) call InitializeAsync, which then decides whether the envConfigOptions is used based on the environment variable.
How about we have the default constructor pass an empty ProfileLoadOptions if the environment variable is set and simplify the check in InitializeAsync?
public WorkflowEnvironment()
: this(UseEnvConfigFromEnvironment() ? new ClientEnvConfig.ProfileLoadOptions() : null)
{
}
internal WorkflowEnvironment(ClientEnvConfig.ProfileLoadOptions? envConfigOptions)
{
this.envConfigOptions = envConfigOptions;
this.kitchenSinkWorker = new(StartKitchenSinkWorker);
}
public async Task InitializeAsync()
{
if (null != envConfigOptions)
{
var options = ClientEnvConfig.LoadClientConnectOptions(envConfigOptions);
env = new(await TemporalClient.ConnectAsync(options));
}
else if (Environment.GetEnvironmentVariable("TEMPORAL_TEST_CLIENT_TARGET_HOST") is string host)
...
}
private static bool UseEnvConfigFromEnvironment() => string.Equals(
Environment.GetEnvironmentVariable("TEMPORAL_TEST_ENV_CONFIG_SERVER"),
"true", StringComparison.OrdinalIgnoreCase);
jmaeagle99
reviewed
Jul 22, 2026
| /// <remarks> | ||
| /// This connects to an existing Temporal environment and does not manage server lifecycle. | ||
| /// </remarks> | ||
| public static async Task<WorkflowEnvironment> CreateFromEnvConfigAsync( |
Contributor
There was a problem hiding this comment.
Does this need to be in the public API? It seems all of these are easily accessible by public consumers that they could do it themselves, if necessary.
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.
What was changed
Add opt-in envconfig support to .NET integration-test harness.
Why?
This enables integration tests to target arbitrary Temporal server environments, including local, staging, release, and Temporal Cloud environments.
Checklist
Part of Run integration tests against cloud features#851
How was this tested:
No