test: add fuzz tests for chaos experiment run MongoDB operator#5545
Open
jaehyyuun wants to merge 2 commits into
Open
test: add fuzz tests for chaos experiment run MongoDB operator#5545jaehyyuun wants to merge 2 commits into
jaehyyuun wants to merge 2 commits into
Conversation
Signed-off-by: jaehyun jeong <jaehyunj393@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Go fuzz tests to improve robustness coverage for the MongoDB chaos experiment run operator layer (operations.go) by exercising its public CRUD/query methods with arbitrary inputs using the existing AdaLogics fuzzing pattern already present in the repo.
Changes:
- Introduces
operator_fuzz_test.gowith fuzz targets for the chaos experiment run MongoDB operator methods. - Mocks the MongoDB operator calls to keep fuzz targets deterministic and focused on “no panic” behavior for malformed inputs.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed changes
Fixes #5544
Add fuzz tests for MongoDB operator functions in the chaos experiment run package.
The following functions in
chaoscenter/graphql/server/pkg/database/mongodb/chaos_experiment_run/operations.goare covered:CreateExperimentRunGetExperimentRunGetExperimentRunsUpdateExperimentRunUpdateExperimentRunWithQueryUpdateExperimentRunsWithQueryGetExperimentRunsByInfraIDGetAggregateExperimentRunsTypes of changes
What types of changes does your code introduce to Litmus? Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Dependency
None
Special notes for your reviewer:
Fuzz tests follow the existing patterns in:
chaoscenter/graphql/server/pkg/chaos_experiment_run/handler/fuzz_tests/handler_fuzz_test.gochaoscenter/graphql/server/pkg/chaos_experiment_run/fuzz_tests/service_fuzz_test.goTo verify the tests pass:
To run a specific fuzz target: