@flemist/test-variants 5.0.11 → 5.0.12
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/README.md +16 -0
- package/build/browser/index.cjs +1 -1
- package/build/browser/index.mjs +1 -1
- package/build/common/index.cjs +1 -1
- package/build/common/index.mjs +1 -1
- package/build/common/test-variants/run/types.d.ts +5 -3
- package/build/common/test-variants/types.d.ts +23 -0
- package/build/createTestVariants-DlP_jc3m.js +4 -0
- package/build/{createTestVariants-DHWt92RI.mjs → createTestVariants-DxolnPmm.mjs} +317 -308
- package/build/node/index.cjs +1 -1
- package/build/node/index.mjs +1 -1
- package/package.json +1 -1
- package/build/createTestVariants-6NbYYHA7.js +0 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { timeControllerDefault as K } from "@flemist/time-controller";
|
|
2
2
|
import { formatAny as de, deepCloneJsonLike as Je } from "@flemist/simple-utils";
|
|
3
|
-
import { isPromiseLike as
|
|
3
|
+
import { isPromiseLike as T, waitMicrotasks as Xe, combineAbortSignals as oe } from "@flemist/async-utils";
|
|
4
4
|
import { AbortError as Ze, AbortControllerFast as ie } from "@flemist/abort-controller-fast";
|
|
5
5
|
import { poolWait as se, Pool as Ke } from "@flemist/time-limits";
|
|
6
6
|
function Q() {
|
|
@@ -41,7 +41,7 @@ const me = (e, n) => {
|
|
|
41
41
|
maxStringLength: 5e3,
|
|
42
42
|
dontExpandClassInstances: !0,
|
|
43
43
|
dontExpandFunctions: !0
|
|
44
|
-
}),
|
|
44
|
+
}), S = {
|
|
45
45
|
start: !0,
|
|
46
46
|
progress: 5e3,
|
|
47
47
|
completed: !0,
|
|
@@ -61,15 +61,15 @@ const me = (e, n) => {
|
|
|
61
61
|
format: ge
|
|
62
62
|
};
|
|
63
63
|
function pe(e) {
|
|
64
|
-
return e === !1 ? rt : e === !0 || !e ?
|
|
65
|
-
start: e.start ??
|
|
66
|
-
progress: e.progress ??
|
|
67
|
-
completed: e.completed ??
|
|
68
|
-
error: e.error ??
|
|
69
|
-
modeChange: e.modeChange ??
|
|
70
|
-
debug: e.debug ??
|
|
71
|
-
func: e.func ??
|
|
72
|
-
format: e.format ??
|
|
64
|
+
return e === !1 ? rt : e === !0 || !e ? S : {
|
|
65
|
+
start: e.start ?? S.start,
|
|
66
|
+
progress: e.progress ?? S.progress,
|
|
67
|
+
completed: e.completed ?? S.completed,
|
|
68
|
+
error: e.error ?? S.error,
|
|
69
|
+
modeChange: e.modeChange ?? S.modeChange,
|
|
70
|
+
debug: e.debug ?? S.debug,
|
|
71
|
+
func: e.func ?? S.func,
|
|
72
|
+
format: e.format ?? S.format
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
function nt(e, n) {
|
|
@@ -96,37 +96,44 @@ function ae(e, n) {
|
|
|
96
96
|
return typeof e == "number" ? { iterationsAsync: 0, iterationsSync: e } : e != null && typeof e == "object" ? e : n ? { iterationsAsync: 1, iterationsSync: 0 } : { iterationsAsync: 0, iterationsSync: 1 };
|
|
97
97
|
}
|
|
98
98
|
function st(e, n) {
|
|
99
|
-
const t = n.log, i = n.pauseDebuggerOnError ?? !0;
|
|
100
|
-
let
|
|
101
|
-
function
|
|
102
|
-
|
|
99
|
+
const t = n.log, i = n.pauseDebuggerOnError ?? !0, o = n.onStart, s = n.onEnd;
|
|
100
|
+
let r = null, l = 0;
|
|
101
|
+
function f(m, c, b) {
|
|
102
|
+
r == null && (r = { error: m, args: c, tests: b }, t.error && t.func(
|
|
103
103
|
"error",
|
|
104
|
-
`[test-variants] error variant: ${t.format(
|
|
105
|
-
tests: ${
|
|
106
|
-
${t.format(
|
|
104
|
+
`[test-variants] error variant: ${t.format(c)}
|
|
105
|
+
tests: ${b}
|
|
106
|
+
${t.format(m)}`
|
|
107
107
|
));
|
|
108
|
-
const
|
|
108
|
+
const y = Date.now();
|
|
109
109
|
if (i)
|
|
110
110
|
debugger;
|
|
111
|
-
if (Date.now() -
|
|
111
|
+
if (Date.now() - y > ot && l < it) {
|
|
112
112
|
t.func(
|
|
113
113
|
"debug",
|
|
114
|
-
`[test-variants] debug iteration: ${
|
|
115
|
-
),
|
|
114
|
+
`[test-variants] debug iteration: ${l}`
|
|
115
|
+
), l++;
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
const
|
|
119
|
-
throw
|
|
118
|
+
const h = r;
|
|
119
|
+
throw r = null, n.onError && n.onError(h), h.error;
|
|
120
120
|
}
|
|
121
|
-
return function(
|
|
121
|
+
return function(c, b, y) {
|
|
122
|
+
o && o({ args: c, tests: b });
|
|
122
123
|
try {
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
const d = e(c, y);
|
|
125
|
+
if (T(d))
|
|
126
|
+
return d.then(
|
|
127
|
+
(v) => {
|
|
128
|
+
const x = ae(v, !0);
|
|
129
|
+
return s && s({ args: c, tests: b, result: x }), x;
|
|
130
|
+
},
|
|
131
|
+
(v) => (s && !(v instanceof I) && s({ args: c, tests: b, error: v }), f(v, c, b))
|
|
132
|
+
);
|
|
133
|
+
const h = ae(d, !1);
|
|
134
|
+
return s && s({ args: c, tests: b, result: h }), h;
|
|
135
|
+
} catch (d) {
|
|
136
|
+
return d instanceof I ? void 0 : (s && s({ args: c, tests: b, error: d }), f(d, c, b));
|
|
130
137
|
}
|
|
131
138
|
};
|
|
132
139
|
}
|
|
@@ -137,17 +144,17 @@ function U(e, n, t) {
|
|
|
137
144
|
return -1;
|
|
138
145
|
}
|
|
139
146
|
function le(e, n, t, i) {
|
|
140
|
-
const o = Object.keys(e.templates),
|
|
141
|
-
for (let
|
|
142
|
-
const
|
|
143
|
-
|
|
147
|
+
const o = Object.keys(e.templates), s = {}, r = [], l = [], f = [], m = o.length;
|
|
148
|
+
for (let c = 0; c < m; c++) {
|
|
149
|
+
const b = o[c];
|
|
150
|
+
s[b] = void 0, r.push(-1), l.push(void 0), f.push(null);
|
|
144
151
|
}
|
|
145
152
|
return {
|
|
146
|
-
args:
|
|
153
|
+
args: s,
|
|
147
154
|
argsNames: o,
|
|
148
155
|
indexes: r,
|
|
149
156
|
argValues: l,
|
|
150
|
-
argLimits:
|
|
157
|
+
argLimits: f,
|
|
151
158
|
attempts: 0,
|
|
152
159
|
templates: e,
|
|
153
160
|
limitArgOnError: t,
|
|
@@ -155,38 +162,38 @@ function le(e, n, t, i) {
|
|
|
155
162
|
includeErrorVariant: i ?? !1
|
|
156
163
|
};
|
|
157
164
|
}
|
|
158
|
-
function
|
|
165
|
+
function L(e, n) {
|
|
159
166
|
const t = e.templates.templates[n], i = e.templates.extra[n];
|
|
160
167
|
let o;
|
|
161
168
|
if (typeof t == "function" ? o = t(e.args) : o = t, i == null)
|
|
162
169
|
return o;
|
|
163
|
-
let
|
|
170
|
+
let s = null;
|
|
164
171
|
const r = i.length;
|
|
165
172
|
for (let l = 0; l < r; l++) {
|
|
166
|
-
const
|
|
167
|
-
U(o,
|
|
173
|
+
const f = i[l];
|
|
174
|
+
U(o, f, e.equals) < 0 && (s == null ? s = [...o, f] : s.push(f));
|
|
168
175
|
}
|
|
169
|
-
return
|
|
176
|
+
return s ?? o;
|
|
170
177
|
}
|
|
171
|
-
function
|
|
178
|
+
function M(e, n, t) {
|
|
172
179
|
const i = e.argValues[n].length;
|
|
173
180
|
if (i === 0)
|
|
174
181
|
return -1;
|
|
175
182
|
const o = e.argLimits[n];
|
|
176
183
|
if (o == null)
|
|
177
184
|
return i - 1;
|
|
178
|
-
let
|
|
179
|
-
if (typeof
|
|
185
|
+
let s = e.limitArgOnError;
|
|
186
|
+
if (typeof s == "function") {
|
|
180
187
|
const r = e.argsNames[n];
|
|
181
|
-
|
|
188
|
+
s = s({
|
|
182
189
|
name: r,
|
|
183
190
|
values: e.argValues[n],
|
|
184
191
|
maxValueIndex: o
|
|
185
192
|
});
|
|
186
193
|
}
|
|
187
|
-
return !t ||
|
|
194
|
+
return !t || s ? Math.min(o, i - 1) : i - 1;
|
|
188
195
|
}
|
|
189
|
-
function
|
|
196
|
+
function V(e) {
|
|
190
197
|
const n = e.indexes.length;
|
|
191
198
|
for (let t = 0; t < n; t++) {
|
|
192
199
|
const i = e.argLimits[t];
|
|
@@ -200,7 +207,7 @@ function T(e) {
|
|
|
200
207
|
}
|
|
201
208
|
return !e.includeErrorVariant;
|
|
202
209
|
}
|
|
203
|
-
function
|
|
210
|
+
function O(e) {
|
|
204
211
|
const n = e.indexes.length;
|
|
205
212
|
for (let t = 0; t < n; t++)
|
|
206
213
|
e.indexes[t] = -1, e.argValues[t] = void 0, e.args[e.argsNames[t]] = void 0;
|
|
@@ -208,125 +215,125 @@ function C(e) {
|
|
|
208
215
|
function he(e) {
|
|
209
216
|
let n = !1, t = !0;
|
|
210
217
|
const i = e.indexes.length;
|
|
211
|
-
let o = i,
|
|
218
|
+
let o = i, s = !1, r = 0;
|
|
212
219
|
for (; r < i; r++) {
|
|
213
220
|
const l = e.argValues[r] == null;
|
|
214
|
-
(l ||
|
|
221
|
+
(l || s) && (l && (n = !0), e.argValues[r] = L(
|
|
215
222
|
e,
|
|
216
223
|
e.argsNames[r]
|
|
217
224
|
));
|
|
218
|
-
const
|
|
225
|
+
const f = M(
|
|
219
226
|
e,
|
|
220
227
|
r,
|
|
221
228
|
r > o
|
|
222
229
|
);
|
|
223
|
-
if (
|
|
230
|
+
if (f < 0) {
|
|
224
231
|
t = !1, e.indexes[r] = -1;
|
|
225
232
|
break;
|
|
226
233
|
}
|
|
227
|
-
l && (e.indexes[r] = 0, e.args[e.argsNames[r]] = e.argValues[r][0]), (
|
|
234
|
+
l && (e.indexes[r] = 0, e.args[e.argsNames[r]] = e.argValues[r][0]), (s || e.indexes[r] > f) && (e.indexes[r] = f, e.args[e.argsNames[r]] = e.argValues[r][f], s = !0), o === i && e.indexes[r] < f && (o = r);
|
|
228
235
|
}
|
|
229
|
-
if (
|
|
230
|
-
return
|
|
236
|
+
if (V(e))
|
|
237
|
+
return O(e), !1;
|
|
231
238
|
if (n && t)
|
|
232
239
|
return !0;
|
|
233
240
|
for (r--; r >= 0; r--) {
|
|
234
241
|
if (e.argValues[r] == null)
|
|
235
242
|
continue;
|
|
236
243
|
let l = r > o;
|
|
237
|
-
const
|
|
238
|
-
if (
|
|
239
|
-
e.indexes[r] =
|
|
240
|
-
for (let
|
|
241
|
-
e.args[e.argsNames[
|
|
244
|
+
const f = M(e, r, l), m = e.indexes[r] + 1;
|
|
245
|
+
if (m <= f) {
|
|
246
|
+
e.indexes[r] = m, e.args[e.argsNames[r]] = e.argValues[r][m], m < f && (l = !0);
|
|
247
|
+
for (let c = r + 1; c < i; c++)
|
|
248
|
+
e.args[e.argsNames[c]] = void 0;
|
|
242
249
|
for (r++; r < i; r++) {
|
|
243
|
-
e.argValues[r] =
|
|
250
|
+
e.argValues[r] = L(
|
|
244
251
|
e,
|
|
245
252
|
e.argsNames[r]
|
|
246
253
|
);
|
|
247
|
-
const
|
|
248
|
-
if (
|
|
254
|
+
const c = M(e, r, l);
|
|
255
|
+
if (c < 0)
|
|
249
256
|
break;
|
|
250
|
-
e.indexes[r] = 0, e.args[e.argsNames[r]] = e.argValues[r][0],
|
|
257
|
+
e.indexes[r] = 0, e.args[e.argsNames[r]] = e.argValues[r][0], c > 0 && (l = !0);
|
|
251
258
|
}
|
|
252
259
|
if (r >= i)
|
|
253
|
-
return
|
|
260
|
+
return V(e) ? (O(e), !1) : !0;
|
|
254
261
|
}
|
|
255
262
|
}
|
|
256
|
-
return
|
|
263
|
+
return O(e), !1;
|
|
257
264
|
}
|
|
258
265
|
function z(e) {
|
|
259
|
-
|
|
266
|
+
V(e) && O(e);
|
|
260
267
|
let n = !1, t = !0;
|
|
261
268
|
const i = e.indexes.length;
|
|
262
|
-
let o = i,
|
|
269
|
+
let o = i, s = !1, r = 0;
|
|
263
270
|
for (; r < i; r++) {
|
|
264
271
|
const l = e.argValues[r] == null;
|
|
265
|
-
(l ||
|
|
272
|
+
(l || s) && (l && (n = !0), e.argValues[r] = L(
|
|
266
273
|
e,
|
|
267
274
|
e.argsNames[r]
|
|
268
275
|
));
|
|
269
|
-
const
|
|
276
|
+
const f = M(
|
|
270
277
|
e,
|
|
271
278
|
r,
|
|
272
279
|
r > o
|
|
273
280
|
);
|
|
274
|
-
if (
|
|
281
|
+
if (f < 0) {
|
|
275
282
|
t = !1, e.indexes[r] = -1;
|
|
276
283
|
break;
|
|
277
284
|
}
|
|
278
|
-
l && (e.indexes[r] =
|
|
285
|
+
l && (e.indexes[r] = f, e.args[e.argsNames[r]] = e.argValues[r][f]), (s || e.indexes[r] > f) && (e.indexes[r] = f, e.args[e.argsNames[r]] = e.argValues[r][f], s = !0), o === i && e.indexes[r] < f && (o = r);
|
|
279
286
|
}
|
|
280
|
-
if ((n ||
|
|
287
|
+
if ((n || s) && t && !V(e))
|
|
281
288
|
return !0;
|
|
282
289
|
for (r--; r >= 0; r--) {
|
|
283
290
|
if (e.argValues[r] == null)
|
|
284
291
|
continue;
|
|
285
292
|
let l = r > o;
|
|
286
|
-
const
|
|
287
|
-
let
|
|
288
|
-
if (
|
|
289
|
-
e.indexes[r] =
|
|
290
|
-
for (let
|
|
291
|
-
e.args[e.argsNames[
|
|
293
|
+
const f = M(e, r, l);
|
|
294
|
+
let m = e.indexes[r] - 1;
|
|
295
|
+
if (m > f && (m = f), m >= 0) {
|
|
296
|
+
e.indexes[r] = m, e.args[e.argsNames[r]] = e.argValues[r][m], m < f && (l = !0);
|
|
297
|
+
for (let c = r + 1; c < i; c++)
|
|
298
|
+
e.args[e.argsNames[c]] = void 0;
|
|
292
299
|
for (r++; r < i; r++) {
|
|
293
|
-
e.argValues[r] =
|
|
300
|
+
e.argValues[r] = L(
|
|
294
301
|
e,
|
|
295
302
|
e.argsNames[r]
|
|
296
303
|
);
|
|
297
|
-
const
|
|
298
|
-
if (
|
|
304
|
+
const c = M(e, r, l);
|
|
305
|
+
if (c < 0)
|
|
299
306
|
break;
|
|
300
|
-
e.indexes[r] =
|
|
307
|
+
e.indexes[r] = c, e.args[e.argsNames[r]] = e.argValues[r][c], c > 0 && (l = !0);
|
|
301
308
|
}
|
|
302
309
|
if (r >= i)
|
|
303
310
|
return !0;
|
|
304
311
|
}
|
|
305
312
|
}
|
|
306
|
-
return
|
|
313
|
+
return O(e), !1;
|
|
307
314
|
}
|
|
308
315
|
function at(e, n) {
|
|
309
|
-
|
|
316
|
+
O(e);
|
|
310
317
|
const t = e.argsNames, i = t.length;
|
|
311
318
|
let o = !1;
|
|
312
|
-
for (let
|
|
313
|
-
const r = t[
|
|
319
|
+
for (let s = 0; s < i; s++) {
|
|
320
|
+
const r = t[s], l = n[r];
|
|
314
321
|
if (l === void 0)
|
|
315
322
|
return null;
|
|
316
|
-
e.argValues[
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
323
|
+
e.argValues[s] = L(e, r);
|
|
324
|
+
const f = M(e, s, o);
|
|
325
|
+
if (f < 0)
|
|
319
326
|
return null;
|
|
320
|
-
const
|
|
321
|
-
e.argValues[
|
|
327
|
+
const m = U(
|
|
328
|
+
e.argValues[s],
|
|
322
329
|
l,
|
|
323
330
|
e.equals
|
|
324
331
|
);
|
|
325
|
-
if (
|
|
332
|
+
if (m < 0 || m > f)
|
|
326
333
|
return null;
|
|
327
|
-
e.indexes[
|
|
334
|
+
e.indexes[s] = m, e.args[e.argsNames[s]] = e.argValues[s][m], e.indexes[s] < f && (o = !0);
|
|
328
335
|
}
|
|
329
|
-
return
|
|
336
|
+
return V(e) ? null : e.indexes.slice();
|
|
330
337
|
}
|
|
331
338
|
function lt(e) {
|
|
332
339
|
const n = e.indexes.length;
|
|
@@ -334,23 +341,23 @@ function lt(e) {
|
|
|
334
341
|
return !1;
|
|
335
342
|
let t = !1;
|
|
336
343
|
for (let i = 0; i < n; i++) {
|
|
337
|
-
e.argValues[i] =
|
|
338
|
-
const o =
|
|
344
|
+
e.argValues[i] = L(e, e.argsNames[i]);
|
|
345
|
+
const o = M(e, i, t);
|
|
339
346
|
if (o < 0)
|
|
340
347
|
return Math.random() < 0.5 ? he(e) : z(e);
|
|
341
348
|
e.indexes[i] = Math.floor(Math.random() * (o + 1)), e.args[e.argsNames[i]] = e.argValues[i][e.indexes[i]], e.indexes[i] < o && (t = !0);
|
|
342
349
|
}
|
|
343
|
-
return
|
|
350
|
+
return V(e) ? z(e) : !0;
|
|
344
351
|
}
|
|
345
352
|
function _(e) {
|
|
346
353
|
return e.mode === "forward" || e.mode === "backward";
|
|
347
354
|
}
|
|
348
355
|
function ut(e, n, t, i) {
|
|
349
|
-
const o = n[t],
|
|
350
|
-
if (typeof
|
|
351
|
-
if (U(
|
|
356
|
+
const o = n[t], s = e.templates[t];
|
|
357
|
+
if (typeof s != "function") {
|
|
358
|
+
if (U(s, o, i) >= 0)
|
|
352
359
|
return;
|
|
353
|
-
|
|
360
|
+
s.push(o);
|
|
354
361
|
return;
|
|
355
362
|
}
|
|
356
363
|
const r = e.extra[t];
|
|
@@ -385,25 +392,25 @@ function dt(e) {
|
|
|
385
392
|
equals: t,
|
|
386
393
|
limitArgOnError: i,
|
|
387
394
|
includeErrorVariant: o,
|
|
388
|
-
getSeed:
|
|
395
|
+
getSeed: s,
|
|
389
396
|
iterationModes: r,
|
|
390
397
|
onModeChange: l,
|
|
391
|
-
limitCompletionCount:
|
|
392
|
-
limitTests:
|
|
393
|
-
limitTime:
|
|
394
|
-
} = e,
|
|
398
|
+
limitCompletionCount: f,
|
|
399
|
+
limitTests: m,
|
|
400
|
+
limitTime: c
|
|
401
|
+
} = e, b = e.timeController ?? K, y = {
|
|
395
402
|
templates: Je(n),
|
|
396
403
|
extra: {}
|
|
397
|
-
},
|
|
398
|
-
let
|
|
404
|
+
}, d = r == null || r.length === 0 ? ct : r, h = [];
|
|
405
|
+
let v = null, x = null, p = 0, w = 0, A = !1, P = 0;
|
|
399
406
|
function $() {
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
function xe() {
|
|
403
|
-
for (let s = 0, f = p.length; s < f; s++)
|
|
404
|
-
b.push(Se());
|
|
407
|
+
A || (A = !0, P = b.now(), Se(), p = 0, te(), we());
|
|
405
408
|
}
|
|
406
409
|
function Se() {
|
|
410
|
+
for (let a = 0, u = d.length; a < u; a++)
|
|
411
|
+
h.push(xe());
|
|
412
|
+
}
|
|
413
|
+
function xe() {
|
|
407
414
|
return {
|
|
408
415
|
navigationState: le(
|
|
409
416
|
y,
|
|
@@ -419,7 +426,7 @@ function dt(e) {
|
|
|
419
426
|
};
|
|
420
427
|
}
|
|
421
428
|
function we() {
|
|
422
|
-
|
|
429
|
+
v = le(
|
|
423
430
|
y,
|
|
424
431
|
t ?? null,
|
|
425
432
|
// Initial values; overwritten in calcIndexes before each use
|
|
@@ -429,32 +436,32 @@ function dt(e) {
|
|
|
429
436
|
}
|
|
430
437
|
function te() {
|
|
431
438
|
l?.({
|
|
432
|
-
mode: p
|
|
433
|
-
modeIndex:
|
|
434
|
-
tests:
|
|
439
|
+
mode: d[p],
|
|
440
|
+
modeIndex: p,
|
|
441
|
+
tests: w
|
|
435
442
|
});
|
|
436
443
|
}
|
|
437
|
-
function Me(
|
|
438
|
-
$(), ue(y.templates,
|
|
444
|
+
function Me(a) {
|
|
445
|
+
$(), ue(y.templates, a) && ft(y, a, t);
|
|
439
446
|
}
|
|
440
|
-
function re(
|
|
441
|
-
return $(), ue(y.templates,
|
|
447
|
+
function re(a, u) {
|
|
448
|
+
return $(), ue(y.templates, a) ? (v.limitArgOnError = u?.limitArg ?? i ?? null, v.includeErrorVariant = u?.includeLimit ?? o ?? !1, at(v, a)) : null;
|
|
442
449
|
}
|
|
443
|
-
function Ie(
|
|
444
|
-
const
|
|
445
|
-
if (
|
|
450
|
+
function Ie(a) {
|
|
451
|
+
const u = a?.args;
|
|
452
|
+
if (u == null)
|
|
446
453
|
return;
|
|
447
454
|
$();
|
|
448
|
-
const
|
|
449
|
-
if (
|
|
450
|
-
|
|
451
|
-
args:
|
|
452
|
-
error:
|
|
453
|
-
tests:
|
|
454
|
-
},
|
|
455
|
-
for (let
|
|
456
|
-
const j =
|
|
457
|
-
j.argLimits =
|
|
455
|
+
const g = re(u);
|
|
456
|
+
if (g != null) {
|
|
457
|
+
x = {
|
|
458
|
+
args: u,
|
|
459
|
+
error: a?.error,
|
|
460
|
+
tests: a?.tests ?? w
|
|
461
|
+
}, v.argLimits = g;
|
|
462
|
+
for (let E = 0, D = h.length; E < D; E++) {
|
|
463
|
+
const j = h[E].navigationState;
|
|
464
|
+
j.argLimits = g;
|
|
458
465
|
}
|
|
459
466
|
}
|
|
460
467
|
}
|
|
@@ -466,9 +473,9 @@ function dt(e) {
|
|
|
466
473
|
if (!Ae())
|
|
467
474
|
return null;
|
|
468
475
|
for (; ; ) {
|
|
469
|
-
const
|
|
470
|
-
if (
|
|
471
|
-
return
|
|
476
|
+
const a = qe();
|
|
477
|
+
if (a != null)
|
|
478
|
+
return h[p].testsInLastTurn++, w++, a;
|
|
472
479
|
if ($e()) {
|
|
473
480
|
if (!Ge())
|
|
474
481
|
return null;
|
|
@@ -482,180 +489,180 @@ function dt(e) {
|
|
|
482
489
|
return !(Ce() || Oe() || G() && (Le() || !Ne()) || !Pe());
|
|
483
490
|
}
|
|
484
491
|
function Ce() {
|
|
485
|
-
return
|
|
492
|
+
return m != null && w >= m;
|
|
486
493
|
}
|
|
487
494
|
function Oe() {
|
|
488
|
-
return
|
|
495
|
+
return c != null && b.now() - P >= c;
|
|
489
496
|
}
|
|
490
497
|
function Le() {
|
|
491
498
|
if (!G())
|
|
492
499
|
throw new Error("Unexpected behavior");
|
|
493
|
-
return
|
|
500
|
+
return f != null && f <= 0;
|
|
494
501
|
}
|
|
495
502
|
function Ne() {
|
|
496
503
|
if (!G())
|
|
497
504
|
throw new Error("Unexpected behavior");
|
|
498
|
-
for (let
|
|
499
|
-
if (
|
|
505
|
+
for (let a = 0, u = d.length; a < u; a++)
|
|
506
|
+
if (C(d[a]) && R(a))
|
|
500
507
|
return !0;
|
|
501
508
|
return !1;
|
|
502
509
|
}
|
|
503
510
|
function Pe() {
|
|
504
|
-
for (let
|
|
505
|
-
if (R(
|
|
511
|
+
for (let a = 0, u = d.length; a < u; a++)
|
|
512
|
+
if (R(a))
|
|
506
513
|
return !0;
|
|
507
514
|
return !1;
|
|
508
515
|
}
|
|
509
516
|
function $e() {
|
|
510
|
-
|
|
511
|
-
const
|
|
512
|
-
return
|
|
517
|
+
p++;
|
|
518
|
+
const a = p >= d.length;
|
|
519
|
+
return a && (p = 0), te(), a;
|
|
513
520
|
}
|
|
514
521
|
function Ge() {
|
|
515
522
|
if (G()) {
|
|
516
|
-
const
|
|
517
|
-
if (
|
|
523
|
+
const a = De();
|
|
524
|
+
if (f != null && a >= f)
|
|
518
525
|
return !1;
|
|
519
526
|
}
|
|
520
527
|
return !0;
|
|
521
528
|
}
|
|
522
529
|
function G() {
|
|
523
|
-
for (let
|
|
524
|
-
if (_(
|
|
530
|
+
for (let a = 0, u = d.length; a < u; a++)
|
|
531
|
+
if (_(d[a]))
|
|
525
532
|
return !0;
|
|
526
533
|
return !1;
|
|
527
534
|
}
|
|
528
535
|
function De() {
|
|
529
|
-
let
|
|
530
|
-
for (let
|
|
531
|
-
const D =
|
|
532
|
-
_(j) && (
|
|
536
|
+
let a = !1, u = 1 / 0;
|
|
537
|
+
for (let g = 0, E = h.length; g < E; g++) {
|
|
538
|
+
const D = h[g], j = d[g];
|
|
539
|
+
_(j) && (a = !0, R(g) && D.completedCount < u && (u = D.completedCount));
|
|
533
540
|
}
|
|
534
|
-
if (!
|
|
541
|
+
if (!a)
|
|
535
542
|
throw new Error("Unexpected behavior");
|
|
536
|
-
return
|
|
543
|
+
return u;
|
|
537
544
|
}
|
|
538
|
-
function R(
|
|
539
|
-
const
|
|
540
|
-
return
|
|
545
|
+
function R(a) {
|
|
546
|
+
const u = d[a], g = h[a];
|
|
547
|
+
return u.limitTests != null && u.limitTests <= 0 || C(u) && (u.cycles != null && u.cycles <= 0 || u.attemptsPerVariant != null && u.attemptsPerVariant <= 0) ? !1 : g.tryNextVariantAttempts < 2;
|
|
541
548
|
}
|
|
542
549
|
function _e() {
|
|
543
|
-
|
|
544
|
-
for (let
|
|
545
|
-
const
|
|
546
|
-
|
|
550
|
+
p = 0;
|
|
551
|
+
for (let a = 0, u = h.length; a < u; a++) {
|
|
552
|
+
const g = h[a];
|
|
553
|
+
g.testsInLastTurn = 0, g.startTime = null;
|
|
547
554
|
}
|
|
548
555
|
}
|
|
549
556
|
function qe() {
|
|
550
|
-
let
|
|
551
|
-
for (;
|
|
557
|
+
let a = 0;
|
|
558
|
+
for (; a < 2; ) {
|
|
552
559
|
if (!Ue())
|
|
553
560
|
return null;
|
|
554
|
-
const
|
|
555
|
-
if (
|
|
556
|
-
return
|
|
557
|
-
if (
|
|
561
|
+
const u = je();
|
|
562
|
+
if (u != null)
|
|
563
|
+
return u;
|
|
564
|
+
if (C(d[p]) && Fe())
|
|
558
565
|
return null;
|
|
559
|
-
|
|
566
|
+
a++;
|
|
560
567
|
}
|
|
561
568
|
return null;
|
|
562
569
|
}
|
|
563
570
|
function Ue() {
|
|
564
|
-
const
|
|
565
|
-
return !(Be() || ke() ||
|
|
571
|
+
const a = d[p];
|
|
572
|
+
return !(Be() || ke() || C(a) && !Re(p));
|
|
566
573
|
}
|
|
567
574
|
function Be() {
|
|
568
|
-
const
|
|
569
|
-
return
|
|
575
|
+
const a = d[p], u = h[p];
|
|
576
|
+
return a.limitTests != null && u.testsInLastTurn >= a.limitTests;
|
|
570
577
|
}
|
|
571
578
|
function ke() {
|
|
572
|
-
const
|
|
573
|
-
return
|
|
579
|
+
const a = d[p], u = h[p];
|
|
580
|
+
return a.limitTime != null && u.startTime != null && b.now() - u.startTime >= a.limitTime;
|
|
574
581
|
}
|
|
575
|
-
function
|
|
576
|
-
return _(
|
|
582
|
+
function C(a) {
|
|
583
|
+
return _(a);
|
|
577
584
|
}
|
|
578
|
-
function Re(
|
|
579
|
-
const
|
|
580
|
-
if (!
|
|
585
|
+
function Re(a) {
|
|
586
|
+
const u = d[a], g = h[a];
|
|
587
|
+
if (!C(u))
|
|
581
588
|
throw new Error("Unexpected behavior");
|
|
582
|
-
return
|
|
589
|
+
return g.cycleCount < (u.cycles ?? 1);
|
|
583
590
|
}
|
|
584
591
|
function Fe() {
|
|
585
|
-
const
|
|
586
|
-
if (!
|
|
592
|
+
const a = d[p], u = h[p];
|
|
593
|
+
if (!C(a))
|
|
587
594
|
throw new Error("Unexpected behavior");
|
|
588
|
-
return
|
|
595
|
+
return u.cycleCount++, u.cycleCount >= (a.cycles ?? 1) ? (u.cycleCount = 0, u.completedCount++, !0) : !1;
|
|
589
596
|
}
|
|
590
597
|
function je() {
|
|
591
|
-
const
|
|
592
|
-
if (N(
|
|
598
|
+
const a = d[p], u = h[p], g = u.navigationState;
|
|
599
|
+
if (N(a)) {
|
|
593
600
|
if (F())
|
|
594
601
|
return null;
|
|
595
|
-
const
|
|
596
|
-
if (
|
|
597
|
-
return
|
|
602
|
+
const E = We();
|
|
603
|
+
if (E != null)
|
|
604
|
+
return u.startTime == null && (u.startTime = b.now()), E;
|
|
598
605
|
}
|
|
599
|
-
return He() ? (
|
|
606
|
+
return He() ? (u.tryNextVariantAttempts = 0, N(a) && ze(), u.startTime == null && (u.startTime = b.now()), ne(g.args)) : (u.tryNextVariantAttempts++, null);
|
|
600
607
|
}
|
|
601
608
|
function We() {
|
|
602
|
-
const
|
|
603
|
-
if (!N(
|
|
609
|
+
const a = d[p], g = h[p].navigationState;
|
|
610
|
+
if (!N(a))
|
|
604
611
|
throw new Error("Unexpected behavior");
|
|
605
612
|
if (F())
|
|
606
613
|
throw new Error("Unexpected behavior");
|
|
607
|
-
const
|
|
608
|
-
return
|
|
614
|
+
const E = a.attemptsPerVariant ?? 1;
|
|
615
|
+
return g.attempts > 0 && g.attempts < E ? V(g) ? null : (g.attempts++, ne(g.args)) : null;
|
|
609
616
|
}
|
|
610
617
|
function ze() {
|
|
611
|
-
const
|
|
612
|
-
if (!N(
|
|
618
|
+
const a = d[p], g = h[p].navigationState;
|
|
619
|
+
if (!N(a))
|
|
613
620
|
throw new Error("Unexpected behavior");
|
|
614
621
|
if (F())
|
|
615
622
|
throw new Error("Unexpected behavior");
|
|
616
|
-
|
|
623
|
+
g.attempts = 1;
|
|
617
624
|
}
|
|
618
|
-
function N(
|
|
619
|
-
return _(
|
|
625
|
+
function N(a) {
|
|
626
|
+
return _(a);
|
|
620
627
|
}
|
|
621
628
|
function F() {
|
|
622
|
-
const
|
|
623
|
-
if (!N(
|
|
629
|
+
const a = d[p];
|
|
630
|
+
if (!N(a))
|
|
624
631
|
throw new Error("Unexpected behavior");
|
|
625
|
-
return (
|
|
632
|
+
return (a.attemptsPerVariant ?? 1) <= 0;
|
|
626
633
|
}
|
|
627
634
|
function He() {
|
|
628
|
-
const
|
|
629
|
-
switch (
|
|
635
|
+
const a = d[p], g = h[p].navigationState;
|
|
636
|
+
switch (a.mode) {
|
|
630
637
|
case "forward":
|
|
631
|
-
return he(
|
|
638
|
+
return he(g);
|
|
632
639
|
case "backward":
|
|
633
|
-
return z(
|
|
640
|
+
return z(g);
|
|
634
641
|
case "random":
|
|
635
|
-
return lt(
|
|
642
|
+
return lt(g);
|
|
636
643
|
default:
|
|
637
|
-
throw new Error(`Unknown mode: ${
|
|
644
|
+
throw new Error(`Unknown mode: ${a.mode}`);
|
|
638
645
|
}
|
|
639
646
|
}
|
|
640
|
-
function ne(
|
|
641
|
-
const
|
|
642
|
-
return
|
|
647
|
+
function ne(a) {
|
|
648
|
+
const u = { ...a };
|
|
649
|
+
return s != null && (u.seed = s({ tests: w })), u;
|
|
643
650
|
}
|
|
644
651
|
return {
|
|
645
652
|
get limit() {
|
|
646
|
-
return
|
|
653
|
+
return x;
|
|
647
654
|
},
|
|
648
655
|
get modeIndex() {
|
|
649
|
-
return
|
|
656
|
+
return p;
|
|
650
657
|
},
|
|
651
658
|
get modeConfigs() {
|
|
652
|
-
return
|
|
659
|
+
return d;
|
|
653
660
|
},
|
|
654
661
|
get modeStates() {
|
|
655
|
-
return
|
|
662
|
+
return h;
|
|
656
663
|
},
|
|
657
664
|
get tests() {
|
|
658
|
-
return
|
|
665
|
+
return w;
|
|
659
666
|
},
|
|
660
667
|
calcIndexes: re,
|
|
661
668
|
extendTemplates: Me,
|
|
@@ -702,7 +709,7 @@ function gt(e) {
|
|
|
702
709
|
};
|
|
703
710
|
}
|
|
704
711
|
function pt(e) {
|
|
705
|
-
const n = e?.saveErrorVariants, t = n && e.createSaveErrorVariantsStore ? e.createSaveErrorVariantsStore(n) : null, i = e?.findBestError, { parallel: o, sequentialOnError:
|
|
712
|
+
const n = e?.saveErrorVariants, t = n && e.createSaveErrorVariantsStore ? e.createSaveErrorVariantsStore(n) : null, i = e?.findBestError, { parallel: o, sequentialOnError: s } = gt(
|
|
706
713
|
e?.parallel
|
|
707
714
|
);
|
|
708
715
|
return {
|
|
@@ -716,21 +723,21 @@ function pt(e) {
|
|
|
716
723
|
dontThrowIfError: i?.dontThrowIfError,
|
|
717
724
|
timeController: e?.timeController ?? K,
|
|
718
725
|
parallel: o,
|
|
719
|
-
sequentialOnError:
|
|
726
|
+
sequentialOnError: s
|
|
720
727
|
};
|
|
721
728
|
}
|
|
722
729
|
function B(e, n, t) {
|
|
723
|
-
const { options: i, variantsIterator: o } = e,
|
|
730
|
+
const { options: i, variantsIterator: o } = e, s = o.limit?.args ?? n;
|
|
724
731
|
if (!i.store)
|
|
725
732
|
return;
|
|
726
|
-
const r = i.store.save(
|
|
733
|
+
const r = i.store.save(s);
|
|
727
734
|
if (t)
|
|
728
735
|
return r;
|
|
729
736
|
}
|
|
730
737
|
function ht(e, n, t, i) {
|
|
731
|
-
const { abortControllerParallel: o, state:
|
|
738
|
+
const { abortControllerParallel: o, state: s, options: r } = e, { logOptions: l } = r;
|
|
732
739
|
if (e.options.findBestError)
|
|
733
|
-
e.variantsIterator.addLimit({ args: n, error: t, tests: i }),
|
|
740
|
+
e.variantsIterator.addLimit({ args: n, error: t, tests: i }), s.debugMode = !1, B(e, n, !1), r.sequentialOnError && !o.signal.aborted ? (l.debug && l.func(
|
|
734
741
|
"debug",
|
|
735
742
|
"[test-variants] sequentialOnError: aborting parallel, switching to sequential"
|
|
736
743
|
), o.abort(new I())) : l.debug && l.func(
|
|
@@ -755,9 +762,9 @@ function ce(e, n, t, i) {
|
|
|
755
762
|
o.debugMode = !1;
|
|
756
763
|
return;
|
|
757
764
|
}
|
|
758
|
-
const
|
|
759
|
-
if (
|
|
760
|
-
return
|
|
765
|
+
const s = B(e, n, !0);
|
|
766
|
+
if (s)
|
|
767
|
+
return s.then(() => {
|
|
761
768
|
throw t;
|
|
762
769
|
});
|
|
763
770
|
throw t;
|
|
@@ -799,12 +806,12 @@ function Et(e, n) {
|
|
|
799
806
|
let t = "[test-variants] start";
|
|
800
807
|
n != null && (t += `, memory: ${H(n)}`), e.func("start", t);
|
|
801
808
|
}
|
|
802
|
-
function
|
|
809
|
+
function St(e) {
|
|
803
810
|
const { options: n, state: t } = e, { logOptions: i, timeController: o } = n;
|
|
804
811
|
if (!i.completed)
|
|
805
812
|
return;
|
|
806
|
-
const
|
|
807
|
-
let r = `[test-variants] end, tests: ${t.tests} (${ee(
|
|
813
|
+
const s = o.now() - t.startTime;
|
|
814
|
+
let r = `[test-variants] end, tests: ${t.tests} (${ee(s)}), async: ${t.iterationsAsync}`;
|
|
808
815
|
if (t.startMemory != null) {
|
|
809
816
|
const l = Q();
|
|
810
817
|
l != null && (r += `, memory: ${be(l, t.startMemory)}`);
|
|
@@ -818,18 +825,18 @@ function ye(e) {
|
|
|
818
825
|
`[test-variants] ${vt(o.mode, o.modeIndex)}`
|
|
819
826
|
), t.pendingModeChange = null);
|
|
820
827
|
}
|
|
821
|
-
function
|
|
822
|
-
const { options: n, state: t } = e, { logOptions: i, timeController: o } = n,
|
|
823
|
-
if (!i.progress ||
|
|
828
|
+
function xt(e) {
|
|
829
|
+
const { options: n, state: t } = e, { logOptions: i, timeController: o } = n, s = o.now();
|
|
830
|
+
if (!i.progress || s - t.prevLogTime < i.progress)
|
|
824
831
|
return !1;
|
|
825
832
|
ye(e);
|
|
826
|
-
const r =
|
|
833
|
+
const r = s - t.startTime;
|
|
827
834
|
let l = `[test-variants] tests: ${t.tests} (${ee(r)}), async: ${t.iterationsAsync}`;
|
|
828
835
|
if (t.prevLogMemory != null) {
|
|
829
|
-
const
|
|
830
|
-
|
|
836
|
+
const f = Q();
|
|
837
|
+
f != null && (l += `, memory: ${be(f, t.prevLogMemory)}`, t.prevLogMemory = f);
|
|
831
838
|
}
|
|
832
|
-
return i.func("progress", l), t.prevLogTime =
|
|
839
|
+
return i.func("progress", l), t.prevLogTime = s, !0;
|
|
833
840
|
}
|
|
834
841
|
function J(e, n) {
|
|
835
842
|
e.debugMode = !1, n && (e.iterationsAsync += n.iterationsAsync, e.iterations += n.iterationsSync + n.iterationsAsync);
|
|
@@ -838,11 +845,11 @@ function X(e) {
|
|
|
838
845
|
e.state.debugMode = !0, e.abortControllerParallel.abort(new I());
|
|
839
846
|
}
|
|
840
847
|
function ve(e, n) {
|
|
841
|
-
const { testRun: t, testOptions: i, state: o } = e,
|
|
848
|
+
const { testRun: t, testOptions: i, state: o } = e, s = o.tests;
|
|
842
849
|
o.tests++;
|
|
843
850
|
try {
|
|
844
|
-
const r = t(n,
|
|
845
|
-
if (
|
|
851
|
+
const r = t(n, s, i);
|
|
852
|
+
if (T(r))
|
|
846
853
|
return r.then(
|
|
847
854
|
(l) => {
|
|
848
855
|
if (!l) {
|
|
@@ -851,7 +858,7 @@ function ve(e, n) {
|
|
|
851
858
|
}
|
|
852
859
|
J(o, l);
|
|
853
860
|
},
|
|
854
|
-
(l) => ce(e, n, l,
|
|
861
|
+
(l) => ce(e, n, l, s)
|
|
855
862
|
);
|
|
856
863
|
if (!r) {
|
|
857
864
|
X(e);
|
|
@@ -859,11 +866,11 @@ function ve(e, n) {
|
|
|
859
866
|
}
|
|
860
867
|
J(o, r);
|
|
861
868
|
} catch (r) {
|
|
862
|
-
return r instanceof I ? void 0 : ce(e, n, r,
|
|
869
|
+
return r instanceof I ? void 0 : ce(e, n, r, s);
|
|
863
870
|
}
|
|
864
871
|
}
|
|
865
872
|
function wt(e, n) {
|
|
866
|
-
const { pool: t, abortSignal: i, testRun: o, testOptionsParallel:
|
|
873
|
+
const { pool: t, abortSignal: i, testRun: o, testOptionsParallel: s, state: r } = e;
|
|
867
874
|
if (!t)
|
|
868
875
|
return;
|
|
869
876
|
const l = r.tests;
|
|
@@ -871,26 +878,26 @@ function wt(e, n) {
|
|
|
871
878
|
try {
|
|
872
879
|
if (i.aborted)
|
|
873
880
|
return;
|
|
874
|
-
let
|
|
875
|
-
if (
|
|
881
|
+
let f = o(n, l, s);
|
|
882
|
+
if (T(f) && (f = await f), !f) {
|
|
876
883
|
X(e);
|
|
877
884
|
return;
|
|
878
885
|
}
|
|
879
|
-
J(r,
|
|
880
|
-
} catch (
|
|
881
|
-
if (
|
|
886
|
+
J(r, f);
|
|
887
|
+
} catch (f) {
|
|
888
|
+
if (f instanceof I)
|
|
882
889
|
return;
|
|
883
|
-
ht(e, n,
|
|
890
|
+
ht(e, n, f, l);
|
|
884
891
|
} finally {
|
|
885
892
|
t.release(1);
|
|
886
893
|
}
|
|
887
894
|
})();
|
|
888
895
|
}
|
|
889
896
|
function Ee(e) {
|
|
890
|
-
const { options: n, state: t } = e, { logOptions: i, timeController: o, GC_Interval:
|
|
891
|
-
if (!i.progress && !
|
|
897
|
+
const { options: n, state: t } = e, { logOptions: i, timeController: o, GC_Interval: s } = n;
|
|
898
|
+
if (!i.progress && !s)
|
|
892
899
|
return;
|
|
893
|
-
|
|
900
|
+
xt(e);
|
|
894
901
|
const r = o.now();
|
|
895
902
|
if (bt(e, r))
|
|
896
903
|
return yt(t, r);
|
|
@@ -902,114 +909,116 @@ function Z(e) {
|
|
|
902
909
|
return e.abortSignal.aborted;
|
|
903
910
|
}
|
|
904
911
|
async function W(e, n) {
|
|
905
|
-
const { pool: t, state: i, options: o } = e, { parallel:
|
|
912
|
+
const { pool: t, state: i, options: o } = e, { parallel: s, logOptions: r } = o;
|
|
906
913
|
let l = null;
|
|
907
914
|
for (; !k(e); ) {
|
|
908
|
-
const
|
|
909
|
-
let
|
|
910
|
-
|
|
915
|
+
const f = t && !Z(e);
|
|
916
|
+
let m = !1;
|
|
917
|
+
f && (t.hold(1) || await se({ pool: t, count: 1, hold: !0 }), m = !0);
|
|
911
918
|
try {
|
|
912
919
|
if (n != null ? (l = n, n = null) : e.state.debugMode || (l = e.variantsIterator.next()), l == null)
|
|
913
920
|
break;
|
|
914
|
-
const
|
|
915
|
-
if (
|
|
921
|
+
const c = Ee(e);
|
|
922
|
+
if (T(c) && await c, k(e))
|
|
916
923
|
continue;
|
|
917
|
-
if (
|
|
918
|
-
wt(e, l),
|
|
924
|
+
if (f)
|
|
925
|
+
wt(e, l), m = !1;
|
|
919
926
|
else {
|
|
920
927
|
r.debug && t && Z(e) && r.func(
|
|
921
928
|
"debug",
|
|
922
929
|
`[test-variants] parallel aborted, running sequential: tests=${i.tests}`
|
|
923
930
|
);
|
|
924
|
-
const
|
|
925
|
-
|
|
931
|
+
const b = ve(e, l);
|
|
932
|
+
T(b) && await b;
|
|
926
933
|
}
|
|
927
934
|
} finally {
|
|
928
|
-
|
|
935
|
+
m && t.release(1);
|
|
929
936
|
}
|
|
930
937
|
}
|
|
931
|
-
t && (await se({ pool: t, count:
|
|
938
|
+
t && (await se({ pool: t, count: s, hold: !0 }), t.release(s));
|
|
932
939
|
}
|
|
933
940
|
function Mt(e) {
|
|
934
941
|
const { pool: n, state: t, options: i } = e, { logOptions: o } = i;
|
|
935
942
|
if (n)
|
|
936
943
|
return W(e);
|
|
937
|
-
let
|
|
938
|
-
for (; !k(e) && (e.state.debugMode || (
|
|
944
|
+
let s = null;
|
|
945
|
+
for (; !k(e) && (e.state.debugMode || (s = e.variantsIterator.next()), s != null); ) {
|
|
939
946
|
const r = Ee(e);
|
|
940
|
-
if (
|
|
941
|
-
return r.then(() => W(e,
|
|
947
|
+
if (T(r))
|
|
948
|
+
return r.then(() => W(e, s));
|
|
942
949
|
if (k(e))
|
|
943
950
|
continue;
|
|
944
951
|
o.debug && Z(e) && o.func(
|
|
945
952
|
"debug",
|
|
946
953
|
`[test-variants] parallel aborted, running sequential: tests=${t.tests}`
|
|
947
954
|
);
|
|
948
|
-
const l = ve(e,
|
|
949
|
-
if (
|
|
955
|
+
const l = ve(e, s);
|
|
956
|
+
if (T(l))
|
|
950
957
|
return l.then(() => W(e));
|
|
951
958
|
}
|
|
952
959
|
}
|
|
953
960
|
async function It(e, n, t, i) {
|
|
954
961
|
const o = pt(i), {
|
|
955
|
-
store:
|
|
962
|
+
store: s,
|
|
956
963
|
logOptions: r,
|
|
957
964
|
abortSignalExternal: l,
|
|
958
|
-
findBestError:
|
|
959
|
-
dontThrowIfError:
|
|
960
|
-
timeController:
|
|
961
|
-
parallel:
|
|
962
|
-
} = o, y = new ie(),
|
|
965
|
+
findBestError: f,
|
|
966
|
+
dontThrowIfError: m,
|
|
967
|
+
timeController: c,
|
|
968
|
+
parallel: b
|
|
969
|
+
} = o, y = new ie(), d = new ie(), h = oe(
|
|
963
970
|
l,
|
|
964
971
|
y.signal
|
|
965
|
-
),
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
),
|
|
969
|
-
abortSignal:
|
|
970
|
-
timeController:
|
|
971
|
-
},
|
|
972
|
-
abortSignal:
|
|
973
|
-
timeController:
|
|
972
|
+
), v = oe(
|
|
973
|
+
h,
|
|
974
|
+
d.signal
|
|
975
|
+
), x = {
|
|
976
|
+
abortSignal: h,
|
|
977
|
+
timeController: c
|
|
978
|
+
}, p = {
|
|
979
|
+
abortSignal: v,
|
|
980
|
+
timeController: c
|
|
974
981
|
};
|
|
975
|
-
|
|
982
|
+
s && await s.replay({
|
|
976
983
|
testRun: e,
|
|
977
984
|
variantsIterator: n,
|
|
978
|
-
testOptions:
|
|
979
|
-
findBestErrorEnabled: !!
|
|
985
|
+
testOptions: x,
|
|
986
|
+
findBestErrorEnabled: !!f
|
|
980
987
|
});
|
|
981
|
-
const
|
|
988
|
+
const w = b <= 1 ? null : new Ke(b);
|
|
982
989
|
Et(r, t.startMemory);
|
|
983
|
-
const
|
|
990
|
+
const A = {
|
|
984
991
|
options: o,
|
|
985
992
|
testRun: e,
|
|
986
993
|
variantsIterator: n,
|
|
987
|
-
testOptions:
|
|
988
|
-
testOptionsParallel:
|
|
994
|
+
testOptions: x,
|
|
995
|
+
testOptionsParallel: p,
|
|
989
996
|
abortControllerGlobal: y,
|
|
990
|
-
abortControllerParallel:
|
|
991
|
-
abortSignal:
|
|
992
|
-
pool:
|
|
997
|
+
abortControllerParallel: d,
|
|
998
|
+
abortSignal: v,
|
|
999
|
+
pool: w,
|
|
993
1000
|
state: t
|
|
994
1001
|
};
|
|
995
|
-
ye(
|
|
1002
|
+
ye(A);
|
|
996
1003
|
try {
|
|
997
|
-
await Mt(
|
|
1004
|
+
await Mt(A), v.throwIfAborted();
|
|
998
1005
|
} catch (P) {
|
|
999
1006
|
throw y.abort(new I()), P;
|
|
1000
1007
|
}
|
|
1001
|
-
return
|
|
1008
|
+
return h.throwIfAborted(), y.abort(new I()), St(A), await Y(1), mt(t, n, m);
|
|
1002
1009
|
}
|
|
1003
1010
|
function Nt(e) {
|
|
1004
1011
|
return function(t) {
|
|
1005
1012
|
return async function(o) {
|
|
1006
|
-
const
|
|
1013
|
+
const s = pe(o?.log), r = st(e, {
|
|
1014
|
+
onStart: o?.onStart,
|
|
1015
|
+
onEnd: o?.onEnd,
|
|
1007
1016
|
onError: o?.onError,
|
|
1008
|
-
log:
|
|
1017
|
+
log: s,
|
|
1009
1018
|
pauseDebuggerOnError: o?.pauseDebuggerOnError
|
|
1010
|
-
}), l = o?.timeController ?? K,
|
|
1011
|
-
function
|
|
1012
|
-
|
|
1019
|
+
}), l = o?.timeController ?? K, f = Q(), m = nt(l, f), c = o?.onModeChange;
|
|
1020
|
+
function b(d) {
|
|
1021
|
+
m.pendingModeChange = d, c?.(d);
|
|
1013
1022
|
}
|
|
1014
1023
|
const y = dt({
|
|
1015
1024
|
argsTemplates: t,
|
|
@@ -1019,12 +1028,12 @@ function Nt(e) {
|
|
|
1019
1028
|
limitArgOnError: o?.findBestError?.limitArgOnError,
|
|
1020
1029
|
includeErrorVariant: o?.findBestError?.includeErrorVariant,
|
|
1021
1030
|
timeController: l,
|
|
1022
|
-
onModeChange:
|
|
1031
|
+
onModeChange: b,
|
|
1023
1032
|
limitCompletionCount: o?.cycles ?? 1,
|
|
1024
1033
|
limitTests: o?.limitTests,
|
|
1025
1034
|
limitTime: o?.limitTime
|
|
1026
1035
|
});
|
|
1027
|
-
return It(r, y,
|
|
1036
|
+
return It(r, y, m, o);
|
|
1028
1037
|
};
|
|
1029
1038
|
};
|
|
1030
1039
|
}
|