Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Synthetics] Upgrade synthetics lib !! #207711

Merged
merged 3 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@
"@cypress/webpack-preprocessor": "^6.0.1",
"@elastic/eslint-plugin-eui": "0.0.2",
"@elastic/makelogs": "^6.1.1",
"@elastic/synthetics": "^1.12.1",
"@elastic/synthetics": "^1.17.2",
"@emotion/babel-preset-css-prop": "^11.11.0",
"@emotion/jest": "^11.11.0",
"@frsource/cypress-plugin-visual-regression-diff": "^3.3.10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,10 @@ export class TestReporter implements Reporter {
succeeded: 0,
failed: 0,
skipped: 0,
pending: 0,
};

journeys: Map<string, Array<StepEndResult & { name: string }>> = new Map();
journeys: Map<string, Step[]> = new Map();

constructor(options: ReporterOptions = {}) {}

Expand All @@ -67,9 +68,9 @@ export class TestReporter implements Reporter {
}

onStepEnd(journey: Journey, step: Step, result: StepEndResult) {
const { status, end, start, error } = result;
const { status, error, duration } = step;
const message = `${symbols[status]} Step: '${step.name}' ${status} (${renderDuration(
(end - start) * 1000
duration * 1000
)} ms)`;
this.write(indent(message));
if (error) {
Expand All @@ -79,16 +80,16 @@ export class TestReporter implements Reporter {
if (!this.journeys.has(journey.name)) {
this.journeys.set(journey.name, []);
}
this.journeys.get(journey.name)?.push({ name: step.name, ...result });
this.journeys.get(journey.name)?.push(step);
}

async onJourneyEnd(journey: Journey, { error, start, end, status }: JourneyEndResult) {
async onJourneyEnd({ status, duration, error }: Journey, _result: JourneyEndResult) {
const { failed, succeeded, skipped } = this.metrics;
const total = failed + succeeded + skipped;
if (total === 0 && error) {
this.write(renderError(error));
}
const message = `${symbols[status]} Took (${renderDuration(end - start)} seconds)`;
const message = `${symbols[status]} Took (${renderDuration(duration)} seconds)`;
this.write(message);

await fs.promises.mkdir('.journeys/failed_steps', { recursive: true });
Expand Down Expand Up @@ -117,9 +118,9 @@ export class TestReporter implements Reporter {
const name = red(`Journey: ${journeyName} 🥵`);
this.write(`\n+++ ${name}`);
steps.forEach((stepResult) => {
const { status, end, start, error, name: stepName } = stepResult;
const { status, duration, error, name: stepName } = stepResult;
const message = `${symbols[status]} Step: '${stepName}' ${status} (${renderDuration(
(end - start) * 1000
duration * 1000
)} ms)`;
this.write(indent(message));
if (error) {
Expand Down Expand Up @@ -180,6 +181,7 @@ function indent(lines: string, tab = ' ') {
const NO_UTF8_SUPPORT = process.platform === 'win32';
const symbols = {
warning: yellow(NO_UTF8_SUPPORT ? '!' : '⚠'),
pending: yellow(NO_UTF8_SUPPORT ? '!' : '⚠'),
skipped: cyan('-'),
progress: cyan('>'),
succeeded: green(NO_UTF8_SUPPORT ? 'ok' : '✓'),
Expand Down
Loading
Loading