-
Notifications
You must be signed in to change notification settings - Fork 291
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
[Feature-2188] AuditMessage validation in tests should be more useful / removed #3596
[Feature-2188] AuditMessage validation in tests should be more useful / removed #3596
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @prabhask5 for this PR. I left some comments around white-space/indentation fixes, please address those and I will re-review them.
src/test/java/org/opensearch/security/auditlog/AbstractAuditlogiUnitTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/security/auditlog/AbstractAuditlogiUnitTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opensearch/security/auditlog/compliance/ComplianceAuditlogTest.java
Show resolved
Hide resolved
src/test/java/org/opensearch/security/auditlog/integration/BasicAuditlogTest.java
Show resolved
Hide resolved
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
This reverts commit 62a9c2c. Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
429cace
to
016759d
Compare
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
Not sure how to handle catching the JsonMappingExceptions and making them more specific up the stack trace since apparently the constructor for it is deprecated. Would like some guidance on that if possible |
src/test/java/org/opensearch/security/auditlog/AbstractAuditlogiUnitTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
src/test/java/org/opensearch/security/auditlog/AbstractAuditlogiUnitTest.java
Show resolved
Hide resolved
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
src/test/java/org/opensearch/security/auditlog/AbstractAuditlogiUnitTest.java
Show resolved
Hide resolved
src/test/java/org/opensearch/security/auditlog/AbstractAuditlogiUnitTest.java
Show resolved
Hide resolved
@prabhask5 Please look into the failing CI checks, it looks like there are some outstanding issues that need to be resolved |
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
@peternied Most of the errors from before where not related to changes that I made, so I'm pretty confused on how to fix them. I merged main, so hopefully(?) it fixes things. If not, I'd like some guidance on how to proceed. Thanks! |
… / removed (#3596) Changed validateMsgs in AbstractAuditlogUnitTest.java to throw exceptions with descriptions instead of just returning true or false. Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu> (cherry picked from commit deff842) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
… / removed (#3726) Backport deff842 from #3596. --------- Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Darshit Chanpura <dchanp@amazon.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Darshit Chanpura <dchanp@amazon.com>
Description
Changed validateMsgs in AbstractAuditlogUnitTest.java to throw exceptions with descriptions instead of just returning true or false. Not sure if the message format level validation in the integration tests is useful yet, so feel free to help me think about the usefullness of that.
Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)
Enhancement
Why these changes are required?
Previous version of the tests were unclear in what is erroring, can be hard for developers to debug.
What is the old behavior before changes and new behavior after changes?
validateMsgs and traceback previously returned boolean true or false values without any errors, now they throw Exceptions with specific descriptions of what went wrong.
Issues Resolved
#2188
Is this a backport? If so, please add backport PR # and/or commits #
Testing
Updated tests.
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.