@temporalio/testing 0.21.1 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temporalio/testing",
3
- "version": "0.21.1",
3
+ "version": "0.23.1",
4
4
  "description": "Temporal.io SDK Testing sub-package",
5
5
  "main": "lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -18,10 +18,10 @@
18
18
  "license": "MIT",
19
19
  "dependencies": {
20
20
  "@grpc/grpc-js": "^1.5.7",
21
- "@temporalio/activity": "^0.21.0",
22
- "@temporalio/client": "^0.21.0",
23
- "@temporalio/common": "^0.21.0",
24
- "@temporalio/worker": "^0.21.1",
21
+ "@temporalio/activity": "^0.23.0",
22
+ "@temporalio/client": "^0.23.0",
23
+ "@temporalio/common": "^0.23.0",
24
+ "@temporalio/worker": "^0.23.1",
25
25
  "@types/long": "^4.0.1",
26
26
  "abort-controller": "^3.0.0",
27
27
  "get-port": "^6.1.2",
@@ -42,5 +42,5 @@
42
42
  "publishConfig": {
43
43
  "access": "public"
44
44
  },
45
- "gitHead": "c241ab2f8e92966555dbd6d01dc072c8965ee6f4"
45
+ "gitHead": "02f84f02cf2b28df57dd77f02514976a1ce83822"
46
46
  }
@@ -1,7 +0,0 @@
1
- import { WorkflowInterceptors } from '@temporalio/workflow';
2
- /**
3
- * Simple interceptor that transforms {@link assert.AssertionError} into non retryable failures.
4
- *
5
- * This allows conveniently using `assert` directly from Workflows.
6
- */
7
- export declare function interceptors(): WorkflowInterceptors;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.interceptors = void 0;
7
- const assert_1 = __importDefault(require("assert"));
8
- const workflow_1 = require("@temporalio/workflow");
9
- /**
10
- * Simple interceptor that transforms {@link assert.AssertionError} into non retryable failures.
11
- *
12
- * This allows conveniently using `assert` directly from Workflows.
13
- */
14
- function interceptors() {
15
- return {
16
- inbound: [
17
- {
18
- async handleSignal(input, next) {
19
- try {
20
- return await next(input);
21
- }
22
- catch (err) {
23
- if (err instanceof assert_1.default.AssertionError) {
24
- const appErr = workflow_1.ApplicationFailure.nonRetryable(err.message);
25
- appErr.stack = err.stack;
26
- throw appErr;
27
- }
28
- }
29
- },
30
- async execute(input, next) {
31
- try {
32
- return await next(input);
33
- }
34
- catch (err) {
35
- if (err instanceof assert_1.default.AssertionError) {
36
- const appErr = workflow_1.ApplicationFailure.nonRetryable(err.message);
37
- appErr.stack = err.stack;
38
- throw appErr;
39
- }
40
- }
41
- },
42
- },
43
- ],
44
- };
45
- }
46
- exports.interceptors = interceptors;
47
- //# sourceMappingURL=assert-to-failure-interceptor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assert-to-failure-interceptor.js","sourceRoot":"","sources":["../src/assert-to-failure-interceptor.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,mDAAgF;AAEhF;;;;GAIG;AACH,SAAgB,YAAY;IAC1B,OAAO;QACL,OAAO,EAAE;YACP;gBACE,KAAK,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI;oBAC5B,IAAI;wBACF,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;qBAC1B;oBAAC,OAAO,GAAG,EAAE;wBACZ,IAAI,GAAG,YAAY,gBAAM,CAAC,cAAc,EAAE;4BACxC,MAAM,MAAM,GAAG,6BAAkB,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;4BAC5D,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;4BACzB,MAAM,MAAM,CAAC;yBACd;qBACF;gBACH,CAAC;gBACD,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI;oBACvB,IAAI;wBACF,OAAO,MAAM,IAAI,CAAC,KAAK,CAAC,CAAC;qBAC1B;oBAAC,OAAO,GAAG,EAAE;wBACZ,IAAI,GAAG,YAAY,gBAAM,CAAC,cAAc,EAAE;4BACxC,MAAM,MAAM,GAAG,6BAAkB,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;4BAC5D,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;4BACzB,MAAM,MAAM,CAAC;yBACd;qBACF;gBACH,CAAC;aACF;SACF;KACF,CAAC;AACJ,CAAC;AA7BD,oCA6BC"}
@@ -1,14 +0,0 @@
1
- /// <reference types="node" />
2
- import { ChildProcess } from 'child_process';
3
- export declare class ChildProcessError extends Error {
4
- readonly code: number | null;
5
- readonly signal: NodeJS.Signals | null;
6
- readonly name = "ChildProcessError";
7
- constructor(message: string, code: number | null, signal: NodeJS.Signals | null);
8
- }
9
- export interface WaitOptions {
10
- validReturnCodes: number[];
11
- }
12
- export declare function waitOnChild(child: ChildProcess, opts?: WaitOptions): Promise<void>;
13
- export declare function kill(child: ChildProcess, signal?: NodeJS.Signals, opts?: WaitOptions): Promise<void>;
14
- export declare const shell: boolean;
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shell = exports.kill = exports.waitOnChild = exports.ChildProcessError = void 0;
4
- class ChildProcessError extends Error {
5
- constructor(message, code, signal) {
6
- super(message);
7
- this.code = code;
8
- this.signal = signal;
9
- this.name = 'ChildProcessError';
10
- }
11
- }
12
- exports.ChildProcessError = ChildProcessError;
13
- async function waitOnChild(child, opts) {
14
- return new Promise((resolve, reject) => {
15
- child.on('exit', (code, signal) => {
16
- if (code !== null && (opts?.validReturnCodes ?? [0]).includes(code)) {
17
- resolve();
18
- }
19
- else {
20
- reject(new ChildProcessError('Process failed', code, signal));
21
- }
22
- });
23
- child.on('error', reject);
24
- });
25
- }
26
- exports.waitOnChild = waitOnChild;
27
- async function kill(child, signal = 'SIGINT', opts) {
28
- if (child.pid === undefined) {
29
- throw new TypeError('Expected child with pid');
30
- }
31
- process.kill(child.pid, signal);
32
- try {
33
- await waitOnChild(child, opts);
34
- }
35
- catch (err) {
36
- // Should error if the error is not a child process error or it is a child
37
- // process and either the platform is Windows or the signal matches.
38
- const shouldError = !(err instanceof ChildProcessError) || (process.platform !== 'win32' && err.signal !== signal);
39
- if (shouldError) {
40
- throw err;
41
- }
42
- }
43
- }
44
- exports.kill = kill;
45
- exports.shell = process.platform === 'win32';
46
- //# sourceMappingURL=child-process.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"child-process.js","sourceRoot":"","sources":["../src/child-process.ts"],"names":[],"mappings":";;;AAGA,MAAa,iBAAkB,SAAQ,KAAK;IAG1C,YAAY,OAAe,EAAkB,IAAmB,EAAkB,MAA6B;QAC7G,KAAK,CAAC,OAAO,CAAC,CAAC;QAD4B,SAAI,GAAJ,IAAI,CAAe;QAAkB,WAAM,GAAN,MAAM,CAAuB;QAF/F,SAAI,GAAG,mBAAmB,CAAC;IAI3C,CAAC;CACF;AAND,8CAMC;AAMM,KAAK,UAAU,WAAW,CAAC,KAAmB,EAAE,IAAkB;IACvE,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;YAChC,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,EAAE,gBAAgB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACnE,OAAO,EAAE,CAAC;aACX;iBAAM;gBACL,MAAM,CAAC,IAAI,iBAAiB,CAAC,gBAAgB,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;aAC/D;QACH,CAAC,CAAC,CAAC;QACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC;AAXD,kCAWC;AAEM,KAAK,UAAU,IAAI,CAAC,KAAmB,EAAE,SAAyB,QAAQ,EAAE,IAAkB;IACnG,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE;QAC3B,MAAM,IAAI,SAAS,CAAC,yBAAyB,CAAC,CAAC;KAChD;IACD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAChC,IAAI;QACF,MAAM,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;KAChC;IAAC,OAAO,GAAG,EAAE;QACZ,0EAA0E;QAC1E,oEAAoE;QACpE,MAAM,WAAW,GAAG,CAAC,CAAC,GAAG,YAAY,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;QACnH,IAAI,WAAW,EAAE;YACf,MAAM,GAAG,CAAC;SACX;KACF;AACH,CAAC;AAfD,oBAeC;AAEY,QAAA,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC"}
package/lib/index.d.ts DELETED
@@ -1,179 +0,0 @@
1
- /// <reference types="node" />
2
- import * as activity from '@temporalio/activity';
3
- import { AsyncCompletionClient, WorkflowClient as BaseWorkflowClient, WorkflowClientOptions, WorkflowResultOptions as BaseWorkflowResultOptions, WorkflowStartOptions as BaseWorkflowStartOptions } from '@temporalio/client';
4
- import { ActivityFunction, Workflow, WorkflowResultType } from '@temporalio/common';
5
- import { NativeConnection, Logger } from '@temporalio/worker';
6
- import { ChildProcess, StdioOptions } from 'child_process';
7
- import events from 'events';
8
- import { Connection, TestService } from './test-service-client';
9
- import { temporal } from '@temporalio/proto';
10
- export declare const DEFAULT_TEST_SERVER_PATH: string;
11
- /**
12
- * Options passed to {@link WorkflowClient.result}, these are the same as the
13
- * {@link BaseWorkflowResultOptions} with an additional option that controls
14
- * whether to toggle time skipping in the Test server while waiting on a
15
- * Workflow's result.
16
- */
17
- export interface WorkflowResultOptions extends BaseWorkflowResultOptions {
18
- /**
19
- * If set to `true`, waiting for the result does not enable time skipping
20
- */
21
- runInNormalTime?: boolean;
22
- }
23
- /**
24
- * Options passed to {@link WorkflowClient.execute}, these are the same as the
25
- * {@link BaseWorkflowStartOptions} with an additional option that controls
26
- * whether to toggle time skipping in the Test server while waiting on a
27
- * Workflow's result.
28
- */
29
- export declare type WorkflowStartOptions<T extends Workflow> = BaseWorkflowStartOptions<T> & {
30
- /**
31
- * If set to `true`, waiting for the result does not enable time skipping
32
- */
33
- runInNormalTime?: boolean;
34
- };
35
- /**
36
- * A client with the exact same API as the "normal" client with 1 exception,
37
- * When this client waits on a Workflow's result, it will enable time skipping
38
- * in the test server.
39
- */
40
- export declare class WorkflowClient extends BaseWorkflowClient {
41
- protected readonly testService: TestService;
42
- constructor(testService: TestService, workflowService?: temporal.api.workflowservice.v1.WorkflowService, options?: WorkflowClientOptions | undefined);
43
- /**
44
- * Execute a Workflow and wait for completion.
45
- *
46
- * @see {@link BaseWorkflowClient.execute}
47
- */
48
- execute<T extends Workflow>(workflowTypeOrFunc: string | T, options: WorkflowStartOptions<T>): Promise<WorkflowResultType<T>>;
49
- /**
50
- * Gets the result of a Workflow execution.
51
- *
52
- * @see {@link BaseWorkflowClient.result}
53
- */
54
- result<T>(workflowId: string, runId?: string | undefined, opts?: WorkflowResultOptions | undefined): Promise<T>;
55
- }
56
- /**
57
- * Convenience workflow interceptors
58
- *
59
- * Contains a single interceptor for transforming `AssertionError`s into non
60
- * retryable `ApplicationFailure`s.
61
- */
62
- export declare const workflowInterceptorModules: string[];
63
- export interface TestServerSpawnerOptions {
64
- /**
65
- * @default {@link DEFAULT_TEST_SERVER_PATH}
66
- */
67
- path?: string;
68
- /**
69
- * @default ignore
70
- */
71
- stdio?: StdioOptions;
72
- }
73
- /**
74
- * A generic callback that returns a child process
75
- */
76
- export declare type TestServerSpawner = (port: number) => ChildProcess;
77
- /**
78
- * Options for {@link TestWorkflowEnvironment.create}
79
- */
80
- export interface TestWorkflowEnvironmentOptions {
81
- testServer?: TestServerSpawner | TestServerSpawnerOptions;
82
- logger?: Logger;
83
- }
84
- /**
85
- * An execution environment for running Workflow integration tests.
86
- *
87
- * Runs an external server.
88
- * By default, the Java test server is used which supports time skipping.
89
- */
90
- export declare class TestWorkflowEnvironment {
91
- protected readonly serverProc: ChildProcess;
92
- /**
93
- * Get an extablished {@link Connection} to the test server
94
- */
95
- readonly connection: Connection;
96
- /**
97
- * An {@link AsyncCompletionClient} for interacting with the test server
98
- */
99
- readonly asyncCompletionClient: AsyncCompletionClient;
100
- /**
101
- * A {@link WorkflowClient} for interacting with the test server
102
- */
103
- readonly workflowClient: WorkflowClient;
104
- /**
105
- * A {@link NativeConnection} for interacting with the test server.
106
- *
107
- * Use this connection when creating Workers for testing.
108
- */
109
- readonly nativeConnection: NativeConnection;
110
- protected constructor(serverProc: ChildProcess, connection: Connection, nativeConnection: NativeConnection);
111
- /**
112
- * Create a new test environment
113
- */
114
- static create(opts?: TestWorkflowEnvironmentOptions): Promise<TestWorkflowEnvironment>;
115
- /**
116
- * Kill the test server process and close the connection to it
117
- */
118
- teardown(): Promise<void>;
119
- /**
120
- * Wait for `durationMs` in "test server time".
121
- *
122
- * The test server toggles between skipped time and normal time depending on what it needs to execute.
123
- *
124
- * This method is likely to resolve in less than `durationMs` of "real time".
125
- *
126
- * Useful for simulating events far into the future like completion of long running activities.
127
- *
128
- * @param durationMs {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
129
- *
130
- * @example
131
- *
132
- * `workflow.ts`
133
- *
134
- * ```ts
135
- * const activities = proxyActivities({ startToCloseTimeout: 2_000_000 });
136
- *
137
- * export async function raceActivityAndTimer(): Promise<string> {
138
- * return await Promise.race([
139
- * wf.sleep(500_000).then(() => 'timer'),
140
- * activities.longRunning().then(() => 'activity'),
141
- * ]);
142
- * }
143
- * ```
144
- *
145
- * `test.ts`
146
- *
147
- * ```ts
148
- * const worker = await Worker.create({
149
- * connection: testEnv.nativeConnection,
150
- * activities: {
151
- * async longRunning() {
152
- * await testEnv.sleep(1_000_000); // <-- sleep called here
153
- * },
154
- * },
155
- * // ...
156
- * });
157
- * ```
158
- */
159
- sleep: (durationMs: number | string) => Promise<void>;
160
- }
161
- /**
162
- * Used as the default activity info for Activities executed in the {@link MockActivityEnvironment}
163
- */
164
- export declare const defaultActivityInfo: activity.Info;
165
- /**
166
- * An execution environment for testing Activities.
167
- *
168
- * Mocks Activity {@link Context | activity.Context} and exposes hooks for
169
- * cancellation and heartbeats.
170
- */
171
- export declare class MockActivityEnvironment extends events.EventEmitter {
172
- cancel: (reason?: any) => void;
173
- readonly context: activity.Context;
174
- constructor(info?: Partial<activity.Info>);
175
- /**
176
- * Run a function in Activity Context
177
- */
178
- run<P extends any[], R, F extends ActivityFunction<P, R>>(fn: F, ...args: P): Promise<R>;
179
- }
package/lib/index.js DELETED
@@ -1,245 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.MockActivityEnvironment = exports.defaultActivityInfo = exports.TestWorkflowEnvironment = exports.workflowInterceptorModules = exports.WorkflowClient = exports.DEFAULT_TEST_SERVER_PATH = void 0;
30
- const activity = __importStar(require("@temporalio/activity"));
31
- const client_1 = require("@temporalio/client");
32
- const common_1 = require("@temporalio/common");
33
- const worker_1 = require("@temporalio/worker");
34
- const path_1 = __importDefault(require("path"));
35
- const os_1 = __importDefault(require("os"));
36
- const abort_controller_1 = require("abort-controller");
37
- const child_process_1 = require("child_process");
38
- const events_1 = __importDefault(require("events"));
39
- const child_process_2 = require("./child-process");
40
- const test_service_client_1 = require("./test-service-client");
41
- const TEST_SERVER_EXECUTABLE_NAME = os_1.default.platform() === 'win32' ? 'test-server.exe' : 'test-server';
42
- exports.DEFAULT_TEST_SERVER_PATH = path_1.default.join(__dirname, `../${TEST_SERVER_EXECUTABLE_NAME}`);
43
- /**
44
- * A client with the exact same API as the "normal" client with 1 exception,
45
- * When this client waits on a Workflow's result, it will enable time skipping
46
- * in the test server.
47
- */
48
- class WorkflowClient extends client_1.WorkflowClient {
49
- constructor(testService, workflowService, options) {
50
- super(workflowService, options);
51
- this.testService = testService;
52
- }
53
- /**
54
- * Execute a Workflow and wait for completion.
55
- *
56
- * @see {@link BaseWorkflowClient.execute}
57
- */
58
- async execute(workflowTypeOrFunc, options) {
59
- return super.execute(workflowTypeOrFunc, options);
60
- }
61
- /**
62
- * Gets the result of a Workflow execution.
63
- *
64
- * @see {@link BaseWorkflowClient.result}
65
- */
66
- async result(workflowId, runId, opts) {
67
- if (opts?.runInNormalTime) {
68
- return await super.result(workflowId, runId, opts);
69
- }
70
- await this.testService.unlockTimeSkipping({});
71
- try {
72
- return await super.result(workflowId, runId, opts);
73
- }
74
- finally {
75
- await this.testService.lockTimeSkipping({});
76
- }
77
- }
78
- }
79
- exports.WorkflowClient = WorkflowClient;
80
- /**
81
- * Convenience workflow interceptors
82
- *
83
- * Contains a single interceptor for transforming `AssertionError`s into non
84
- * retryable `ApplicationFailure`s.
85
- */
86
- exports.workflowInterceptorModules = [path_1.default.join(__dirname, 'assert-to-failure-interceptor')];
87
- function addDefaults({ testServer, logger, }) {
88
- return {
89
- testServerSpawner: typeof testServer === 'function'
90
- ? testServer
91
- : (port) => (0, child_process_1.spawn)(testServer?.path || exports.DEFAULT_TEST_SERVER_PATH, [`${port}`], {
92
- stdio: testServer?.stdio || 'ignore',
93
- }),
94
- logger: logger ?? new worker_1.DefaultLogger('INFO'),
95
- };
96
- }
97
- // TS transforms `import` statements into `require`s, this is a workaround until
98
- // tsconfig module nodenext is stable.
99
- const _importDynamic = new Function('modulePath', 'return import(modulePath)');
100
- /**
101
- * An execution environment for running Workflow integration tests.
102
- *
103
- * Runs an external server.
104
- * By default, the Java test server is used which supports time skipping.
105
- */
106
- class TestWorkflowEnvironment {
107
- constructor(serverProc, connection, nativeConnection) {
108
- this.serverProc = serverProc;
109
- /**
110
- * Wait for `durationMs` in "test server time".
111
- *
112
- * The test server toggles between skipped time and normal time depending on what it needs to execute.
113
- *
114
- * This method is likely to resolve in less than `durationMs` of "real time".
115
- *
116
- * Useful for simulating events far into the future like completion of long running activities.
117
- *
118
- * @param durationMs {@link https://www.npmjs.com/package/ms | ms} formatted string or number of milliseconds
119
- *
120
- * @example
121
- *
122
- * `workflow.ts`
123
- *
124
- * ```ts
125
- * const activities = proxyActivities({ startToCloseTimeout: 2_000_000 });
126
- *
127
- * export async function raceActivityAndTimer(): Promise<string> {
128
- * return await Promise.race([
129
- * wf.sleep(500_000).then(() => 'timer'),
130
- * activities.longRunning().then(() => 'activity'),
131
- * ]);
132
- * }
133
- * ```
134
- *
135
- * `test.ts`
136
- *
137
- * ```ts
138
- * const worker = await Worker.create({
139
- * connection: testEnv.nativeConnection,
140
- * activities: {
141
- * async longRunning() {
142
- * await testEnv.sleep(1_000_000); // <-- sleep called here
143
- * },
144
- * },
145
- * // ...
146
- * });
147
- * ```
148
- */
149
- this.sleep = async (durationMs) => {
150
- await this.connection.testService.unlockTimeSkippingWithSleep({ duration: (0, common_1.msToTs)(durationMs) });
151
- };
152
- this.connection = connection;
153
- this.nativeConnection = nativeConnection;
154
- this.workflowClient = new WorkflowClient(this.connection.testService, this.connection.service);
155
- this.asyncCompletionClient = new client_1.AsyncCompletionClient(this.connection.service);
156
- }
157
- /**
158
- * Create a new test environment
159
- */
160
- static async create(opts) {
161
- // No, we're not going to compile this to ESM for one dependency
162
- const getPort = (await _importDynamic('get-port')).default;
163
- const port = await getPort();
164
- const { testServerSpawner, logger } = addDefaults(opts ?? {});
165
- const child = testServerSpawner(port);
166
- const address = `127.0.0.1:${port}`;
167
- const conn = new test_service_client_1.Connection({ address });
168
- try {
169
- await Promise.race([
170
- conn.untilReady(),
171
- (0, child_process_2.waitOnChild)(child).then(() => {
172
- throw new Error('Test server child process exited prematurely');
173
- }),
174
- ]);
175
- }
176
- catch (err) {
177
- try {
178
- await (0, child_process_2.kill)(child);
179
- }
180
- catch (error) {
181
- logger.error('Failed to kill test server child process', { error });
182
- }
183
- throw err;
184
- }
185
- const nativeConnection = await worker_1.NativeConnection.create({ address });
186
- return new this(child, conn, nativeConnection);
187
- }
188
- /**
189
- * Kill the test server process and close the connection to it
190
- */
191
- async teardown() {
192
- this.connection.client.close();
193
- // TODO: the server should return exit code 0
194
- await (0, child_process_2.kill)(this.serverProc, 'SIGINT', { validReturnCodes: [0, 130] });
195
- }
196
- }
197
- exports.TestWorkflowEnvironment = TestWorkflowEnvironment;
198
- /**
199
- * Used as the default activity info for Activities executed in the {@link MockActivityEnvironment}
200
- */
201
- exports.defaultActivityInfo = {
202
- attempt: 1,
203
- isLocal: false,
204
- taskToken: Buffer.from('test'),
205
- activityId: 'test',
206
- activityType: 'unknown',
207
- workflowType: 'test',
208
- base64TaskToken: Buffer.from('test').toString('base64'),
209
- heartbeatDetails: undefined,
210
- activityNamespace: 'default',
211
- workflowNamespace: 'default',
212
- workflowExecution: { workflowId: 'test', runId: 'dead-beef' },
213
- scheduledTimestampMs: 1,
214
- startToCloseTimeoutMs: 1000,
215
- scheduleToCloseTimeoutMs: 1000,
216
- };
217
- /**
218
- * An execution environment for testing Activities.
219
- *
220
- * Mocks Activity {@link Context | activity.Context} and exposes hooks for
221
- * cancellation and heartbeats.
222
- */
223
- class MockActivityEnvironment extends events_1.default.EventEmitter {
224
- constructor(info) {
225
- super();
226
- this.cancel = () => undefined;
227
- const abortController = new abort_controller_1.AbortController();
228
- const promise = new Promise((_, reject) => {
229
- this.cancel = (reason) => {
230
- abortController.abort();
231
- reject(new common_1.CancelledFailure(reason));
232
- };
233
- });
234
- const heartbeatCallback = (details) => this.emit('heartbeat', details);
235
- this.context = new activity.Context({ ...exports.defaultActivityInfo, ...info }, promise, abortController.signal, heartbeatCallback);
236
- }
237
- /**
238
- * Run a function in Activity Context
239
- */
240
- run(fn, ...args) {
241
- return activity.asyncLocalStorage.run(this.context, fn, ...args);
242
- }
243
- }
244
- exports.MockActivityEnvironment = MockActivityEnvironment;
245
- //# sourceMappingURL=index.js.map
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAiD;AACjD,+CAM4B;AAC5B,+CAA8G;AAC9G,+CAA6E;AAC7E,gDAAwB;AACxB,4CAAoB;AACpB,uDAAmD;AACnD,iDAAkE;AAClE,oDAA4B;AAC5B,mDAAoD;AAEpD,+DAAgE;AAGhE,MAAM,2BAA2B,GAAG,YAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,aAAa,CAAC;AAErF,QAAA,wBAAwB,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,2BAA2B,EAAE,CAAC,CAAC;AA4BlG;;;;GAIG;AACH,MAA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,IAAO;QAChF,OAAO,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IACnE,CAAC;CACF;AA5BD,0DA4BC"}
@@ -1,13 +0,0 @@
1
- import * as grpc from '@grpc/grpc-js';
2
- import { Connection as BaseConnection, ConnectionOptions } from '@temporalio/client';
3
- import { temporal } from '../generated-protos';
4
- export declare type TestService = temporal.api.testservice.v1.TestService;
5
- export declare const TestService: typeof temporal.api.testservice.v1.TestService;
6
- /**
7
- * A Connection class that can be used to interact with both the test server's TestService and WorkflowService
8
- */
9
- export declare class Connection extends BaseConnection {
10
- static readonly TestServiceClient: grpc.ServiceClientConstructor;
11
- readonly testService: TestService;
12
- constructor(options?: ConnectionOptions);
13
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.Connection = exports.TestService = void 0;
27
- const grpc = __importStar(require("@grpc/grpc-js"));
28
- const client_1 = require("@temporalio/client");
29
- const generated_protos_1 = require("../generated-protos");
30
- exports.TestService = generated_protos_1.temporal.api.testservice.v1.TestService;
31
- /**
32
- * A Connection class that can be used to interact with both the test server's TestService and WorkflowService
33
- */
34
- class Connection extends client_1.Connection {
35
- constructor(options) {
36
- super(options);
37
- const rpcImpl = this.generateRPCImplementation('temporal.api.testservice.v1.TestService');
38
- this.testService = new exports.TestService(rpcImpl, false, false);
39
- }
40
- }
41
- exports.Connection = Connection;
42
- Connection.TestServiceClient = grpc.makeGenericClientConstructor({}, 'TestService', {});
43
- //# sourceMappingURL=test-service-client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-service-client.js","sourceRoot":"","sources":["../src/test-service-client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,+CAAqF;AACrF,0DAA+C;AAGhC,mBAAW,GAAK,2BAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,aAAC;AAE3D;;GAEG;AACH,MAAa,UAAW,SAAQ,mBAAc;IAI5C,YAAY,OAA2B;QACrC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,MAAM,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAC,yCAAyC,CAAC,CAAC;QAC1F,IAAI,CAAC,WAAW,GAAG,IAAI,mBAAW,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC5D,CAAC;;AATH,gCAUC;AATwB,4BAAiB,GAAG,IAAI,CAAC,4BAA4B,CAAC,EAAE,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC"}
package/lib/utils.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import { Connection } from '@temporalio/client';
2
- export declare function waitOnNamespace(connection: Connection, namespace: string, maxAttempts?: number, retryIntervalSecs?: number): Promise<void>;
3
- export declare function createNamespace(connection: Connection, namespace: string, maxAttempts?: number, retryIntervalSecs?: number): Promise<void>;
package/lib/utils.js DELETED
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createNamespace = exports.waitOnNamespace = void 0;
4
- const internal_workflow_common_1 = require("@temporalio/internal-workflow-common");
5
- async function waitOnNamespace(connection, namespace, maxAttempts = 100, retryIntervalSecs = 1) {
6
- const runId = '12345678-dead-beef-1234-1234567890ab';
7
- for (let attempt = 1; attempt <= maxAttempts; ++attempt) {
8
- try {
9
- await connection.service.getWorkflowExecutionHistory({
10
- namespace,
11
- execution: { workflowId: 'fake', runId },
12
- });
13
- }
14
- catch (err) {
15
- console.log(err);
16
- if (err.details.includes('workflow history not found') || err.details.includes(runId)) {
17
- break;
18
- }
19
- if (attempt === maxAttempts) {
20
- throw err;
21
- }
22
- await new Promise((resolve) => setTimeout(resolve, retryIntervalSecs * 1000));
23
- }
24
- }
25
- }
26
- exports.waitOnNamespace = waitOnNamespace;
27
- async function createNamespace(connection, namespace, maxAttempts = 100, retryIntervalSecs = 1) {
28
- for (let attempt = 1; attempt <= maxAttempts; ++attempt) {
29
- try {
30
- await connection.service.registerNamespace({ namespace, workflowExecutionRetentionPeriod: (0, internal_workflow_common_1.msToTs)('1 day') });
31
- break;
32
- }
33
- catch (err) {
34
- if (err.details === 'Namespace already exists.') {
35
- break;
36
- }
37
- if (attempt === maxAttempts) {
38
- throw err;
39
- }
40
- await new Promise((resolve) => setTimeout(resolve, retryIntervalSecs * 1000));
41
- }
42
- }
43
- }
44
- exports.createNamespace = createNamespace;
45
- //# sourceMappingURL=utils.js.map
package/lib/utils.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;AACA,mFAA8D;AAEvD,KAAK,UAAU,eAAe,CACnC,UAAsB,EACtB,SAAiB,EACjB,WAAW,GAAG,GAAG,EACjB,iBAAiB,GAAG,CAAC;IAErB,MAAM,KAAK,GAAG,sCAAsC,CAAC;IACrD,KAAK,IAAI,OAAO,GAAG,CAAC,E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