litmuschaos / litmus

Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
https://litmuschaos.io
Apache License 2.0
4.39k stars 688 forks source link

Add operator interface for Probe pkg #4849

Open sukkyun2 opened 1 month ago

sukkyun2 commented 1 month ago

Proposed changes

This PR adds operator interface to probe pkg

4836, I tried to add fuzz test for probe handler.

However, the current architecture made it impossible to mock probe operations, so I added probe operator interface.

This picture is about probe pkg.

image

References

Types of changes

What types of changes does your code introduce to Litmus? Put an x in the boxes that apply

Checklist

Put an x in 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

Special notes for your reviewer:

I need feedback on the approach of passing probeOperator as a parameter to functions.

For example, the function GenerateExperimentManifestWithProbes in chaoscenter/graphql/server/pkg/probe/utils/utils.go directly accesses probe operation. I have added the probeOperator dependency to the handler that uses GenerateExperimentManifestWithProbes and updated the function calls to pass probeOperator as a parameter.

namkyu1999 commented 3 weeks ago

can you check a build-pipeline? @sukkyun2