@wdio/local-runner 8.6.0 → 8.6.2
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/build/worker.d.ts +4 -1
- package/build/worker.d.ts.map +1 -1
- package/build/worker.js +15 -5
- package/package.json +3 -3
package/build/worker.d.ts
CHANGED
|
@@ -29,8 +29,11 @@ export default class WorkerInstance extends EventEmitter implements Workers.Work
|
|
|
29
29
|
}>;
|
|
30
30
|
isMultiremote?: boolean;
|
|
31
31
|
isBusy: boolean;
|
|
32
|
+
isKilled: boolean;
|
|
32
33
|
isReady: Promise<boolean>;
|
|
34
|
+
isSetup: Promise<boolean>;
|
|
33
35
|
isReadyResolver: (value: boolean | PromiseLike<boolean>) => void;
|
|
36
|
+
isSetupResolver: (value: boolean | PromiseLike<boolean>) => void;
|
|
34
37
|
/**
|
|
35
38
|
* assigns paramters to scope of instance
|
|
36
39
|
* @param {object} config parsed configuration object
|
|
@@ -54,6 +57,6 @@ export default class WorkerInstance extends EventEmitter implements Workers.Work
|
|
|
54
57
|
* @param command method to run in wdio-runner
|
|
55
58
|
* @param args arguments for functions to call
|
|
56
59
|
*/
|
|
57
|
-
postMessage(command: string, args: Workers.WorkerMessageArgs): void;
|
|
60
|
+
postMessage(command: string, args: Workers.WorkerMessageArgs, requiresSetup?: boolean): void;
|
|
58
61
|
}
|
|
59
62
|
//# sourceMappingURL=worker.d.ts.map
|
package/build/worker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":";;AAEA,OAAO,KAAK,MAAM,oBAAoB,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EA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KAAK,IAAI,CAAW;IAC3E,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI,CAAW;IAE3E;;;;;;;;;OASG;gBAEC,MAAM,EAAE,OAAO,CAAC,UAAU,EAC1B,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,gBAAgB,EAC7E,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,oBAAoB;IAkBhC;;OAEG;IACH,YAAY;IAuDZ,OAAO,CAAC,cAAc;IAsDtB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,WAAW;IAkBnB;;;;OAIG;IACH,WAAW,CAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,iBAAiB,EAAE,aAAa,UAAQ,GAAG,IAAI;CA0B9F"}
|
package/build/worker.js
CHANGED
|
@@ -38,8 +38,11 @@ export default class WorkerInstance extends EventEmitter {
|
|
|
38
38
|
instances;
|
|
39
39
|
isMultiremote;
|
|
40
40
|
isBusy = false;
|
|
41
|
+
isKilled = false;
|
|
41
42
|
isReady;
|
|
43
|
+
isSetup;
|
|
42
44
|
isReadyResolver = () => { };
|
|
45
|
+
isSetupResolver = () => { };
|
|
43
46
|
/**
|
|
44
47
|
* assigns paramters to scope of instance
|
|
45
48
|
* @param {object} config parsed configuration object
|
|
@@ -62,9 +65,8 @@ export default class WorkerInstance extends EventEmitter {
|
|
|
62
65
|
this.retries = retries;
|
|
63
66
|
this.stdout = stdout;
|
|
64
67
|
this.stderr = stderr;
|
|
65
|
-
this.isReady = new Promise((resolve) => {
|
|
66
|
-
|
|
67
|
-
});
|
|
68
|
+
this.isReady = new Promise((resolve) => { this.isReadyResolver = resolve; });
|
|
69
|
+
this.isSetup = new Promise((resolve) => { this.isSetupResolver = resolve; });
|
|
68
70
|
}
|
|
69
71
|
/**
|
|
70
72
|
* spawns process to kick of wdio-runner
|
|
@@ -132,12 +134,14 @@ export default class WorkerInstance extends EventEmitter {
|
|
|
132
134
|
* store sessionId and connection data to worker instance
|
|
133
135
|
*/
|
|
134
136
|
if (payload.name === 'sessionStarted') {
|
|
137
|
+
this.isSetupResolver(true);
|
|
135
138
|
if (payload.content.isMultiremote) {
|
|
136
139
|
Object.assign(this, payload.content);
|
|
137
140
|
}
|
|
138
141
|
else {
|
|
139
142
|
this.sessionId = payload.content.sessionId;
|
|
140
143
|
this.capabilities = payload.content.capabilities;
|
|
144
|
+
Object.assign(this.config, payload.content);
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
147
|
/**
|
|
@@ -166,6 +170,7 @@ export default class WorkerInstance extends EventEmitter {
|
|
|
166
170
|
*/
|
|
167
171
|
delete this.childProcess;
|
|
168
172
|
this.isBusy = false;
|
|
173
|
+
this.isKilled = true;
|
|
169
174
|
log.debug(`Runner ${cid} finished with exit code ${exitCode}`);
|
|
170
175
|
this.emit('exit', { cid, exitCode, specs, retries });
|
|
171
176
|
if (childProcess) {
|
|
@@ -177,7 +182,7 @@ export default class WorkerInstance extends EventEmitter {
|
|
|
177
182
|
* @param command method to run in wdio-runner
|
|
178
183
|
* @param args arguments for functions to call
|
|
179
184
|
*/
|
|
180
|
-
postMessage(command, args) {
|
|
185
|
+
postMessage(command, args, requiresSetup = false) {
|
|
181
186
|
const { cid, configFile, capabilities, specs, retries, isBusy } = this;
|
|
182
187
|
if (isBusy && !ACCEPTABLE_BUSY_COMMANDS.includes(command)) {
|
|
183
188
|
return log.info(`worker with cid ${cid} already busy and can't take new commands`);
|
|
@@ -191,7 +196,12 @@ export default class WorkerInstance extends EventEmitter {
|
|
|
191
196
|
}
|
|
192
197
|
const cmd = { cid, command, configFile, args, caps: capabilities, specs, retries };
|
|
193
198
|
log.debug(`Send command ${command} to worker with cid "${cid}"`);
|
|
194
|
-
this.isReady.then(() =>
|
|
199
|
+
this.isReady.then(async () => {
|
|
200
|
+
if (requiresSetup) {
|
|
201
|
+
await this.isSetup;
|
|
202
|
+
}
|
|
203
|
+
this.childProcess.send(cmd);
|
|
204
|
+
});
|
|
195
205
|
this.isBusy = true;
|
|
196
206
|
}
|
|
197
207
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/local-runner",
|
|
3
|
-
"version": "8.6.
|
|
3
|
+
"version": "8.6.2",
|
|
4
4
|
"description": "A WebdriverIO runner to run tests locally",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-local-runner",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/node": "^18.0.0",
|
|
31
31
|
"@wdio/logger": "8.1.0",
|
|
32
32
|
"@wdio/repl": "8.1.0",
|
|
33
|
-
"@wdio/runner": "8.6.
|
|
33
|
+
"@wdio/runner": "8.6.2",
|
|
34
34
|
"@wdio/types": "8.4.0",
|
|
35
35
|
"async-exit-hook": "^2.0.1",
|
|
36
36
|
"split2": "^4.1.0",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "7d322b1b72a8af07e78b147a21ada220c4283eea"
|
|
47
47
|
}
|