Skip to content

Commit

Permalink
Added fuzzers in chaos experiment (#4488)
Browse files Browse the repository at this point in the history
* Added fuzzers in chaos experiment

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

* fixed imports

Signed-off-by: Saranya-jena <saranya.jena@harness.io>

---------

Signed-off-by: Saranya-jena <saranya.jena@harness.io>
  • Loading branch information
Saranya-jena authored Mar 12, 2024
1 parent 9fbbef4 commit b1f08d4
Show file tree
Hide file tree
Showing 19 changed files with 421 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ extend type Mutation {
Updates the experiment
"""
updateChaosExperiment(
request: ChaosExperimentRequest
request: ChaosExperimentRequest!
projectID: ID!
): ChaosExperimentResponse!

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 7 additions & 15 deletions chaoscenter/graphql/server/graph/generated/generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ func (c *ChaosExperimentHandler) CreateChaosExperiment(ctx context.Context, requ
}

func (c *ChaosExperimentHandler) DeleteChaosExperiment(ctx context.Context, projectID string, workflowID string, workflowRunID *string, r *store.StateData) (bool, error) {

query := bson.D{
{"experiment_id", workflowID},
{"project_id", projectID},
Expand Down Expand Up @@ -232,7 +231,7 @@ func (c *ChaosExperimentHandler) DeleteChaosExperiment(ctx context.Context, proj
return true, nil
}

func (c *ChaosExperimentHandler) UpdateChaosExperiment(ctx context.Context, request *model.ChaosExperimentRequest, projectID string, r *store.StateData) (*model.ChaosExperimentResponse, error) {
func (c *ChaosExperimentHandler) UpdateChaosExperiment(ctx context.Context, request model.ChaosExperimentRequest, projectID string, r *store.StateData) (*model.ChaosExperimentResponse, error) {
var (
revID = uuid.New().String()
)
Expand All @@ -243,7 +242,7 @@ func (c *ChaosExperimentHandler) UpdateChaosExperiment(ctx context.Context, requ
return nil, err
}

newRequest, wfType, err := c.chaosExperimentService.ProcessExperiment(ctx, request, projectID, revID)
newRequest, wfType, err := c.chaosExperimentService.ProcessExperiment(ctx, &request, projectID, revID)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -971,6 +970,9 @@ func (c *ChaosExperimentHandler) getWfRunDetails(workflowIDs []string) (map[stri
}

func (c *ChaosExperimentHandler) DisableCronExperiment(username string, experiment dbChaosExperiment.ChaosExperimentRequest, projectID string, r *store.StateData) error {
if len(experiment.Revision) < 1 {
return fmt.Errorf("revision array is empty")
}
workflowManifest, err := sjson.Set(experiment.Revision[len(experiment.Revision)-1].ExperimentManifest, "spec.suspend", true)
if err != nil {
return err
Expand Down
Loading

0 comments on commit b1f08d4

Please sign in to comment.