@efffrida/vitest-pool 0.0.12 → 0.0.14
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/dist/frida/agent.js +19 -74
- package/dist/frida/agent.js.map +1 -1
- package/dist/src/index.d.ts +38 -70
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +146 -316
- package/dist/src/index.js.map +1 -1
- package/package.json +19 -20
- package/src/index.ts +215 -382
package/dist/frida/agent.js
CHANGED
|
@@ -5,44 +5,25 @@ import { createStackString, parseStacktrace } from "@vitest/utils/source-map";
|
|
|
5
5
|
import { createBirpc } from "birpc";
|
|
6
6
|
import { stringify as flattedStringify } from "flatted";
|
|
7
7
|
import { EvaluatedModules } from "vitest";
|
|
8
|
-
const testFiles = {};
|
|
9
8
|
// There should only ever be one test running at a time in a worker and these
|
|
10
9
|
// need to be shared across multiple rpc calls anyways so they will live up here
|
|
11
10
|
// in the module scope.
|
|
12
11
|
let runPromise;
|
|
13
12
|
let setupContext;
|
|
14
|
-
// How to post messages to the parent process - use flatted to handle circular references
|
|
15
|
-
const postMessage = message => send(flattedStringify(message, (_key, value) => {
|
|
16
|
-
/** @see https://github.com/vitest-dev/vitest/blob/372e86fdef381038a2c4999fc9007dd7292a0628/packages/vitest/src/node/ast-collect.ts#L216-L236 */
|
|
17
|
-
if (value !== null && typeof value === "object" && "name" in value && "message" in value && "stack" in value && typeof value.stack !== "string") {
|
|
18
|
-
return {
|
|
19
|
-
...value,
|
|
20
|
-
stack: value.stack === undefined ? undefined : JSON.stringify(value.stack)
|
|
21
|
-
};
|
|
22
|
-
} else {
|
|
23
|
-
return value;
|
|
24
|
-
}
|
|
25
|
-
}));
|
|
26
|
-
const postWorkerResponse = response => postMessage({
|
|
27
|
-
...response,
|
|
28
|
-
__vitest_worker_response__: true
|
|
29
|
-
});
|
|
30
13
|
// Collections of listeners
|
|
31
14
|
const cleanupListeners = /*#__PURE__*/new Set();
|
|
32
15
|
const cancelListeners = /*#__PURE__*/new Set();
|
|
33
16
|
const messageListeners = /*#__PURE__*/new Set();
|
|
17
|
+
// Bidirectional rpc
|
|
34
18
|
const birpc = /*#__PURE__*/createBirpc({
|
|
35
19
|
async onCancel(reason) {
|
|
36
20
|
await Promise.allSettled([...cancelListeners.values()].map(listener => listener(reason)));
|
|
37
21
|
}
|
|
38
22
|
}, {
|
|
39
|
-
// How to serialize and deserialize messages.
|
|
40
|
-
serialize: data => data,
|
|
41
|
-
deserialize: data => data,
|
|
42
23
|
// How to send and receive messages.
|
|
43
|
-
post: postMessage,
|
|
44
|
-
on: rpcListener => messageListeners.add(rpcListener),
|
|
45
24
|
off: rpcListener => messageListeners.delete(rpcListener),
|
|
25
|
+
on: rpcListener => messageListeners.add(rpcListener),
|
|
26
|
+
post: message => typeof message === "string" ? send(message) : send(flattedStringify(message)),
|
|
46
27
|
// Names of remote functions that do not need response.
|
|
47
28
|
// These are fire-and-forget messages to the vitest pool coordinator.
|
|
48
29
|
eventNames: ["onUserConsoleLog", "onCollected", "onCancel"],
|
|
@@ -107,8 +88,9 @@ rpc.exports["onMessage"] = async message => {
|
|
|
107
88
|
rpc: birpc,
|
|
108
89
|
projectName: config.name ?? ""
|
|
109
90
|
};
|
|
110
|
-
return
|
|
111
|
-
type: "started"
|
|
91
|
+
return send({
|
|
92
|
+
type: "started",
|
|
93
|
+
__vitest_worker_response__: true
|
|
112
94
|
});
|
|
113
95
|
}
|
|
114
96
|
case "stop":
|
|
@@ -123,16 +105,18 @@ rpc.exports["onMessage"] = async message => {
|
|
|
123
105
|
await Promise.allSettled([...cleanupListeners.values()].map(listener => listener()));
|
|
124
106
|
cancelListeners.clear();
|
|
125
107
|
cleanupListeners.clear();
|
|
126
|
-
return
|
|
127
|
-
type: "stopped"
|
|
108
|
+
return send({
|
|
109
|
+
type: "stopped",
|
|
110
|
+
__vitest_worker_response__: true
|
|
128
111
|
});
|
|
129
112
|
}
|
|
130
113
|
case "run":
|
|
131
114
|
case "collect":
|
|
132
115
|
{
|
|
133
116
|
if (runPromise !== undefined) {
|
|
134
|
-
return
|
|
117
|
+
return send({
|
|
135
118
|
type: "testfileFinished",
|
|
119
|
+
__vitest_worker_response__: true,
|
|
136
120
|
error: serializeError("Worker is already running tests")
|
|
137
121
|
});
|
|
138
122
|
}
|
|
@@ -165,50 +149,9 @@ rpc.exports["onMessage"] = async message => {
|
|
|
165
149
|
const entrypoint = message.type === "run" ? startTests : collectTests;
|
|
166
150
|
const testRunner = {
|
|
167
151
|
config: setupContext.config,
|
|
168
|
-
importFile: async
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
const nodeCrypto = await import("node:crypto");
|
|
172
|
-
const diagnosticsChannel = await import("node:diagnostics_channel");
|
|
173
|
-
const nodeEvents = await import("node:events");
|
|
174
|
-
const nodeFs = await import("node:fs");
|
|
175
|
-
const nodeNet = await import("node:net");
|
|
176
|
-
const nodeOs = await import("node:os");
|
|
177
|
-
const nodePath = await import("node:path");
|
|
178
|
-
const nodeProcess = await import("node:process");
|
|
179
|
-
const nodeStream = await import("node:stream");
|
|
180
|
-
const nodeTimers = await import("node:timers");
|
|
181
|
-
const nodeTty = await import("node:tty");
|
|
182
|
-
const nodeUrl = await import("node:url");
|
|
183
|
-
const nodeUtil = await import("node:util");
|
|
184
|
-
const nodeVm = await import("node:vm");
|
|
185
|
-
const vitestModule = await import("vitest");
|
|
186
|
-
const vitestRunnerModule = await import("@vitest/runner");
|
|
187
|
-
globalThis.__node_assert = nodeAssert;
|
|
188
|
-
globalThis.__node_buffer = nodeBuffer;
|
|
189
|
-
globalThis.__node_crypto = nodeCrypto;
|
|
190
|
-
globalThis.__node_diagnosticsChannel = diagnosticsChannel;
|
|
191
|
-
globalThis.__node_events = nodeEvents;
|
|
192
|
-
globalThis.__node_fs = nodeFs;
|
|
193
|
-
globalThis.__node_net = nodeNet;
|
|
194
|
-
globalThis.__node_os = nodeOs;
|
|
195
|
-
globalThis.__node_path = nodePath;
|
|
196
|
-
globalThis.__node_process = nodeProcess;
|
|
197
|
-
globalThis.__node_stream = nodeStream;
|
|
198
|
-
globalThis.__node_timers = nodeTimers;
|
|
199
|
-
globalThis.__node_tty = nodeTty;
|
|
200
|
-
globalThis.__node_url = nodeUrl;
|
|
201
|
-
globalThis.__node_util = nodeUtil;
|
|
202
|
-
globalThis.__node_vm = nodeVm;
|
|
203
|
-
globalThis.__vitest = vitestModule;
|
|
204
|
-
globalThis.__vitest_runner = vitestRunnerModule;
|
|
205
|
-
// TODO: warning if file not found
|
|
206
|
-
const source64 = testFiles[file];
|
|
207
|
-
if (source64 === undefined) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
const source = Buffer.from(source64, "base64").toString("utf-8");
|
|
211
|
-
await Script.load(file, source);
|
|
152
|
+
importFile: async _file => {
|
|
153
|
+
// @efffrida/vitest-pool/agent/file-map
|
|
154
|
+
return Promise.reject("importFile is not supported in the frida pool agent");
|
|
212
155
|
}
|
|
213
156
|
};
|
|
214
157
|
try {
|
|
@@ -216,12 +159,14 @@ rpc.exports["onMessage"] = async message => {
|
|
|
216
159
|
runPromise = entrypoint([file], patchTestRunner(testRunner));
|
|
217
160
|
await runPromise;
|
|
218
161
|
}
|
|
219
|
-
|
|
220
|
-
type: "testfileFinished"
|
|
162
|
+
return send({
|
|
163
|
+
type: "testfileFinished",
|
|
164
|
+
__vitest_worker_response__: true
|
|
221
165
|
});
|
|
222
166
|
} catch (error) {
|
|
223
|
-
|
|
167
|
+
return send({
|
|
224
168
|
type: "testfileFinished",
|
|
169
|
+
__vitest_worker_response__: true,
|
|
225
170
|
error: serializeError(error)
|
|
226
171
|
});
|
|
227
172
|
} finally {
|
package/dist/frida/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.js","names":["collectTests","startTests","serializeError","createStackString","parseStacktrace","createBirpc","stringify","flattedStringify","EvaluatedModules","
|
|
1
|
+
{"version":3,"file":"agent.js","names":["collectTests","startTests","serializeError","createStackString","parseStacktrace","createBirpc","stringify","flattedStringify","EvaluatedModules","runPromise","setupContext","cleanupListeners","Set","cancelListeners","messageListeners","birpc","onCancel","reason","Promise","allSettled","values","map","listener","off","rpcListener","delete","on","add","post","message","send","eventNames","timeout","provideWorkerState","context","state","NAME_WORKER_STATE","Object","defineProperty","value","configurable","writable","enumerable","patchTestRunner","testRunner","originalOnTaskUpdate","onTaskUpdate","task","events","call","originalOnCollectStart","onCollectStart","file","onQueued","originalOnCollected","onCollected","files","rpc","exports","isWorkerRequest","u","__vitest_worker_request__","forEach","type","process","env","VITEST_POOL_ID","String","poolId","VITEST_WORKER_ID","workerId","config","environment","pool","projectName","name","__vitest_worker_response__","undefined","$rejectPendingCalls","method","reject","clear","error","globalThis","durations","prepare","ctx","providedContext","metaEnv","resolvingModules","moduleExecutionInfo","Map","evaluatedModules","onCleanup","onFilterStackTrace","stack","entrypoint","importFile","_file"],"sources":["../../frida/agent.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,qBAAqB;AAM5B,SAASA,YAAY,EAAEC,UAAU,QAAQ,gBAAgB;AACzD,SAASC,cAAc,QAAQ,qBAAqB;AACpD,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,0BAA0B;AAC7E,SAASC,WAAW,QAAQ,OAAO;AACnC,SAASC,SAAS,IAAIC,gBAAgB,QAAQ,SAAS;AACvD,SAASC,gBAAgB,QAAQ,QAAQ;AAEzC;AACA;AACA;AACA,IAAIC,UAAwC;AAC5C,IAAIC,YAAyF;AAE7F;AACA,MAAMC,gBAAgB,gBAAG,IAAIC,GAAG,EAAiB;AACjD,MAAMC,eAAe,gBAAG,IAAID,GAAG,EAAqC;AACpE,MAAME,gBAAgB,gBAAG,IAAIF,GAAG,EAA8C;AAE9E;AACA,MAAMG,KAAK,gBAAGV,WAAW,CACrB;EACI,MAAMW,QAAQA,CAACC,MAAoB;IAC/B,MAAMC,OAAO,CAACC,UAAU,CAAC,CAAC,GAAGN,eAAe,CAACO,MAAM,EAAE,CAAC,C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;AACJ,CAAC","ignoreList":[]}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,81 +1,49 @@
|
|
|
1
|
-
import type * as VitestNode from "vitest/node";
|
|
2
1
|
import * as Schema from "effect/Schema";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}>, Schema.Struct<{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}>;
|
|
37
|
-
}>]>;
|
|
38
|
-
declare class DeviceSchema extends DeviceSchema_base {
|
|
39
|
-
}
|
|
40
|
-
declare const AttachSchema_base: Schema.Union<[Schema.Struct<{
|
|
41
|
-
attach: Schema.brand<typeof Schema.Number, "pid">;
|
|
42
|
-
}>, Schema.Struct<{
|
|
43
|
-
spawn: Schema.NonEmptyArrayEnsure<typeof Schema.String>;
|
|
44
|
-
preSpawn: Schema.optionalWith<typeof Schema.Boolean, {
|
|
45
|
-
nullable: true;
|
|
46
|
-
}>;
|
|
47
|
-
}>, Schema.Struct<{
|
|
48
|
-
attachFrontmost: Schema.Literal<[true]>;
|
|
49
|
-
frontmostScope: Schema.optionalWith<Schema.Literal<["minimal", "metadata", "full"]>, {
|
|
50
|
-
nullable: true;
|
|
51
|
-
}>;
|
|
52
|
-
}>]>;
|
|
53
|
-
declare class AttachSchema extends AttachSchema_base {
|
|
54
|
-
}
|
|
55
|
-
declare const ConfigSchema_base: Schema.extend<Schema.extend<Schema.Struct<{
|
|
56
|
-
runtime: Schema.optionalWith<Schema.Literal<["default", "qjs", "v8"]>, {
|
|
57
|
-
nullable: true;
|
|
58
|
-
}>;
|
|
59
|
-
platform: Schema.optionalWith<Schema.Literal<["gum", "browser", "neutral"]>, {
|
|
60
|
-
nullable: true;
|
|
61
|
-
}>;
|
|
62
|
-
}>, typeof DeviceSchema>, typeof AttachSchema>;
|
|
63
|
-
declare class ConfigSchema extends ConfigSchema_base {
|
|
64
|
-
}
|
|
2
|
+
import type * as VitestNode from "vitest/node";
|
|
3
|
+
declare const ConfigSchema: Schema.Struct<{
|
|
4
|
+
readonly device: Schema.Union<readonly [Schema.Struct<{
|
|
5
|
+
readonly connection: Schema.Literal<"local">;
|
|
6
|
+
}>, Schema.Struct<{
|
|
7
|
+
readonly connection: Schema.Literal<"usb">;
|
|
8
|
+
readonly timeout: Schema.optional<Schema.DurationFromMillis>;
|
|
9
|
+
}>, Schema.Struct<{
|
|
10
|
+
readonly address: Schema.String;
|
|
11
|
+
readonly connection: Schema.Literal<"remote">;
|
|
12
|
+
readonly token: Schema.optional<Schema.String>;
|
|
13
|
+
readonly origin: Schema.optional<Schema.String>;
|
|
14
|
+
readonly keepaliveInterval: Schema.optional<Schema.DurationFromMillis>;
|
|
15
|
+
}>, Schema.Struct<{
|
|
16
|
+
readonly emulatorName: Schema.String;
|
|
17
|
+
readonly hidden: Schema.optional<Schema.Boolean>;
|
|
18
|
+
readonly adbExecutable: Schema.optional<Schema.String>;
|
|
19
|
+
readonly connection: Schema.Literal<"android-emulator">;
|
|
20
|
+
readonly fridaExecutable: Schema.optional<Schema.String>;
|
|
21
|
+
readonly emulatorExecutable: Schema.optional<Schema.String>;
|
|
22
|
+
}>]>;
|
|
23
|
+
readonly attach: Schema.Union<readonly [Schema.Struct<{
|
|
24
|
+
readonly pid: Schema.Number;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
readonly spawn: Schema.NonEmptyArray<Schema.String>;
|
|
27
|
+
readonly preSpawn: Schema.optional<Schema.Boolean>;
|
|
28
|
+
}>, Schema.Struct<{
|
|
29
|
+
readonly attachFrontmost: Schema.Literal<true>;
|
|
30
|
+
readonly frontmostScope: Schema.optional<Schema.Literals<readonly ["minimal", "metadata", "full"]>>;
|
|
31
|
+
}>]>;
|
|
32
|
+
readonly runtime: Schema.optional<Schema.Literals<readonly ["default", "qjs", "v8"]>>;
|
|
33
|
+
readonly platform: Schema.optional<Schema.Literals<readonly ["gum", "browser", "neutral"]>>;
|
|
34
|
+
}>;
|
|
65
35
|
/**
|
|
66
36
|
* @since 1.0.0
|
|
67
37
|
* @category Tests
|
|
68
38
|
*/
|
|
69
39
|
export declare class FridaPoolWorker implements VitestNode.PoolWorker {
|
|
70
40
|
readonly name = "frida-pool";
|
|
71
|
-
|
|
72
|
-
private readonly
|
|
73
|
-
private readonly
|
|
41
|
+
private static initQueue;
|
|
42
|
+
private readonly scope;
|
|
43
|
+
private readonly scriptContext;
|
|
74
44
|
private readonly cancelables;
|
|
75
|
-
private modifiedAgentScope;
|
|
76
|
-
private managedRuntime;
|
|
77
45
|
private sends;
|
|
78
|
-
constructor(poolOptions: VitestNode.PoolOptions, customOptions: Schema.Schema.Type<ConfigSchema>);
|
|
46
|
+
constructor(poolOptions: VitestNode.PoolOptions, customOptions: Schema.Schema.Type<typeof ConfigSchema>);
|
|
79
47
|
start(): Promise<void>;
|
|
80
48
|
stop(): Promise<void>;
|
|
81
49
|
send(message: VitestNode.WorkerRequest): Promise<void>;
|
|
@@ -88,6 +56,6 @@ export declare class FridaPoolWorker implements VitestNode.PoolWorker {
|
|
|
88
56
|
* @since 1.0.0
|
|
89
57
|
* @category Tests
|
|
90
58
|
*/
|
|
91
|
-
export declare const createFridaPool: (customOptions: Schema.
|
|
59
|
+
export declare const createFridaPool: (customOptions: Schema.Codec.Encoded<typeof ConfigSchema>) => VitestNode.PoolRunnerInitializer;
|
|
92
60
|
export {};
|
|
93
61
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAKxC,OAAO,KAAK,KAAK,UAAU,MAAM,aAAa,CAAC;AAmD/C,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKhB,CAAC;AAEH;;;GAGG;AACH,qBAAa,eAAgB,YAAW,UAAU,CAAC,UAAU;IACzD,SAAgB,IAAI,gBAAgB;IACpC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAoC;IAE5D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkB;IACxC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoD;IAClF,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsE;IAElG,OAAO,CAAC,KAAK,CAA+B;gBAEhC,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,aAAa,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC;IAwIjG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAOrB,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5D,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IA8DrD,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAQvD,WAAW,CAAC,IAAI,EAAE,OAAO;IAKzB,SAAS,CAAC,IAAI,EAAE,OAAO;CAG1B;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,GACxB,eAAe,MAAM,CAA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