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 the issue with the logs in afterhook #96

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

NeginMn
Copy link

@NeginMn NeginMn commented Jun 28, 2023

No description provided.

@NeginMn
Copy link
Author

NeginMn commented Jun 28, 2023

Fix the bug related to #50 and #44 issues. @AmsterGet Please review it.

@AmsterGet AmsterGet self-requested a review July 18, 2023 11:00
@AmsterGet
Copy link
Member

Hello @NeginMn !
Thanks for the contribution!
I'll dedicate time for that in the next sprint (next two weeks).

@@ -298,7 +298,6 @@ class ReportportalAgent extends Mocha.reporters.Base {
this.attributes.delete(this.currentTest.tempId);
this.descriptions.delete(this.currentTest.tempId);
this.testCaseIds.delete(this.currentTest.tempId);
this.currentTest = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, @NeginMn!
Unfortunately, we can not just delete this line of code and make everything work as expected.
Here is the reason:
Mocha provides the status pending for a test without a callback or the tests with descripe.skip or this.skip()(you can read more about it here)

If we remove assignment this.currentTest = null this line of code, wouldn't be executed
Screenshot 2023-09-13 at 18 08 34
and in the RP we will see the following
Screenshot 2023-09-13 at 18 13 08
Tests with pending status started twice, but only one of them was finished.

But it is not the main problem.
We expected, that logs, attachments and etc, would be reported incide afterEach hook, not in the test itself.
But we have the following
Screenshot 2023-09-13 at 18 18 44
It is reported directly inside the test itself.
Here is the afterEach hook itself
Screenshot 2023-09-13 at 18 19 40

Without this.currentTest = null, attachments, logs etc., report on the suit level which also not the best option.
If you have an opportunity and desire you can try to implement attaching meta information to the afterEach hook itself.
Unfortunately, currently, our team doesn't have the capacity to implement this feature. But as soon as we find the capacity, we will try to fix it!

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.

3 participants