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

✨ Adding env variable support so that if set to true we exit with status code 0 when any percy related error occurs. #1647

Merged
merged 6 commits into from
Jul 2, 2024

Conversation

prklm10
Copy link
Contributor

@prklm10 prklm10 commented Jul 1, 2024

Adding env variable support so that if set to true we exit with status code 0 when any percy related error occurs.
PERCY_EXIT_WITH_ZERO_ON_ERROR is the env variable.
It won't override when customer command throws any error.

This will solve #1590 issue.
Ticket -> https://browserstack.atlassian.net/browse/PER-3235

@prklm10 prklm10 requested a review from a team as a code owner July 1, 2024 12:05
@prklm10 prklm10 requested review from bkhanale and pankaj443 July 1, 2024 12:05
@prklm10 prklm10 added the ✨ enhancement New feature or request label Jul 1, 2024
@@ -155,7 +159,10 @@ export function command(name, definition, callback) {
err.message ||= `EEXIT: ${err.exitCode}`;

if (definition.exitOnError) {
process.exit(err.exitCode);
let shouldOverrideExitCode = err.shouldOverrideExitCode !== false;
let percyExitWithZeroOnError = process.env.PERCY_EXIT_WITH_ZERO_ON_ERROR === 'true';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possible to remove duplication?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it but when setting const above the function the tests were failing.

@prklm10 prklm10 merged commit 865bab5 into master Jul 2, 2024
36 checks passed
@prklm10 prklm10 deleted the PER-3235 branch July 2, 2024 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants