Listeners missing from reports

23 views
Skip to first unread message

Dan Parrella

unread,
Jun 19, 2024, 9:24:08 AM (14 days ago) Jun 19
to testng-users
Hello,
We have a number of suite and execution listeners we use in our test suites. Some of them involve test environment setup and teardown.

We've been trying to find ways to optimize our test execution times, but have found that listeners are not included in TestNG reports - only test and configuration methods.

It would be helpful to see invoked listeners in the "Chronological view" and the duration of execution.

Perhaps this is missing because listeners themselves could be used in generating reports? Would love to hear suggestions on how we might be able to track the performance of our listeners other than logging. Oddly enough we have seen that some log output via logback in our listeners doesn't get included in our test logs.

Thank you,
Dan

Krishnan Mahadevan

unread,
Jun 19, 2024, 10:22:39 AM (14 days ago) Jun 19
to testng...@googlegroups.com
For you to be able to see listeners being included in the reports, you would need to add logic to build them.

Listeners as you mentioned will also be involved in reporting. Also you would not be able to have access to all the listeners that are being invoked for your test project (because some listeners may come in as mandatory listeners because they are wired in via service loaders by the dependencies that you included).

If you would like to just trace the time taken for your own listeners, then I would suggest that you can perhaps do something like below:

1. Build a wrapper listener which internally is aware of all the other listeners that are being used in your project.
2. Start logging the time taken by each of the listeners within this wrapper listener and then use that data to figure out where the bottle neck is.



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/aabee69c-b069-4440-8062-e38391f72cd3n%40googlegroups.com.

Dan Parrella

unread,
Jun 19, 2024, 11:58:53 AM (14 days ago) Jun 19
to testng-users
Thank you, Krishna. That makes sense and I will give the wrapper listener approach a try.
Reply all
Reply to author
Forward
0 new messages