@elastic/synthetics 1.17.2 → 1.18.0
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/cli.js.map +1 -1
- package/dist/common_types.d.ts.map +1 -1
- package/dist/core/globals.d.ts +1 -0
- package/dist/core/globals.d.ts.map +1 -1
- package/dist/core/globals.js +12 -1
- package/dist/core/globals.js.map +1 -1
- package/dist/core/logger.d.ts.map +1 -1
- package/dist/core/logger.js +2 -7
- package/dist/core/logger.js.map +1 -1
- package/dist/core/mfa.d.ts.map +1 -1
- package/dist/core/mfa.js +1 -1
- package/dist/dsl/monitor.d.ts +4 -0
- package/dist/dsl/monitor.d.ts.map +1 -1
- package/dist/dsl/monitor.js +6 -0
- package/dist/dsl/monitor.js.map +1 -1
- package/dist/formatter/javascript.d.ts.map +1 -1
- package/dist/formatter/javascript.js.map +1 -1
- package/dist/generator/utils.d.ts +1 -1
- package/dist/helpers.d.ts.map +1 -1
- package/dist/helpers.js.map +1 -1
- package/dist/plugins/tracing.js.map +1 -1
- package/dist/push/bundler.d.ts +2 -5
- package/dist/push/bundler.d.ts.map +1 -1
- package/dist/push/bundler.js +15 -30
- package/dist/push/bundler.js.map +1 -1
- package/dist/push/index.d.ts.map +1 -1
- package/dist/push/index.js +21 -6
- package/dist/push/index.js.map +1 -1
- package/dist/push/monitor.d.ts +4 -1
- package/dist/push/monitor.d.ts.map +1 -1
- package/dist/push/monitor.js +13 -1
- package/dist/push/monitor.js.map +1 -1
- package/dist/push/run-local.d.ts +27 -0
- package/dist/push/run-local.d.ts.map +1 -0
- package/dist/push/run-local.js +132 -0
- package/dist/push/run-local.js.map +1 -0
- package/dist/push/utils.d.ts +2 -0
- package/dist/push/utils.d.ts.map +1 -1
- package/dist/push/utils.js +33 -1
- package/dist/push/utils.js.map +1 -1
- package/dist/reporters/base.d.ts.map +1 -1
- package/dist/reporters/base.js.map +1 -1
- package/dist/reporters/build_kite_cli.d.ts.map +1 -1
- package/dist/reporters/build_kite_cli.js.map +1 -1
- package/dist/reporters/json.d.ts +1 -1
- package/dist/reporters/json.d.ts.map +1 -1
- package/dist/reporters/json.js +6 -2
- package/dist/reporters/json.js.map +1 -1
- package/dist/reporters/junit.d.ts.map +1 -1
- package/dist/reporters/junit.js.map +1 -1
- package/package.json +8 -5
- package/src/cli.ts +8 -3
- package/src/common_types.ts +1 -1
- package/src/core/globals.ts +12 -0
- package/src/core/logger.ts +2 -8
- package/src/core/mfa.ts +11 -11
- package/src/dsl/monitor.ts +7 -0
- package/src/formatter/javascript.ts +3 -1
- package/src/helpers.ts +3 -3
- package/src/loader.ts +1 -1
- package/src/plugins/tracing.ts +1 -1
- package/src/push/bundler.ts +16 -36
- package/src/push/index.ts +28 -10
- package/src/push/monitor.ts +16 -4
- package/src/push/run-local.ts +155 -0
- package/src/push/utils.ts +51 -5
- package/src/reporters/base.ts +8 -4
- package/src/reporters/build_kite_cli.ts +7 -6
- package/src/reporters/json.ts +10 -14
- package/src/reporters/junit.ts +4 -10
package/src/reporters/base.ts
CHANGED
|
@@ -29,7 +29,11 @@ import { renderError, serializeError } from './reporter-util';
|
|
|
29
29
|
import { symbols, indent, now } from '../helpers';
|
|
30
30
|
import { Reporter, ReporterOptions } from '.';
|
|
31
31
|
import { Journey, Step } from '../dsl';
|
|
32
|
-
import {
|
|
32
|
+
import {
|
|
33
|
+
JourneyEndResult,
|
|
34
|
+
JourneyStartResult,
|
|
35
|
+
StepResult,
|
|
36
|
+
} from '../common_types';
|
|
33
37
|
|
|
34
38
|
export function renderDuration(durationMs) {
|
|
35
39
|
return parseInt(durationMs);
|
|
@@ -62,11 +66,11 @@ export default class BaseReporter implements Reporter {
|
|
|
62
66
|
this.metrics.registered++;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
onJourneyStart(journey: Journey, {
|
|
69
|
+
onJourneyStart(journey: Journey, {}: JourneyStartResult) {
|
|
66
70
|
this.write(`\nJourney: ${journey.name}`);
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
onStepEnd(_: Journey, step: Step, {
|
|
73
|
+
onStepEnd(_: Journey, step: Step, {}: StepResult) {
|
|
70
74
|
const { status, error } = step;
|
|
71
75
|
const message = `${symbols[status]} Step: '${step.name}' ${status} ${gray(
|
|
72
76
|
'(' + renderDuration(step.duration * 1000) + ' ms)'
|
|
@@ -80,7 +84,7 @@ export default class BaseReporter implements Reporter {
|
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
83
|
-
onJourneyEnd(journey: Journey, {
|
|
87
|
+
onJourneyEnd(journey: Journey, {}: JourneyEndResult) {
|
|
84
88
|
const { failed, succeeded, skipped } = this.metrics;
|
|
85
89
|
const total = failed + succeeded + skipped;
|
|
86
90
|
/**
|
|
@@ -43,7 +43,7 @@ export default class BuildKiteCLIReporter extends BaseReporter {
|
|
|
43
43
|
super(options);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
override onJourneyStart(journey: Journey, {
|
|
46
|
+
override onJourneyStart(journey: Journey, {}: JourneyStartResult) {
|
|
47
47
|
this.write(`\n--- Journey: ${journey.name}`);
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -57,7 +57,9 @@ export default class BuildKiteCLIReporter extends BaseReporter {
|
|
|
57
57
|
|
|
58
58
|
override async onJourneyEnd(journey: Journey, result: JourneyEndResult) {
|
|
59
59
|
super.onJourneyEnd(journey, result);
|
|
60
|
-
const message = `${symbols[journey.status]} Took (${renderDuration(
|
|
60
|
+
const message = `${symbols[journey.status]} Took (${renderDuration(
|
|
61
|
+
journey.duration
|
|
62
|
+
)} seconds)`;
|
|
61
63
|
this.write(message);
|
|
62
64
|
}
|
|
63
65
|
|
|
@@ -76,10 +78,9 @@ export default class BuildKiteCLIReporter extends BaseReporter {
|
|
|
76
78
|
const name = red(`Journey: ${journeyName} :slightly_frowning_face:`);
|
|
77
79
|
this.write(`\n+++ ${name}`);
|
|
78
80
|
steps.forEach(step => {
|
|
79
|
-
const message = `${symbols[step.status]
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
)} ms)`;
|
|
81
|
+
const message = `${symbols[step.status]} Step: '${step.name}' ${
|
|
82
|
+
step.status
|
|
83
|
+
} (${renderDuration(step.duration * 1000)} ms)`;
|
|
83
84
|
this.write(indent(message));
|
|
84
85
|
if (step.error) {
|
|
85
86
|
this.write(renderError(serializeError(step.error)));
|
package/src/reporters/json.ts
CHANGED
|
@@ -253,14 +253,15 @@ function formatJSONError(error: Error | any) {
|
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
function journeyInfo(
|
|
257
|
-
journey: Partial<Journey>,
|
|
258
|
-
type: OutputFields['type'],
|
|
259
|
-
) {
|
|
256
|
+
function journeyInfo(journey: Partial<Journey>, type: OutputFields['type']) {
|
|
260
257
|
if (!journey) {
|
|
261
258
|
return;
|
|
262
259
|
}
|
|
263
|
-
const info: JourneyInfo = {
|
|
260
|
+
const info: JourneyInfo = {
|
|
261
|
+
name: journey.name,
|
|
262
|
+
id: journey.id,
|
|
263
|
+
tags: journey.tags,
|
|
264
|
+
};
|
|
264
265
|
const isEnd = type === 'journey/end';
|
|
265
266
|
if (isEnd) {
|
|
266
267
|
info.status = journey.status;
|
|
@@ -271,7 +272,7 @@ function journeyInfo(
|
|
|
271
272
|
|
|
272
273
|
function stepInfo(
|
|
273
274
|
step: Partial<Step>,
|
|
274
|
-
type: OutputFields['type']
|
|
275
|
+
type: OutputFields['type']
|
|
275
276
|
): Omit<Partial<Step>, 'duration'> & Duration {
|
|
276
277
|
if (!step) {
|
|
277
278
|
return;
|
|
@@ -375,8 +376,8 @@ export default class JSONReporter extends BaseReporter {
|
|
|
375
376
|
},
|
|
376
377
|
payload: event.networkConditions
|
|
377
378
|
? {
|
|
378
|
-
|
|
379
|
-
|
|
379
|
+
network_conditions: event.networkConditions,
|
|
380
|
+
}
|
|
380
381
|
: undefined,
|
|
381
382
|
});
|
|
382
383
|
}
|
|
@@ -400,12 +401,7 @@ export default class JSONReporter extends BaseReporter {
|
|
|
400
401
|
override onStepEnd(
|
|
401
402
|
journey: Journey,
|
|
402
403
|
step: Step,
|
|
403
|
-
{
|
|
404
|
-
pagemetrics,
|
|
405
|
-
traces,
|
|
406
|
-
metrics,
|
|
407
|
-
filmstrips,
|
|
408
|
-
}: StepEndResult
|
|
404
|
+
{ pagemetrics, traces, metrics, filmstrips }: StepEndResult
|
|
409
405
|
) {
|
|
410
406
|
this.writeMetrics(journey, step, 'relative_trace', traces);
|
|
411
407
|
this.writeMetrics(journey, step, 'experience', metrics);
|
package/src/reporters/junit.ts
CHANGED
|
@@ -25,10 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
import { mkdir, writeFile } from 'fs/promises';
|
|
27
27
|
import { dirname } from 'path';
|
|
28
|
-
import {
|
|
29
|
-
JourneyEndResult,
|
|
30
|
-
JourneyStartResult,
|
|
31
|
-
} from '../common_types';
|
|
28
|
+
import { JourneyEndResult, JourneyStartResult } from '../common_types';
|
|
32
29
|
import { Journey, Step } from '../dsl';
|
|
33
30
|
import { indent, now } from '../helpers';
|
|
34
31
|
import BaseReporter from './base';
|
|
@@ -59,7 +56,7 @@ export default class JUnitReporter extends BaseReporter {
|
|
|
59
56
|
private totalSkipped = 0;
|
|
60
57
|
#journeyMap = new Map<string, XMLEntry>();
|
|
61
58
|
|
|
62
|
-
override onJourneyStart(journey: Journey, {
|
|
59
|
+
override onJourneyStart(journey: Journey, {}: JourneyStartResult) {
|
|
63
60
|
if (!this.#journeyMap.has(journey.name)) {
|
|
64
61
|
const entry = {
|
|
65
62
|
name: 'testsuite',
|
|
@@ -76,10 +73,7 @@ export default class JUnitReporter extends BaseReporter {
|
|
|
76
73
|
}
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
override onStepEnd(
|
|
80
|
-
journey: Journey,
|
|
81
|
-
step: Step,
|
|
82
|
-
) {
|
|
76
|
+
override onStepEnd(journey: Journey, step: Step) {
|
|
83
77
|
if (!this.#journeyMap.has(journey.name)) {
|
|
84
78
|
return;
|
|
85
79
|
}
|
|
@@ -117,7 +111,7 @@ export default class JUnitReporter extends BaseReporter {
|
|
|
117
111
|
entry.children.push(caseEntry);
|
|
118
112
|
}
|
|
119
113
|
|
|
120
|
-
override onJourneyEnd(journey: Journey, {
|
|
114
|
+
override onJourneyEnd(journey: Journey, {}: JourneyEndResult) {
|
|
121
115
|
if (!this.#journeyMap.has(journey.name)) {
|
|
122
116
|
return;
|
|
123
117
|
}
|