Skip to content

test: adapt Runtime lifecycle integration tests for Cloud - #2536

Open
THardy98 wants to merge 6 commits into
mainfrom
codex/cloud-adapt-runtime-lifecycle
Open

THardy98 wants to merge 6 commits into
mainfrom
codex/cloud-adapt-runtime-lifecycle

Conversation

@THardy98

Copy link
Copy Markdown
Contributor

What was changed

  • The Runtime integration tests (test-runtime.cloud-pending.ts → test-runtime-integration.ts) now use the configured server and namespace instead of an implicit localhost connection. Fixed q1/q2 task queues are now unique.
  • The worker lifecycle tests get back the "Runtime is torn down" assertions that test: adapt worker lifecycle integration tests for Cloud #2457 removed.
  • Both files use a shared helper that creates a Worker on its own connection. That lets the Runtime shut down once the last Worker stops, which a shared test environment would prevent.

The helper picks the server the same way the test environment does: envconfig when TEMPORAL_TEST_ENV_CONFIG_SERVER is set (Cloud), otherwise TEMPORAL_SERVICE_ADDRESS or the default local address.

Why?

Part of moving the integration tests to run on Temporal Cloud, without weakening the Runtime lifecycle checks.

Checklist

  1. Part of [Feature Request] Adapt remaining integration tests to run against Temporal Cloud #2326
  2. How was this tested:
    Both files pass locally against a CLI dev server, three runs in a row (9/9 each).
  3. Any docs updates needed?
    No.

🤖 Generated with Claude Code

@THardy98 THardy98 added the skip-changelog No changelog is necessary for this PR. label Oct 14, 2026
THardy98 and others added 4 commits November 9, 2026 11:16
Use Worker-owned connections built from envconfig instead of the shared
test environment, whose connections keep the Runtime alive, so the tests
again assert that the Runtime shuts down when the last Worker stops.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ests

Tests that assert Runtime teardown need each Worker to own its connection, so
the Runtime shuts down once the last Worker stops; a shared test environment
keeps it alive.

Move that helper into helpers.ts, choosing the server like
createTestWorkflowEnvironment() does (envconfig only when
TEMPORAL_TEST_ENV_CONFIG_SERVER is set, otherwise TEMPORAL_SERVICE_ADDRESS or
the default local address) instead of always reading a local envconfig profile.
Also give lifecycle tests unique task queues, since a namespace may be shared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Runtime integration tests connected implicitly to localhost and the
default namespace. Use Workers that own configured connections (through the
shared helper) and clients on the same configured server, so the Runtime still
shuts down and restarts as the tests expect. Replace the fixed `q1`/`q2` task
queues with unique ones.

Renamed to test-runtime-integration.ts, since test-runtime.ts already exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chris-olszewski
chris-olszewski force-pushed the codex/cloud-adapt-runtime-lifecycle branch from 41814a1 to 51b996a Compare November 9, 2026 17:09
import { RUN_INTEGRATION_TESTS, test, uniqueTaskQueue, Worker } from './helpers';
import { defaultOptions } from './mock-native-worker';

// These tests are local only as there is no way to provide options to the Worker created connection.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are both taken from packages/test/src/test-worker-lifecycle-integration.ts where we can't specify the Worker owned connection to target cloud without depending on internals. I don't think it is worth creating a new internal entrypoint to allow configuring the connection created by Worker.create. Might be worth adding the ability to specify connection options for the Worker owned connection if we really feel we should have cloud coverage here.

@chris-olszewski
chris-olszewski marked this pull request as ready for review November 9, 2026 18:27
@chris-olszewski
chris-olszewski requested a review from a team as a code owner November 9, 2026 18:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog No changelog is necessary for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants