-
Notifications
You must be signed in to change notification settings - Fork 20
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
Logs from TestNG DataProvider methods are captured and associated with the corresponding test in ReportPortal. #202
Comments
@HardNorth looks like another good thing to consider. |
@DzmitryHumianiuk I doubt this is really possible. Data providers are called before test creation. So the only option is launch logs, where, I believe, it is already reported. |
@akshayamaldhure look if you can see them in Launch's Log view: |
@DzmitryHumianiuk Apologies for the delayed response. I do not see the logs from my |
@akshayamaldhure, in that case, it looks like we need to implement this on the agent side of the ReportPortal integration to properly capture these log types. We'll need to develop a mechanism that allows us to link logs to a test case that hasn’t been created yet. This could potentially be managed with a promise object that anticipates the expected ID, or by pre-determining the test case ID before its initialization. So, to give you a straightforward answer: this functionality isn't currently available. |
@akshayamaldhure, with your permission, I'll keep this request open and reclassify it as a feature request. |
@DzmitryHumianiuk What you saying is not even possible. We just simply don't have any reference on Test Case. No any "promises" would help you, because you won't chain them with currently running test, unless it's single-threaded execution. |
@HardNorth, as far as I remember from the inner workings of TestNG, the relationship between the DataProvider and the method using it is formed in a single thread. So, there shouldn't be a situation where the DataProvider runs in a separate thread. What I mean by "promise" is essentially deferring the submission of logs related to the DataProvider until the next active test appears. When the next active test starts, we would assign its ID to the logs from the DataProvider, which are temporarily stored in a thread-safe collection. Right now, the logs are likely generated and sent without belonging to a specific testItem and are assigned at the launch level. But if we delay them, knowing they’re from the DataProvider, and assign them to the next upcoming TestCase ID, this could be a solution. These are my theoretical ideas — reality might differ. |
I understand that the logs from the various hooks (like all the methods annotated with
@Before*
and@After*
) and all the@Test
s are available for viewing in Reportportal. However, I did not see those coming from the methods annotated with@DataProvider
. This makes it a bit challenging to debug any issues related to construction/population of the test data. Please let me know if I'm missing anything here.The text was updated successfully, but these errors were encountered: