Skip to content

Commit 56551e0

Browse files
committed
combine count & list test. use sano cli version in CI.
1 parent 6948766 commit 56551e0

2 files changed

Lines changed: 10 additions & 20 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
IS_MAIN_OR_RELEASE: ${{ vars.IS_TEMPORALIO_SDK_TYPESCRIPT_REPO == 'true' && github.event_name != 'pull_request' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/releases')) }}
2323

2424
# Use these variables to force specific version of CLI/Time Skipping Server for SDK tests
25-
# TESTS_CLI_VERSION: 'v1.7.0'
25+
TESTS_CLI_VERSION: 'v1.7.1-standalone-nexus-operations'
2626
# TESTS_TIME_SKIPPING_SERVER_VERSION: 'v1.24.1'
2727

2828
jobs:

packages/test/src/test-nexus-standalone.ts

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import * as temporalnexus from '@temporalio/nexus';
1919
import * as workflow from '@temporalio/workflow';
2020
import { CancelledFailure, TerminatedFailure, ApplicationFailure, NexusOperationFailure } from '@temporalio/common';
2121
import { helpers, makeTestFunction } from './helpers-integration';
22+
import { waitUntil } from './helpers';
2223

2324
const test = makeTestFunction({
2425
workflowsPath: __filename,
@@ -227,7 +228,7 @@ test('terminate operation', async (t) => {
227228
});
228229
});
229230

230-
test('list operations', async (t) => {
231+
test('count and list operations', async (t) => {
231232
const { createWorker, registerNexusEndpoint } = helpers(t);
232233
const { endpointName } = await registerNexusEndpoint();
233234
const { handler } = makeTestHandler();
@@ -245,6 +246,13 @@ test('list operations', async (t) => {
245246
});
246247
opIds.add(id);
247248
}
249+
250+
// Visibility has update delay, repeating query until the activity count is as expected
251+
await waitUntil(async () => {
252+
const result = await client.nexus.count(`Endpoint="${endpointName}"`);
253+
return result.count == 3;
254+
}, 10000);
255+
248256
const seen = new Set<string>();
249257
for await (const op of client.nexus.list({ query: `Endpoint="${endpointName}"` })) {
250258
seen.add(op.operationId);
@@ -256,24 +264,6 @@ test('list operations', async (t) => {
256264
});
257265
});
258266

259-
test('count operations', async (t) => {
260-
const { createWorker, registerNexusEndpoint } = helpers(t);
261-
const { endpointName } = await registerNexusEndpoint();
262-
const { handler } = makeTestHandler();
263-
const worker = await createWorker({ nexusServices: [handler] });
264-
265-
await worker.runUntil(async () => {
266-
const { client } = t.context.env;
267-
const svc = client.nexus.createServiceClient({ endpoint: endpointName, service: testService });
268-
await svc.startOperation(testService.operations.echo, 'count-test', {
269-
id: 'count-op-' + randomUUID(),
270-
scheduleToCloseTimeout: '10s',
271-
});
272-
const result = await client.nexus.count(`Endpoint="${endpointName}"`);
273-
t.true(result.count >= 1);
274-
});
275-
});
276-
277267
test('get handle by ID', async (t) => {
278268
const { createWorker, registerNexusEndpoint } = helpers(t);
279269
const { endpointName } = await registerNexusEndpoint();

0 commit comments

Comments
 (0)