From 75f0f395619a5520c3fcc4f6379096290b7fb7dc Mon Sep 17 00:00:00 2001 From: Oscar Reyes Date: Wed, 3 Jul 2024 13:13:45 -0500 Subject: [PATCH] cleanup --- agent/workers/trigger.go | 5 ----- agent/workers/trigger/playwrightengine.go | 3 --- cli/cmd/resource_run_cmd.go | 1 - cli/config/config.go | 16 ++++++++-------- cli/pkg/oauth/oauth.go | 2 +- 5 files changed, 9 insertions(+), 18 deletions(-) diff --git a/agent/workers/trigger.go b/agent/workers/trigger.go index 18701cef5c..7b2f8e4c73 100644 --- a/agent/workers/trigger.go +++ b/agent/workers/trigger.go @@ -4,7 +4,6 @@ import ( "context" "fmt" - "github.com/davecgh/go-spew/spew" "github.com/kubeshop/tracetest/agent/telemetry" "github.com/kubeshop/tracetest/agent/client" @@ -161,10 +160,8 @@ func (w *TriggerWorker) Trigger(ctx context.Context, request *proto.TriggerReque func (w *TriggerWorker) trigger(ctx context.Context, triggerRequest *proto.TriggerRequest) error { triggerConfig := convertProtoToTrigger(triggerRequest.Trigger) w.logger.Debug("Triggering test", zap.Any("triggerConfig", triggerConfig)) - spew.Dump(triggerConfig.Type) triggerer, err := w.registry.Get(triggerConfig.Type) if err != nil { - spew.Dump(err) w.logger.Error("Could not get triggerer", zap.Error(err)) return err } @@ -210,8 +207,6 @@ func (w *TriggerWorker) trigger(ctx context.Context, triggerRequest *proto.Trigg } func convertProtoToTrigger(pt *proto.Trigger) trigger.Trigger { - spew.Dump(pt) - return trigger.Trigger{ Type: trigger.TriggerType(pt.Type), HTTP: convertProtoHttpTriggerToHttpTrigger(pt.Http), diff --git a/agent/workers/trigger/playwrightengine.go b/agent/workers/trigger/playwrightengine.go index d7afd94c67..31edb5c71c 100644 --- a/agent/workers/trigger/playwrightengine.go +++ b/agent/workers/trigger/playwrightengine.go @@ -7,8 +7,6 @@ import ( "os" "os/exec" "path/filepath" - - "github.com/davecgh/go-spew/spew" ) var ( @@ -25,7 +23,6 @@ func PLAYWRIGHTENGINE() Triggerer { type playwrightTriggerer struct{} func (te *playwrightTriggerer) Trigger(ctx context.Context, triggerConfig Trigger, opts *Options) (Response, error) { - spew.Dump(triggerConfig, opts) response := Response{ Result: TriggerResult{ Type: te.Type(), diff --git a/cli/cmd/resource_run_cmd.go b/cli/cmd/resource_run_cmd.go index 60f2234055..cdf0d2be3c 100644 --- a/cli/cmd/resource_run_cmd.go +++ b/cli/cmd/resource_run_cmd.go @@ -109,7 +109,6 @@ func runMultipleFiles(ctx context.Context) (string, error) { } exitCode, err := cloudCmd.RunMultipleFiles(ctx, httpClient, runParams, &cliConfig, runnerRegistry, output) - fmt.Println("exitCode", exitCode, err) ExitCLI(exitCode) return "", err } diff --git a/cli/config/config.go b/cli/config/config.go index f25e3fd49e..57ae20e15c 100644 --- a/cli/config/config.go +++ b/cli/config/config.go @@ -66,16 +66,16 @@ func (c Config) UI() string { } func (c Config) Path() string { - // pathPrefix := "/api" - // if c.ServerPath != "" { - // pathPrefix = c.ServerPath - // } + pathPrefix := "/api" + if c.ServerPath != "" { + pathPrefix = c.ServerPath + } - // if pathPrefix == "/" { - // return "" - // } + if pathPrefix == "/" { + return "" + } - return "" + return pathPrefix } func (c Config) IsEmpty() bool { diff --git a/cli/pkg/oauth/oauth.go b/cli/pkg/oauth/oauth.go index 46d923dfb2..afb148a82f 100644 --- a/cli/pkg/oauth/oauth.go +++ b/cli/pkg/oauth/oauth.go @@ -58,7 +58,7 @@ func (s *OAuthServer) GetAuthJWT() error { return fmt.Errorf("failed to start oauth server: %w", err) } - loginUrl := fmt.Sprintf("%s/oauth?callback=%s", s.frontendEndpoint, url) + loginUrl := fmt.Sprintf("%soauth?callback=%s", s.frontendEndpoint, url) ui := ui.DefaultUI err = ui.OpenBrowser(loginUrl)