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

fix: return correct test result status #575

Merged
merged 1 commit into from
Jul 20, 2024

Conversation

KuznetsovRoman
Copy link
Member

@KuznetsovRoman KuznetsovRoman commented Jul 17, 2024

Now (test has failed status, and no error message is shown, though there was an error):
image

After this PR (test has error status and error message is shown):
image

@@ -32,7 +32,7 @@ export const getStatus = (eventName: ValueOf<Testplane['events']>, events: Testp
} else if (eventName === events.TEST_PENDING) {
return TestStatus.SKIPPED;
} else if (eventName === events.RETRY || eventName === events.TEST_FAIL) {
return hasFailedImages(testResult.assertViewResults as ImageInfoFull[]) ? TestStatus.FAIL : TestStatus.ERROR;
return isAssertViewError(testResult.err) ? TestStatus.FAIL : TestStatus.ERROR;
Copy link
Member Author

Choose a reason for hiding this comment

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

Test result with errors could still has failed images

Copy link
Member

Choose a reason for hiding this comment

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

Why you check here only assert view error and don't check diff (isImageDiffError) or no ref image (isNoRefImageError)?

Copy link
Member Author

@KuznetsovRoman KuznetsovRoman Jul 19, 2024

Choose a reason for hiding this comment

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

Because testResult can only have assert view error.
isImageDiffError and isNoRefImageError - are image errors, and not the result ones. So if testResult has an image with isImageDiffError or isNoRefImageError - it would have AssertViewError:

I can, though, check for other errors, just in case

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-146.fix_status branch from 78c0ff9 to 4ee6fd5 Compare July 18, 2024 18:12
Copy link
Member

@DudaGod DudaGod left a comment

Choose a reason for hiding this comment

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

otherwise /ok

@@ -32,7 +32,7 @@ export const getStatus = (eventName: ValueOf<Testplane['events']>, events: Testp
} else if (eventName === events.TEST_PENDING) {
return TestStatus.SKIPPED;
} else if (eventName === events.RETRY || eventName === events.TEST_FAIL) {
return hasFailedImages(testResult.assertViewResults as ImageInfoFull[]) ? TestStatus.FAIL : TestStatus.ERROR;
return isAssertViewError(testResult.err) ? TestStatus.FAIL : TestStatus.ERROR;
Copy link
Member

Choose a reason for hiding this comment

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

Why you check here only assert view error and don't check diff (isImageDiffError) or no ref image (isNoRefImageError)?

@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-146.fix_status branch from 4ee6fd5 to 8edc243 Compare July 19, 2024 13:29
@KuznetsovRoman KuznetsovRoman force-pushed the TESTPLANE-146.fix_status branch from 8edc243 to 5763ffb Compare July 20, 2024 01:04
@KuznetsovRoman KuznetsovRoman merged commit 8107245 into master Jul 20, 2024
4 checks passed
@KuznetsovRoman KuznetsovRoman deleted the TESTPLANE-146.fix_status branch July 20, 2024 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants