Skip to content

Commit f278408

Browse files
committed
Enable only runtime tests
1 parent c44f0b1 commit f278408

File tree

3 files changed

+102
-106
lines changed

3 files changed

+102
-106
lines changed

.github/workflows/ci.yml

Lines changed: 101 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ jobs:
218218
- name: Run Tests
219219
run: npm run test
220220
env:
221-
TEMPORAL_TRACE_NATIVE_CALLS_XXXXX: true
221+
TEMPORAL_TRACE_NATIVE_CALLS: true
222222
RUN_INTEGRATION_TESTS: true
223223
REUSE_V8_CONTEXT: ${{ matrix.reuse-v8-context }}
224224

@@ -238,104 +238,103 @@ jobs:
238238
TEMPORAL_CLOUD_OPS_TEST_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
239239
TEMPORAL_CLOUD_OPS_TEST_API_KEY: ${{ secrets.TEMPORAL_CLIENT_CLOUD_API_KEY }}
240240
TEMPORAL_CLOUD_OPS_TEST_API_VERSION: 2024-05-13-00
241-
242-
# FIXME: Move samples tests to a custom activity
243-
# Sample 1: hello-world to local server
244-
- name: Instantiate sample project using verdaccio artifacts - Hello World
245-
run: |
246-
node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/hello-world --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-hello-world
247-
node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-hello-world"
248-
249-
# Sample 2: hello-world-mtls to cloud server
250-
- name: Instantiate sample project using verdaccio artifacts - Hello World MTLS
251-
run: |
252-
if [ -z "$TEMPORAL_ADDRESS" ] || [ -z "$TEMPORAL_NAMESPACE" ] || [ -z "$TEMPORAL_CLIENT_CERT" ] || [ -z "$TEMPORAL_CLIENT_KEY" ]; then
253-
echo "Skipping hello-world-mtls sample test as required environment variables are not set"
254-
exit 0
255-
fi
256-
257-
node scripts/create-certs-dir.js ${{ steps.tmp-dir.outputs.dir }}/certs
258-
node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/hello-world-mtls --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-hello-world-mtls
259-
node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-hello-world-mtls"
260-
env:
261-
# These env vars are used by the hello-world-mtls sample
262-
TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
263-
TEMPORAL_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
264-
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
265-
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
266-
TEMPORAL_TASK_QUEUE: ${{ format('tssdk-ci-{0}-{1}-sample-hello-world-mtls-{2}-{3}', matrix.platform, matrix.node, github.run_id, github.run_attempt) }}
267-
268-
TEMPORAL_CLIENT_CERT_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.pem
269-
TEMPORAL_CLIENT_KEY_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.key
270-
271-
- name: Destroy certs dir
272-
if: always()
273-
run: rm -rf ${{ steps.tmp-dir.outputs.dir }}/certs
274-
continue-on-error: true
275-
276-
# Sample 3: fetch-esm to local server
277-
- name: Instantiate sample project using verdaccio artifacts - Fetch ESM
278-
run: |
279-
node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/fetch-esm --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-fetch-esm
280-
node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-fetch-esm"
281-
282-
# End samples
283-
284-
- name: Upload NPM logs
285-
uses: actions/upload-artifact@v4
286-
if: failure() || cancelled()
287-
with:
288-
name: integration-tests-${{ matrix.platform }}-node${{ matrix.node }}-${{ matrix.reuse-v8-context && 'reuse' || 'noreuse' }}-logs
289-
path: ${{ startsWith(matrix.platform, 'windows') && 'C:\\npm\\_logs\\' || '~/.npm/_logs/' }}
290-
291-
- name: Upload Dev Server logs
292-
uses: actions/upload-artifact@v4
293-
if: failure() || cancelled()
294-
with:
295-
name: integration-tests-${{ matrix.platform }}-node${{ matrix.node }}-${{ matrix.reuse-v8-context && 'reuse' || 'noreuse' }}-devserver-logs
296-
path: ${{ steps.tmp-dir.outputs.dir }}/devserver.log
297-
298-
conventions:
299-
name: Lint and Prune
300-
uses: ./.github/workflows/conventions.yml
301-
302-
# Runs the features repo tests with this repo's current SDK code
303-
# FIXME: Update this job to reuse native build artifacts from compile-native-binaries
304-
features-tests:
305-
name: Features Tests
306-
uses: temporalio/features/.github/workflows/typescript.yaml@main
307-
with:
308-
typescript-repo-path: ${{github.event.pull_request.head.repo.full_name}}
309-
version: ${{github.event.pull_request.head.ref}}
310-
version-is-repo-ref: true
311-
features-repo-ref: main
312-
313-
stress-tests-no-reuse-context:
314-
name: Stress Tests (No Reuse V8 Context)
315-
# FIXME: Update this job to reuse native build artifacts from compile-native-binaries
316-
uses: ./.github/workflows/stress.yml
317-
with:
318-
test-type: ci-stress
319-
test-timeout-minutes: 20
320-
reuse-v8-context: false
321-
322-
stress-tests-reuse-context:
323-
name: Stress Tests (Reuse V8 Context)
324-
# FIXME: Update this job to reuse native build artifacts from compile-native-binaries
325-
uses: ./.github/workflows/stress.yml
326-
with:
327-
test-type: ci-stress
328-
test-timeout-minutes: 20
329-
reuse-v8-context: true
330-
331-
docs:
332-
name: Build Docs
333-
uses: ./.github/workflows/docs.yml
334-
with:
335-
# Can't publish from forks, as secrets won't be available
336-
publish_target: ${{ vars.IS_TEMPORALIO_SDK_TYPESCRIPT_REPO == 'true' && 'draft' || '' }}
337-
secrets:
338-
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
339-
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
340-
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
341-
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
241+
# # FIXME: Move samples tests to a custom activity
242+
# # Sample 1: hello-world to local server
243+
# - name: Instantiate sample project using verdaccio artifacts - Hello World
244+
# run: |
245+
# node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/hello-world --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-hello-world
246+
# node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-hello-world"
247+
#
248+
# # Sample 2: hello-world-mtls to cloud server
249+
# - name: Instantiate sample project using verdaccio artifacts - Hello World MTLS
250+
# run: |
251+
# if [ -z "$TEMPORAL_ADDRESS" ] || [ -z "$TEMPORAL_NAMESPACE" ] || [ -z "$TEMPORAL_CLIENT_CERT" ] || [ -z "$TEMPORAL_CLIENT_KEY" ]; then
252+
# echo "Skipping hello-world-mtls sample test as required environment variables are not set"
253+
# exit 0
254+
# fi
255+
#
256+
# node scripts/create-certs-dir.js ${{ steps.tmp-dir.outputs.dir }}/certs
257+
# node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/hello-world-mtls --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-hello-world-mtls
258+
# node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-hello-world-mtls"
259+
# env:
260+
# # These env vars are used by the hello-world-mtls sample
261+
# TEMPORAL_ADDRESS: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}.tmprl.cloud:7233
262+
# TEMPORAL_NAMESPACE: ${{ vars.TEMPORAL_CLIENT_NAMESPACE }}
263+
# TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
264+
# TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
265+
# TEMPORAL_TASK_QUEUE: ${{ format('tssdk-ci-{0}-{1}-sample-hello-world-mtls-{2}-{3}', matrix.platform, matrix.node, github.run_id, github.run_attempt) }}
266+
#
267+
# TEMPORAL_CLIENT_CERT_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.pem
268+
# TEMPORAL_CLIENT_KEY_PATH: ${{ steps.tmp-dir.outputs.dir }}/certs/client.key
269+
#
270+
# - name: Destroy certs dir
271+
# if: always()
272+
# run: rm -rf ${{ steps.tmp-dir.outputs.dir }}/certs
273+
# continue-on-error: true
274+
#
275+
# # Sample 3: fetch-esm to local server
276+
# - name: Instantiate sample project using verdaccio artifacts - Fetch ESM
277+
# run: |
278+
# node scripts/init-from-verdaccio.js --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry --sample https://github.com/temporalio/samples-typescript/tree/main/fetch-esm --target-dir ${{ steps.tmp-dir.outputs.dir }}/sample-fetch-esm
279+
# node scripts/test-example.js --work-dir "${{ steps.tmp-dir.outputs.dir }}/sample-fetch-esm"
280+
#
281+
# # End samples
282+
#
283+
# - name: Upload NPM logs
284+
# uses: actions/upload-artifact@v4
285+
# if: failure() || cancelled()
286+
# with:
287+
# name: integration-tests-${{ matrix.platform }}-node${{ matrix.node }}-${{ matrix.reuse-v8-context && 'reuse' || 'noreuse' }}-logs
288+
# path: ${{ startsWith(matrix.platform, 'windows') && 'C:\\npm\\_logs\\' || '~/.npm/_logs/' }}
289+
#
290+
# - name: Upload Dev Server logs
291+
# uses: actions/upload-artifact@v4
292+
# if: failure() || cancelled()
293+
# with:
294+
# name: integration-tests-${{ matrix.platform }}-node${{ matrix.node }}-${{ matrix.reuse-v8-context && 'reuse' || 'noreuse' }}-devserver-logs
295+
# path: ${{ steps.tmp-dir.outputs.dir }}/devserver.log
296+
297+
#conventions:
298+
# name: Lint and Prune
299+
# uses: ./.github/workflows/conventions.yml
300+
301+
# Runs the features repo tests with this repo's current SDK code
302+
# FIXME: Update this job to reuse native build artifacts from compile-native-binaries
303+
#features-tests:
304+
# name: Features Tests
305+
# uses: temporalio/features/.github/workflows/typescript.yaml@main
306+
# with:
307+
# typescript-repo-path: ${{github.event.pull_request.head.repo.full_name}}
308+
# version: ${{github.event.pull_request.head.ref}}
309+
# version-is-repo-ref: true
310+
# features-repo-ref: main
311+
312+
#stress-tests-no-reuse-context:
313+
# name: Stress Tests (No Reuse V8 Context)
314+
# # FIXME: Update this job to reuse native build artifacts from compile-native-binaries
315+
# uses: ./.github/workflows/stress.yml
316+
# with:
317+
# test-type: ci-stress
318+
# test-timeout-minutes: 20
319+
# reuse-v8-context: false
320+
321+
#stress-tests-reuse-context:
322+
# name: Stress Tests (Reuse V8 Context)
323+
# # FIXME: Update this job to reuse native build artifacts from compile-native-binaries
324+
# uses: ./.github/workflows/stress.yml
325+
# with:
326+
# test-type: ci-stress
327+
# test-timeout-minutes: 20
328+
# reuse-v8-context: true
329+
330+
#docs:
331+
# name: Build Docs
332+
# uses: ./.github/workflows/docs.yml
333+
# with:
334+
# # Can't publish from forks, as secrets won't be available
335+
# publish_target: ${{ vars.IS_TEMPORALIO_SDK_TYPESCRIPT_REPO == 'true' && 'draft' || '' }}
336+
# secrets:
337+
# ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
338+
# VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
339+
# VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
340+
# VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

packages/test/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
"build": "npm-run-all build:protos build:ts",
88
"build:ts": "tsc --build",
99
"build:protos": "node ./scripts/compile-proto.js",
10-
"test": "ava ./lib/test-*.js",
11-
"test:xxxx": "ava ./lib/test-bridge.js -m \"Stopping Worker after creating another runtime doesn't fail\"",
10+
"test": "ava ./lib/test-runtime.js",
1211
"test.watch": "ava --watch ./lib/test-*.js"
1312
},
1413
"ava": {

packages/test/src/test-bridge.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ test("Dropping EphemeralServer without shutting it down doesn't hang process", a
163163
});
164164

165165
test("Stopping Worker after creating another runtime doesn't fail", async (t) => {
166-
t.timeout(120 * 1000);
167166
async function expectShutdownError(taskPromise: Promise<Buffer>) {
168167
await t.throwsAsync(taskPromise, {
169168
instanceOf: errors.ShutdownError,
@@ -218,7 +217,6 @@ test("Stopping Worker after creating another runtime doesn't fail", async (t) =>
218217
await native.workerValidate(worker2);
219218
const wftPromise2 = native.workerPollWorkflowActivation(worker2);
220219
const atPromise2 = native.workerPollActivityTask(worker2);
221-
// await setTimeout(3000);
222220
native.workerInitiateShutdown(worker2);
223221
await expectShutdownError(wftPromise2);
224222
await expectShutdownError(atPromise2);

0 commit comments

Comments
 (0)