Skip to content

Commit

Permalink
chore: [#4362]: Fixed experiment run execution even if runExperiment …
Browse files Browse the repository at this point in the history
…is disabled (#4496)

* chore: [#4362]: Fixed experiment run execution even if runExperiment is disabled

Signed-off-by: Amit Kumar Das <[email protected]>

* fixed test case

Signed-off-by: Amit Kumar Das <[email protected]>

---------

Signed-off-by: Amit Kumar Das <[email protected]>
  • Loading branch information
amityt authored Apr 4, 2024
1 parent 12d2595 commit 1577937
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.

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 @@ -159,7 +159,7 @@ func (c *ChaosExperimentHandler) SaveChaosExperiment(ctx context.Context, reques
return "experiment saved successfully", nil
}

func (c *ChaosExperimentHandler) CreateChaosExperiment(ctx context.Context, request *model.ChaosExperimentRequest, projectID string, r *store.StateData) (*model.ChaosExperimentResponse, error) {
func (c *ChaosExperimentHandler) CreateChaosExperiment(ctx context.Context, request *model.ChaosExperimentRequest, projectID string) (*model.ChaosExperimentResponse, error) {

var revID = uuid.New().String()

Expand All @@ -182,7 +182,7 @@ func (c *ChaosExperimentHandler) CreateChaosExperiment(ctx context.Context, requ

tkn := ctx.Value(authorization.AuthKey).(string)
uid, err := authorization.GetUsername(tkn)
err = c.chaosExperimentService.ProcessExperimentCreation(context.TODO(), newRequest, uid, projectID, wfType, revID, r)
err = c.chaosExperimentService.ProcessExperimentCreation(context.TODO(), newRequest, uid, projectID, wfType, revID, nil)
if err != nil {
return nil, err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func TestChaosExperimentHandler_CreateChaosExperiment(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
mockServices := NewMockServices()
got, err := mockServices.ChaosExperimentHandler.CreateChaosExperiment(tt.args.ctx, tt.args.request, tt.args.projectID, tt.args.r)
got, err := mockServices.ChaosExperimentHandler.CreateChaosExperiment(tt.args.ctx, tt.args.request, tt.args.projectID)
if (err != nil) != tt.wantErr {
t.Errorf("ChaosExperimentHandler.CreateChaosExperiment() error = %v, wantErr %v", err, tt.wantErr)
return
Expand Down

0 comments on commit 1577937

Please sign in to comment.