You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Im using XRetry and I would like to be alerted when a retry happens.
In my case I'd like to send a slack message to a certain channel, but another use case could be to attach a custom logger. Almost all the projects I worked on test automation had a custom logger.
So is there a way to execute some custom code when a retry happens?
Ive tried a lot to do this:
Making a fork and adding it to the RetryTestCaseRunner. But by doing this my test did not start anymore.
Trying to catch the DiagnosticMessage and doing something if a retry is logged, but I'm not able to read out the DiagnosticMessage and do something with it.
Is there a way to add something for this maybe?
The text was updated successfully, but these errors were encountered:
is there a way to execute some custom code when a retry happens?
Not built-in. You'd need to either fork xRetry and add this, or enable diagnostic logs and then parsing them in a separate process to send alerts. I'd imagine parsing the logs in a separate process would be simpler than implementing it in a fork, and means you wouldn't have to worry about the additional code altering the way tests are run, e.g. by causing thread hopping.
Almost all the projects I worked on test automation had a custom logger
I think that would be beyond the scope of this project. Since xRetry is on top of xUnit, it just logs in the way xUnit makes available. If that were to ever be customisable it should be done via xUnit, or another plugin for it, rather than xRetry specifically offering a mechanism for a custom logger.
Trying to catch the DiagnosticMessage
I'm not sure what you mean by this as I don't know of anywhere it's exposed for a test to view.
Okay, thanks for the info, I'll try to parse the diagnostic logs then. That's what I meant by "catching the DiagnosticMessage" by the way.
With the custom logger, I meant that it would be a good use case for being able to execute some code if a retry happens. I would then just log "Retrying" to a text file. That way we can see if it happens on a Jenkins run.
Hi,
Im using XRetry and I would like to be alerted when a retry happens.
In my case I'd like to send a slack message to a certain channel, but another use case could be to attach a custom logger. Almost all the projects I worked on test automation had a custom logger.
So is there a way to execute some custom code when a retry happens?
Ive tried a lot to do this:
Is there a way to add something for this maybe?
The text was updated successfully, but these errors were encountered: