@temporalio/testing 1.2.0 → 1.3.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/lib/{test-service-client.d.ts → connection.d.ts} +1 -1
- package/lib/{test-service-client.js → connection.js} +3 -3
- package/lib/connection.js.map +1 -0
- package/lib/index.d.ts +110 -66
- package/lib/index.js +140 -69
- package/lib/index.js.map +1 -1
- package/package.json +8 -21
- package/src/{test-service-client.ts → connection.ts} +1 -1
- package/src/index.ts +209 -135
- package/generated-protos/index.d.ts +0 -4206
- package/generated-protos/index.js +0 -11034
- package/lib/child-process.d.ts +0 -16
- package/lib/child-process.js +0 -57
- package/lib/child-process.js.map +0 -1
- package/lib/index-for-docs.d.ts +0 -1
- package/lib/index-for-docs.js +0 -29
- package/lib/index-for-docs.js.map +0 -1
- package/lib/test-service-client.js.map +0 -1
- package/scripts/common.mjs +0 -18
- package/scripts/compile-proto.mjs +0 -91
- package/scripts/download-test-server.mjs +0 -91
- package/src/child-process.ts +0 -60
- package/src/index-for-docs.ts +0 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as grpc from '@grpc/grpc-js';
|
|
2
2
|
import { Connection as BaseConnection, ConnectionOptions } from '@temporalio/client';
|
|
3
3
|
import { ConnectionCtorOptions as BaseConnectionCtorOptions } from '@temporalio/client/lib/connection';
|
|
4
|
-
import { temporal } from '
|
|
4
|
+
import { temporal } from '@temporalio/proto';
|
|
5
5
|
export declare type TestService = temporal.api.testservice.v1.TestService;
|
|
6
6
|
export declare const TestService: typeof temporal.api.testservice.v1.TestService;
|
|
7
7
|
interface ConnectionCtorOptions extends BaseConnectionCtorOptions {
|
|
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.Connection = exports.TestService = void 0;
|
|
27
27
|
const grpc = __importStar(require("@grpc/grpc-js"));
|
|
28
28
|
const client_1 = require("@temporalio/client");
|
|
29
|
-
const
|
|
30
|
-
exports.TestService =
|
|
29
|
+
const proto_1 = require("@temporalio/proto");
|
|
30
|
+
exports.TestService = proto_1.temporal.api.testservice.v1.TestService;
|
|
31
31
|
/**
|
|
32
32
|
* A Connection class that can be used to interact with both the test server's TestService and WorkflowService
|
|
33
33
|
*/
|
|
@@ -59,4 +59,4 @@ class Connection extends client_1.Connection {
|
|
|
59
59
|
}
|
|
60
60
|
exports.Connection = Connection;
|
|
61
61
|
Connection.TestServiceClient = grpc.makeGenericClientConstructor({}, 'TestService', {});
|
|
62
|
-
//# sourceMappingURL=
|
|
62
|
+
//# sourceMappingURL=connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AACtC,+CAAqF;AAErF,6CAA6C;AAG9B,mBAAW,GAAK,gBAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,aAAC;AAM3D;;GAEG;AACH,MAAa,UAAW,SAAQ,mBAAc;IA2B5C,YAAsB,OAA8B;QAClD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACzC,CAAC;IA1BS,MAAM,CAAC,iBAAiB,CAAC,OAA2B;QAC5D,MAAM,WAAW,GAAG,mBAAc,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC9D,MAAM,OAAO,GAAG,IAAI,CAAC,yBAAyB,CAAC;YAC7C,WAAW,EAAE,yCAAyC;YACtD,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,kBAAkB,EAAE,WAAW,CAAC,kBAAkB;YAClD,YAAY,EAAE,WAAW,CAAC,OAAO,CAAC,YAAY;SAC/C,CAAC,CAAC;QACH,MAAM,WAAW,GAAG,mBAAW,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9D,OAAO,EAAE,GAAG,WAAW,EAAE,WAAW,EAAE,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,OAA2B;QACrC,MAAM,WAAW,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACpD,OAAO,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,OAA2B;QAC9C,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/B,MAAM,GAAG,CAAC,eAAe,EAAE,CAAC;QAC5B,OAAO,GAAG,CAAC;IACb,CAAC;;AAzBH,gCA+BC;AA9BwB,4BAAiB,GAAG,IAAI,CAAC,4BAA4B,CAAC,EAAE,EAAE,aAAa,EAAE,EAAE,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -8,60 +8,36 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
/// <reference types="node" />
|
|
11
|
-
/// <reference types="node" />
|
|
12
11
|
import * as activity from '@temporalio/activity';
|
|
13
|
-
import { AsyncCompletionClient,
|
|
14
|
-
import { ActivityFunction
|
|
15
|
-
import { NativeConnection
|
|
16
|
-
import {
|
|
12
|
+
import { AsyncCompletionClient, Client, ClientOptions, ConnectionLike, WorkflowClient, WorkflowClientOptions, WorkflowResultOptions } from '@temporalio/client';
|
|
13
|
+
import { ActivityFunction } from '@temporalio/common';
|
|
14
|
+
import { NativeConnection } from '@temporalio/worker';
|
|
15
|
+
import { EphemeralServer, EphemeralServerConfig, TemporaliteConfig, TimeSkippingServerConfig } from '@temporalio/core-bridge';
|
|
17
16
|
import events from 'events';
|
|
18
|
-
import { Connection, TestService } from './
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* Workflow's result.
|
|
25
|
-
*/
|
|
26
|
-
export interface WorkflowResultOptions extends BaseWorkflowResultOptions {
|
|
27
|
-
/**
|
|
28
|
-
* If set to `true`, waiting for the result does not enable time skipping
|
|
29
|
-
*/
|
|
30
|
-
runInNormalTime?: boolean;
|
|
17
|
+
import { Connection, TestService } from './connection';
|
|
18
|
+
export { TimeSkippingServerConfig, TemporaliteConfig, EphemeralServerExecutable } from '@temporalio/core-bridge';
|
|
19
|
+
export { EphemeralServerConfig };
|
|
20
|
+
export interface TimeSkippingWorkflowClientOptions extends WorkflowClientOptions {
|
|
21
|
+
connection: Connection;
|
|
22
|
+
enableTimeSkipping: boolean;
|
|
31
23
|
}
|
|
32
|
-
|
|
33
|
-
* Options passed to {@link WorkflowClient.execute}, these are the same as the
|
|
34
|
-
* {@link BaseWorkflowStartOptions} with an additional option that controls
|
|
35
|
-
* whether to toggle time skipping in the Test server while waiting on a
|
|
36
|
-
* Workflow's result.
|
|
37
|
-
*/
|
|
38
|
-
export declare type WorkflowStartOptions<T extends Workflow> = BaseWorkflowStartOptions<T> & {
|
|
39
|
-
/**
|
|
40
|
-
* If set to `true`, waiting for the result does not enable time skipping
|
|
41
|
-
*/
|
|
42
|
-
runInNormalTime?: boolean;
|
|
43
|
-
};
|
|
44
|
-
export interface WorkflowClientOptions extends BaseWorkflowClientOptions {
|
|
24
|
+
export interface TestEnvClientOptions extends ClientOptions {
|
|
45
25
|
connection: Connection;
|
|
26
|
+
enableTimeSkipping: boolean;
|
|
46
27
|
}
|
|
47
28
|
/**
|
|
48
29
|
* A client with the exact same API as the "normal" client with 1 exception,
|
|
49
30
|
* When this client waits on a Workflow's result, it will enable time skipping
|
|
50
31
|
* in the test server.
|
|
51
32
|
*/
|
|
52
|
-
export declare class
|
|
33
|
+
export declare class TimeSkippingWorkflowClient extends WorkflowClient {
|
|
53
34
|
protected readonly testService: TestService;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
* Execute a Workflow and wait for completion.
|
|
57
|
-
*
|
|
58
|
-
* @see {@link BaseWorkflowClient.execute}
|
|
59
|
-
*/
|
|
60
|
-
execute<T extends Workflow>(workflowTypeOrFunc: string | T, options: WorkflowStartOptions<T>): Promise<WorkflowResultType<T>>;
|
|
35
|
+
protected readonly enableTimeSkipping: boolean;
|
|
36
|
+
constructor(options: TimeSkippingWorkflowClientOptions);
|
|
61
37
|
/**
|
|
62
38
|
* Gets the result of a Workflow execution.
|
|
63
39
|
*
|
|
64
|
-
* @see {@link
|
|
40
|
+
* @see {@link WorkflowClient.result}
|
|
65
41
|
*/
|
|
66
42
|
result<T>(workflowId: string, runId?: string | undefined, opts?: WorkflowResultOptions | undefined): Promise<T>;
|
|
67
43
|
}
|
|
@@ -72,27 +48,32 @@ export declare class WorkflowClient extends BaseWorkflowClient {
|
|
|
72
48
|
* retryable `ApplicationFailure`s.
|
|
73
49
|
*/
|
|
74
50
|
export declare const workflowInterceptorModules: string[];
|
|
75
|
-
export interface TestServerSpawnerOptions {
|
|
76
|
-
/**
|
|
77
|
-
* @default {@link DEFAULT_TEST_SERVER_PATH}
|
|
78
|
-
*/
|
|
79
|
-
path?: string;
|
|
80
|
-
/**
|
|
81
|
-
* @default ignore
|
|
82
|
-
*/
|
|
83
|
-
stdio?: StdioOptions;
|
|
84
|
-
}
|
|
85
51
|
/**
|
|
86
|
-
*
|
|
52
|
+
* Subset of the "normal" client options that are used to create a client for the test environment.
|
|
87
53
|
*/
|
|
88
|
-
export declare type
|
|
54
|
+
export declare type ClientOptionsForTestEnv = Omit<ClientOptions, 'namespace' | 'connection'>;
|
|
89
55
|
/**
|
|
90
56
|
* Options for {@link TestWorkflowEnvironment.create}
|
|
91
57
|
*/
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
58
|
+
declare type TestWorkflowEnvironmentOptions = {
|
|
59
|
+
server?: EphemeralServerConfig;
|
|
60
|
+
client?: ClientOptionsForTestEnv;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Options for {@link TestWorkflowEnvironment.createTimeSkipping}
|
|
64
|
+
*/
|
|
65
|
+
export declare type TimeSkippingTestWorkflowEnvironmentOptions = {
|
|
66
|
+
server?: Omit<TimeSkippingServerConfig, 'type'>;
|
|
67
|
+
client?: ClientOptionsForTestEnv;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Options for {@link TestWorkflowEnvironment.createLocal}
|
|
71
|
+
*/
|
|
72
|
+
export declare type LocalTestWorkflowEnvironmentOptions = {
|
|
73
|
+
server?: Omit<TemporaliteConfig, 'type'>;
|
|
74
|
+
client?: ClientOptionsForTestEnv;
|
|
75
|
+
};
|
|
76
|
+
export declare type TestWorkflowEnvironmentOptionsWithDefaults = Required<TestWorkflowEnvironmentOptions>;
|
|
96
77
|
/**
|
|
97
78
|
* An execution environment for running Workflow integration tests.
|
|
98
79
|
*
|
|
@@ -100,17 +81,31 @@ export interface TestWorkflowEnvironmentOptions {
|
|
|
100
81
|
* By default, the Java test server is used which supports time skipping.
|
|
101
82
|
*/
|
|
102
83
|
export declare class TestWorkflowEnvironment {
|
|
103
|
-
|
|
84
|
+
readonly options: TestWorkflowEnvironmentOptionsWithDefaults;
|
|
85
|
+
readonly supportsTimeSkipping: boolean;
|
|
86
|
+
protected readonly server: EphemeralServer;
|
|
104
87
|
/**
|
|
105
|
-
*
|
|
88
|
+
* Namespace used in this environment (taken from {@link TestWorkflowEnvironmentOptions})
|
|
106
89
|
*/
|
|
107
|
-
readonly
|
|
90
|
+
readonly namespace?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Get an established {@link Connection} to the ephemeral server
|
|
93
|
+
*/
|
|
94
|
+
readonly connection: ConnectionLike;
|
|
95
|
+
/**
|
|
96
|
+
* A {@link TestEnvClient} for interacting with the ephemeral server
|
|
97
|
+
*/
|
|
98
|
+
readonly client: Client;
|
|
108
99
|
/**
|
|
109
100
|
* An {@link AsyncCompletionClient} for interacting with the test server
|
|
101
|
+
*
|
|
102
|
+
* @deprecated - use `client.activity` instead
|
|
110
103
|
*/
|
|
111
104
|
readonly asyncCompletionClient: AsyncCompletionClient;
|
|
112
105
|
/**
|
|
113
|
-
* A {@link
|
|
106
|
+
* A {@link TimeSkippingWorkflowClient} for interacting with the test server
|
|
107
|
+
*
|
|
108
|
+
* @deprecated - use `client.workflow` instead
|
|
114
109
|
*/
|
|
115
110
|
readonly workflowClient: WorkflowClient;
|
|
116
111
|
/**
|
|
@@ -119,9 +114,47 @@ export declare class TestWorkflowEnvironment {
|
|
|
119
114
|
* Use this connection when creating Workers for testing.
|
|
120
115
|
*/
|
|
121
116
|
readonly nativeConnection: NativeConnection;
|
|
122
|
-
protected constructor(
|
|
117
|
+
protected constructor(options: TestWorkflowEnvironmentOptionsWithDefaults, supportsTimeSkipping: boolean, server: EphemeralServer, connection: Connection, nativeConnection: NativeConnection);
|
|
118
|
+
/**
|
|
119
|
+
* Start a time skipping workflow environment.
|
|
120
|
+
*
|
|
121
|
+
* By default, this environment will automatically skip to the next events in time when a workflow handle's `result`
|
|
122
|
+
* is awaited on (which includes {@link WorkflowClient.execute}). Before the result is awaited on, time can be
|
|
123
|
+
* manually skipped forward using {@link sleep}. The currently known time can be obtained via {@link currentTimeMs}.
|
|
124
|
+
*
|
|
125
|
+
* Internally, this environment lazily downloads a test-server binary for the current OS/arch from the [Java SDK
|
|
126
|
+
* releases](https://github.com/temporalio/sdk-java/releases) into the temp directory if it is not already there.
|
|
127
|
+
* Then the executable is started and will be killed when {@link teardown} is called.
|
|
128
|
+
*
|
|
129
|
+
* Users can reuse this environment for testing multiple independent workflows, but not concurrently. Time skipping,
|
|
130
|
+
* which is automatically done when awaiting a workflow result and manually done on sleep, is global to the
|
|
131
|
+
* environment, not to the workflow under test.
|
|
132
|
+
*
|
|
133
|
+
* We highly recommend, running tests serially when using a single environment or creating a separate environment per
|
|
134
|
+
* test.
|
|
135
|
+
*
|
|
136
|
+
* In the future, the test server implementation may be changed to another implementation.
|
|
137
|
+
*/
|
|
138
|
+
static createTimeSkipping(opts?: TimeSkippingTestWorkflowEnvironmentOptions): Promise<TestWorkflowEnvironment>;
|
|
139
|
+
/**
|
|
140
|
+
* Start a full Temporal server locally, downloading if necessary.
|
|
141
|
+
*
|
|
142
|
+
* This environment is good for testing full server capabilities, but does not support time skipping like
|
|
143
|
+
* {@link createTimeSkipping} does. {@link supportsTimeSkipping} will always return `false` for this environment.
|
|
144
|
+
* {@link sleep} will sleep the actual amount of time and {@link currentTimeMs} will return the current time.
|
|
145
|
+
*
|
|
146
|
+
* Internally, this uses [Temporalite](https://github.com/temporalio/temporalite). Which is a self-contained binary
|
|
147
|
+
* for Temporal using Sqlite persistence. This will download Temporalite to a temporary directory by default if it
|
|
148
|
+
* has not already been downloaded before and {@link LocalTestWorkflowEnvironmentOptions.server.executable.type} is
|
|
149
|
+
* `'cached-download'`.
|
|
150
|
+
*
|
|
151
|
+
* In the future, the Temporalite implementation may be changed to another implementation.
|
|
152
|
+
*/
|
|
153
|
+
static createLocal(opts?: LocalTestWorkflowEnvironmentOptions): Promise<TestWorkflowEnvironment>;
|
|
123
154
|
/**
|
|
124
155
|
* Create a new test environment
|
|
156
|
+
*
|
|
157
|
+
* @deprecated - use {@link createTimeSkipping} or {@link createLocal}
|
|
125
158
|
*/
|
|
126
159
|
static create(opts?: TestWorkflowEnvironmentOptions): Promise<TestWorkflowEnvironment>;
|
|
127
160
|
/**
|
|
@@ -129,15 +162,19 @@ export declare class TestWorkflowEnvironment {
|
|
|
129
162
|
*/
|
|
130
163
|
teardown(): Promise<void>;
|
|
131
164
|
/**
|
|
132
|
-
* Wait for `durationMs` in "
|
|
133
|
-
*
|
|
134
|
-
* The test server toggles between skipped time and normal time depending on what it needs to execute.
|
|
165
|
+
* Wait for `durationMs` in "server time".
|
|
135
166
|
*
|
|
136
|
-
* This
|
|
167
|
+
* This awaits using regular setTimeout in regular environments, or manually skips time in time-skipping environments.
|
|
137
168
|
*
|
|
138
169
|
* Useful for simulating events far into the future like completion of long running activities.
|
|
139
170
|
*
|
|
140
|
-
*
|
|
171
|
+
* **Time skippping**:
|
|
172
|
+
*
|
|
173
|
+
* The time skippping server toggles between skipped time and normal time depending on what it needs to execute.
|
|
174
|
+
*
|
|
175
|
+
* This method is _likely_ to resolve in less than `durationMs` of "real time".
|
|
176
|
+
*
|
|
177
|
+
* @param durationMs number of milliseconds or {@link https://www.npmjs.com/package/ms | ms-formatted string}
|
|
141
178
|
*
|
|
142
179
|
* @example
|
|
143
180
|
*
|
|
@@ -169,6 +206,13 @@ export declare class TestWorkflowEnvironment {
|
|
|
169
206
|
* ```
|
|
170
207
|
*/
|
|
171
208
|
sleep: (durationMs: number | string) => Promise<void>;
|
|
209
|
+
/**
|
|
210
|
+
* Get the current time known to this environment.
|
|
211
|
+
*
|
|
212
|
+
* For non-time-skipping environments this is simply the system time. For time-skipping environments this is whatever
|
|
213
|
+
* time has been skipped to.
|
|
214
|
+
*/
|
|
215
|
+
currentTimeMs(): Promise<number>;
|
|
172
216
|
}
|
|
173
217
|
/**
|
|
174
218
|
* Used as the default activity info for Activities executed in the {@link MockActivityEnvironment}
|
package/lib/index.js
CHANGED
|
@@ -35,58 +35,71 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.MockActivityEnvironment = exports.defaultActivityInfo = exports.TestWorkflowEnvironment = exports.workflowInterceptorModules = exports.
|
|
38
|
+
exports.MockActivityEnvironment = exports.defaultActivityInfo = exports.TestWorkflowEnvironment = exports.workflowInterceptorModules = exports.TimeSkippingWorkflowClient = void 0;
|
|
39
39
|
const activity = __importStar(require("@temporalio/activity"));
|
|
40
40
|
const client_1 = require("@temporalio/client");
|
|
41
41
|
const common_1 = require("@temporalio/common");
|
|
42
42
|
const worker_1 = require("@temporalio/worker");
|
|
43
|
+
const core_bridge_1 = require("@temporalio/core-bridge");
|
|
43
44
|
const path_1 = __importDefault(require("path"));
|
|
44
|
-
const os_1 = __importDefault(require("os"));
|
|
45
45
|
const abort_controller_1 = require("abort-controller");
|
|
46
|
-
const child_process_1 = require("child_process");
|
|
47
46
|
const events_1 = __importDefault(require("events"));
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const TEST_SERVER_EXECUTABLE_NAME = os_1.default.platform() === 'win32' ? 'test-server.exe' : 'test-server';
|
|
52
|
-
exports.DEFAULT_TEST_SERVER_PATH = path_1.default.join(__dirname, `../${TEST_SERVER_EXECUTABLE_NAME}`);
|
|
47
|
+
const connection_1 = require("./connection");
|
|
48
|
+
const internal_non_workflow_common_1 = require("@temporalio/internal-non-workflow-common");
|
|
49
|
+
const ms_1 = __importDefault(require("ms"));
|
|
53
50
|
/**
|
|
54
51
|
* A client with the exact same API as the "normal" client with 1 exception,
|
|
55
52
|
* When this client waits on a Workflow's result, it will enable time skipping
|
|
56
53
|
* in the test server.
|
|
57
54
|
*/
|
|
58
|
-
class
|
|
55
|
+
class TimeSkippingWorkflowClient extends client_1.WorkflowClient {
|
|
59
56
|
constructor(options) {
|
|
60
57
|
super(options);
|
|
58
|
+
this.enableTimeSkipping = options.enableTimeSkipping;
|
|
61
59
|
this.testService = options.connection.testService;
|
|
62
60
|
}
|
|
63
|
-
/**
|
|
64
|
-
* Execute a Workflow and wait for completion.
|
|
65
|
-
*
|
|
66
|
-
* @see {@link BaseWorkflowClient.execute}
|
|
67
|
-
*/
|
|
68
|
-
async execute(workflowTypeOrFunc, options) {
|
|
69
|
-
return super.execute(workflowTypeOrFunc, options);
|
|
70
|
-
}
|
|
71
61
|
/**
|
|
72
62
|
* Gets the result of a Workflow execution.
|
|
73
63
|
*
|
|
74
|
-
* @see {@link
|
|
64
|
+
* @see {@link WorkflowClient.result}
|
|
75
65
|
*/
|
|
76
66
|
async result(workflowId, runId, opts) {
|
|
77
|
-
if (
|
|
78
|
-
|
|
67
|
+
if (this.enableTimeSkipping) {
|
|
68
|
+
await this.testService.unlockTimeSkipping({});
|
|
69
|
+
try {
|
|
70
|
+
return await super.result(workflowId, runId, opts);
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
await this.testService.lockTimeSkipping({});
|
|
74
|
+
}
|
|
79
75
|
}
|
|
80
|
-
|
|
81
|
-
try {
|
|
76
|
+
else {
|
|
82
77
|
return await super.result(workflowId, runId, opts);
|
|
83
78
|
}
|
|
84
|
-
finally {
|
|
85
|
-
await this.testService.lockTimeSkipping({});
|
|
86
|
-
}
|
|
87
79
|
}
|
|
88
80
|
}
|
|
89
|
-
exports.
|
|
81
|
+
exports.TimeSkippingWorkflowClient = TimeSkippingWorkflowClient;
|
|
82
|
+
/**
|
|
83
|
+
* A client with the exact same API as the "normal" client with one exception:
|
|
84
|
+
* when `TestEnvClient.workflow` (an instance of {@link TimeSkippingWorkflowClient}) waits on a Workflow's result, it will enable time skipping
|
|
85
|
+
* in the Test Server.
|
|
86
|
+
*/
|
|
87
|
+
class TestEnvClient extends client_1.Client {
|
|
88
|
+
constructor(options) {
|
|
89
|
+
super(options);
|
|
90
|
+
const { workflow, loadedDataConverter, interceptors, ...base } = this.options;
|
|
91
|
+
// Recreate the client (this isn't optimal but it's better than adding public methods just for testing).
|
|
92
|
+
// NOTE: we cast to "any" to work around `workflow` being a readonly attribute.
|
|
93
|
+
this.workflow = new TimeSkippingWorkflowClient({
|
|
94
|
+
...base,
|
|
95
|
+
...workflow,
|
|
96
|
+
connection: options.connection,
|
|
97
|
+
dataConverter: loadedDataConverter,
|
|
98
|
+
interceptors: interceptors.workflow,
|
|
99
|
+
enableTimeSkipping: options.enableTimeSkipping,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
90
103
|
/**
|
|
91
104
|
* Convenience workflow interceptors
|
|
92
105
|
*
|
|
@@ -94,14 +107,13 @@ exports.WorkflowClient = WorkflowClient;
|
|
|
94
107
|
* retryable `ApplicationFailure`s.
|
|
95
108
|
*/
|
|
96
109
|
exports.workflowInterceptorModules = [path_1.default.join(__dirname, 'assert-to-failure-interceptor')];
|
|
97
|
-
function addDefaults(
|
|
110
|
+
function addDefaults(opts) {
|
|
98
111
|
return {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
logger: logger ?? new worker_1.DefaultLogger('INFO'),
|
|
112
|
+
server: {
|
|
113
|
+
type: 'time-skipping',
|
|
114
|
+
},
|
|
115
|
+
client: {},
|
|
116
|
+
...opts,
|
|
105
117
|
};
|
|
106
118
|
}
|
|
107
119
|
/**
|
|
@@ -111,18 +123,24 @@ function addDefaults({ testServer, logger, }) {
|
|
|
111
123
|
* By default, the Java test server is used which supports time skipping.
|
|
112
124
|
*/
|
|
113
125
|
class TestWorkflowEnvironment {
|
|
114
|
-
constructor(
|
|
115
|
-
this.
|
|
126
|
+
constructor(options, supportsTimeSkipping, server, connection, nativeConnection) {
|
|
127
|
+
this.options = options;
|
|
128
|
+
this.supportsTimeSkipping = supportsTimeSkipping;
|
|
129
|
+
this.server = server;
|
|
116
130
|
/**
|
|
117
|
-
* Wait for `durationMs` in "
|
|
131
|
+
* Wait for `durationMs` in "server time".
|
|
118
132
|
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* This method is likely to resolve in less than `durationMs` of "real time".
|
|
133
|
+
* This awaits using regular setTimeout in regular environments, or manually skips time in time-skipping environments.
|
|
122
134
|
*
|
|
123
135
|
* Useful for simulating events far into the future like completion of long running activities.
|
|
124
136
|
*
|
|
125
|
-
*
|
|
137
|
+
* **Time skippping**:
|
|
138
|
+
*
|
|
139
|
+
* The time skippping server toggles between skipped time and normal time depending on what it needs to execute.
|
|
140
|
+
*
|
|
141
|
+
* This method is _likely_ to resolve in less than `durationMs` of "real time".
|
|
142
|
+
*
|
|
143
|
+
* @param durationMs number of milliseconds or {@link https://www.npmjs.com/package/ms | ms-formatted string}
|
|
126
144
|
*
|
|
127
145
|
* @example
|
|
128
146
|
*
|
|
@@ -154,42 +172,81 @@ class TestWorkflowEnvironment {
|
|
|
154
172
|
* ```
|
|
155
173
|
*/
|
|
156
174
|
this.sleep = async (durationMs) => {
|
|
157
|
-
|
|
175
|
+
if (this.supportsTimeSkipping) {
|
|
176
|
+
await this.connection.testService.unlockTimeSkippingWithSleep({ duration: (0, common_1.msToTs)(durationMs) });
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
await new Promise((resolve) => setTimeout(resolve, typeof durationMs === 'string' ? (0, ms_1.default)(durationMs) : durationMs));
|
|
180
|
+
}
|
|
158
181
|
};
|
|
159
182
|
this.connection = connection;
|
|
160
183
|
this.nativeConnection = nativeConnection;
|
|
161
|
-
this.
|
|
162
|
-
this.
|
|
184
|
+
this.namespace = options.server.type === 'temporalite' ? options.server.namespace : undefined;
|
|
185
|
+
this.client = new TestEnvClient({
|
|
186
|
+
connection,
|
|
187
|
+
namespace: this.namespace,
|
|
188
|
+
enableTimeSkipping: options.server.type === 'time-skipping',
|
|
189
|
+
...options.client,
|
|
190
|
+
});
|
|
191
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
192
|
+
this.asyncCompletionClient = this.client.activity;
|
|
193
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
194
|
+
this.workflowClient = this.client.workflow;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Start a time skipping workflow environment.
|
|
198
|
+
*
|
|
199
|
+
* By default, this environment will automatically skip to the next events in time when a workflow handle's `result`
|
|
200
|
+
* is awaited on (which includes {@link WorkflowClient.execute}). Before the result is awaited on, time can be
|
|
201
|
+
* manually skipped forward using {@link sleep}. The currently known time can be obtained via {@link currentTimeMs}.
|
|
202
|
+
*
|
|
203
|
+
* Internally, this environment lazily downloads a test-server binary for the current OS/arch from the [Java SDK
|
|
204
|
+
* releases](https://github.com/temporalio/sdk-java/releases) into the temp directory if it is not already there.
|
|
205
|
+
* Then the executable is started and will be killed when {@link teardown} is called.
|
|
206
|
+
*
|
|
207
|
+
* Users can reuse this environment for testing multiple independent workflows, but not concurrently. Time skipping,
|
|
208
|
+
* which is automatically done when awaiting a workflow result and manually done on sleep, is global to the
|
|
209
|
+
* environment, not to the workflow under test.
|
|
210
|
+
*
|
|
211
|
+
* We highly recommend, running tests serially when using a single environment or creating a separate environment per
|
|
212
|
+
* test.
|
|
213
|
+
*
|
|
214
|
+
* In the future, the test server implementation may be changed to another implementation.
|
|
215
|
+
*/
|
|
216
|
+
static async createTimeSkipping(opts) {
|
|
217
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
218
|
+
return await this.create({ server: { type: 'time-skipping', ...opts?.server }, client: opts?.client });
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Start a full Temporal server locally, downloading if necessary.
|
|
222
|
+
*
|
|
223
|
+
* This environment is good for testing full server capabilities, but does not support time skipping like
|
|
224
|
+
* {@link createTimeSkipping} does. {@link supportsTimeSkipping} will always return `false` for this environment.
|
|
225
|
+
* {@link sleep} will sleep the actual amount of time and {@link currentTimeMs} will return the current time.
|
|
226
|
+
*
|
|
227
|
+
* Internally, this uses [Temporalite](https://github.com/temporalio/temporalite). Which is a self-contained binary
|
|
228
|
+
* for Temporal using Sqlite persistence. This will download Temporalite to a temporary directory by default if it
|
|
229
|
+
* has not already been downloaded before and {@link LocalTestWorkflowEnvironmentOptions.server.executable.type} is
|
|
230
|
+
* `'cached-download'`.
|
|
231
|
+
*
|
|
232
|
+
* In the future, the Temporalite implementation may be changed to another implementation.
|
|
233
|
+
*/
|
|
234
|
+
static async createLocal(opts) {
|
|
235
|
+
// eslint-disable-next-line deprecation/deprecation
|
|
236
|
+
return await this.create({ server: { type: 'temporalite', ...opts?.server }, client: opts?.client });
|
|
163
237
|
}
|
|
164
238
|
/**
|
|
165
239
|
* Create a new test environment
|
|
240
|
+
*
|
|
241
|
+
* @deprecated - use {@link createTimeSkipping} or {@link createLocal}
|
|
166
242
|
*/
|
|
167
243
|
static async create(opts) {
|
|
168
|
-
const
|
|
169
|
-
const
|
|
170
|
-
const
|
|
171
|
-
const address = `127.0.0.1:${port}`;
|
|
172
|
-
const connPromise = test_service_client_1.Connection.connect({ address });
|
|
173
|
-
try {
|
|
174
|
-
await Promise.race([
|
|
175
|
-
connPromise,
|
|
176
|
-
(0, child_process_2.waitOnChild)(child).then(() => {
|
|
177
|
-
throw new Error('Test server child process exited prematurely');
|
|
178
|
-
}),
|
|
179
|
-
]);
|
|
180
|
-
}
|
|
181
|
-
catch (err) {
|
|
182
|
-
try {
|
|
183
|
-
await (0, child_process_2.kill)(child);
|
|
184
|
-
}
|
|
185
|
-
catch (error) {
|
|
186
|
-
logger.error('Failed to kill test server child process', { error });
|
|
187
|
-
}
|
|
188
|
-
throw err;
|
|
189
|
-
}
|
|
190
|
-
const conn = await connPromise;
|
|
244
|
+
const optsWithDefaults = addDefaults((0, internal_non_workflow_common_1.filterNullAndUndefined)(opts ?? {}));
|
|
245
|
+
const server = await worker_1.Runtime.instance().createEphemeralServer(optsWithDefaults.server);
|
|
246
|
+
const address = (0, core_bridge_1.getEphemeralServerTarget)(server);
|
|
191
247
|
const nativeConnection = await worker_1.NativeConnection.connect({ address });
|
|
192
|
-
|
|
248
|
+
const connection = await connection_1.Connection.connect({ address });
|
|
249
|
+
return new this(optsWithDefaults, optsWithDefaults.server.type === 'time-skipping', server, connection, nativeConnection);
|
|
193
250
|
}
|
|
194
251
|
/**
|
|
195
252
|
* Kill the test server process and close the connection to it
|
|
@@ -197,8 +254,22 @@ class TestWorkflowEnvironment {
|
|
|
197
254
|
async teardown() {
|
|
198
255
|
await this.connection.close();
|
|
199
256
|
await this.nativeConnection.close();
|
|
200
|
-
|
|
201
|
-
|
|
257
|
+
await worker_1.Runtime.instance().shutdownEphemeralServer(this.server);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Get the current time known to this environment.
|
|
261
|
+
*
|
|
262
|
+
* For non-time-skipping environments this is simply the system time. For time-skipping environments this is whatever
|
|
263
|
+
* time has been skipped to.
|
|
264
|
+
*/
|
|
265
|
+
async currentTimeMs() {
|
|
266
|
+
if (this.supportsTimeSkipping) {
|
|
267
|
+
const { time } = await this.connection.testService.getCurrentTime({});
|
|
268
|
+
return (0, common_1.tsToMs)(time);
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
return Date.now();
|
|
272
|
+
}
|
|
202
273
|
}
|
|
203
274
|
}
|
|
204
275
|
exports.TestWorkflowEnvironment = TestWorkflowEnvironment;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+DAAiD;AACjD,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+DAAiD;AACjD,+CAQ4B;AAC5B,+CAAwF;AACxF,+CAA+D;AAC/D,yDAMiC;AACjC,gDAAwB;AACxB,uDAAmD;AACnD,oDAA4B;AAC5B,6CAAuD;AACvD,2FAAkF;AAClF,4CAAoB;AAepB;;;;GAIG;AACH,MAAa,0BAA2B,SAAQ,uBAAc;IAI5D,YAAY,OAA0C;QACpD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;QACrD,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACM,KAAK,CAAC,MAAM,CACnB,UAAkB,EAClB,KAA0B,EAC1B,IAAwC;QAExC,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,MAAM,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;YAC9C,IAAI;gBACF,OAAO,MAAM,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;aACpD;o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