[FEATURE] Tests should be able to detect if warnings/errors were logged #2098
Labels
enhancement
New feature or request
help wanted
Community contributions are especially encouraged for these issues.
triaged
Issues labeled as 'Triaged' have been reviewed and are deemed actionable.
Is your feature request related to a problem?
There are many condictions within the security plugin that warn/error on bad configuration or help guide users away from deprecated features. There should be a way to confirm that the warnings/errors were actually fired for users/administrators to see.
What solution would you like?
We could add a mechanism to listen to the logger output and make it available for tests to assert on, this would involve catching this state from running nodes, aggregating it, and supplying for a test in progress. It would be complex to implement in a reliable fashion as it is a similiar scenario to TestAuditlogImpl
What alternatives have you considered?
OpenSearchTestCase has this functionality, and migrating to these base configurations is an option for some test configurations, see
OpenSearchTestCase.java#L506
The text was updated successfully, but these errors were encountered: