Skip to content
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

Merged

Conversation

prabhask5
Copy link
Contributor

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

  • New functionality includes testing
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

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.

@prabhask5 prabhask5 changed the title Pk fix auditvalidation in tests [Feature-2188] AuditMessage validation in tests should be more useful / removed Oct 25, 2023
Copy link
Member

@DarshitChanpura DarshitChanpura left a 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.

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>
@prabhask5 prabhask5 force-pushed the pk-fix-auditvalidation-in-tests branch from 429cace to 016759d Compare October 26, 2023 02:31
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
@prabhask5
Copy link
Contributor Author

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

Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
@prabhask5 prabhask5 requested a review from peternied October 28, 2023 23:44
peternied
peternied previously approved these changes Nov 8, 2023
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
Copy link
Contributor

@stephen-crawford stephen-crawford left a 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

@peternied
Copy link
Member

@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>
@prabhask5
Copy link
Contributor Author

@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!

@peternied peternied merged commit deff842 into opensearch-project:main Nov 16, 2023
@peternied peternied added the backport 2.x backport to 2.x branch label Nov 16, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 16, 2023
… / 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>
cwperks pushed a commit that referenced this pull request Dec 13, 2023
… / 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>
@prabhask5 prabhask5 deleted the pk-fix-auditvalidation-in-tests branch July 10, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants