Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Garment runners should exit with exitCode != 0 when logger.error is called #40

Closed
SoaresMG opened this issue Mar 5, 2021 · 0 comments · Fixed by #41
Closed

Garment runners should exit with exitCode != 0 when logger.error is called #40

SoaresMG opened this issue Mar 5, 2021 · 0 comments · Fixed by #41

Comments

@SoaresMG
Copy link
Contributor

SoaresMG commented Mar 5, 2021

Issue Report

I have several chained runners on a single task, they also run in batch mode.
There should be a way to change exitCode if an error is present.

Expected Behavior

I was expecting an exitCode != 0 when I call logger.error so my pipelines detect there was an error when running it.

Actual Behavior

This error is specific for pipelines.
It currently exists with exitCode = 0 even when there is an error.

const exitCode = await wdioLauncher.run();

if (exitCode != 0) {
  ctx.logger.error(
    `There was an error during wdio process or some tests failed.`
  );
}

Right now the only way we have to exit is through process.exit which breaks garment's flow.

const exitCode = await wdioLauncher.run();

if (exitCode != 0) {
  process.exit(exitCode);
}

Steps to Reproduce the Issue

  1. When calling ctx.logger.error() garment should exit as -1 or 1
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant