Skip to content

Commit

Permalink
chore: Enhance Logging for Tunnel-Related Processes (#872)
Browse files Browse the repository at this point in the history
* chore: Enhance Logging for Tunnel-Related Processes

* Update internal/apitest/runner.go

Co-authored-by: Alex Plischke <[email protected]>

* shorten tunnel info

* shorten tunnel info

---------

Co-authored-by: Alex Plischke <[email protected]>
  • Loading branch information
tianfeng92 and Alex Plischke authored Jan 12, 2024
1 parent dc7b710 commit c95eb7b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions internal/apitest/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ func (r *Runner) runSuites() bool {
Str("projectName", suite.ProjectName).
Str("suite", suite.Name).
Bool("parallel", true).
Str("tunnel", r.Project.Sauce.Tunnel.Name).
Msg("Starting suite")

if s.UseRemoteTests {
Expand Down
6 changes: 5 additions & 1 deletion internal/saucecloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,11 @@ func (r *CloudRunner) getBuildURL(jobID string, isRDC bool) string {
}

func (r *CloudRunner) runJob(opts job.StartOptions) (j job.Job, skipped bool, err error) {
log.Info().Str("suite", opts.DisplayName).Str("region", r.Region.String()).Msg("Starting suite.")
log.Info().
Str("suite", opts.DisplayName).
Str("region", r.Region.String()).
Str("tunnel", opts.Tunnel.ID).
Msg("Starting suite.")

id, _, err := r.JobService.StartJob(context.Background(), opts)
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion internal/saucecloud/imagerunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ func (r *ImgRunner) runSuite(suite imagerunner.Suite) (imagerunner.Runner, error
return imagerunner.Runner{}, err
}

log.Info().Str("image", suite.Image).Str("suite", suite.Name).Msg("Starting suite.")
log.Info().
Str("image", suite.Image).
Str("suite", suite.Name).
Str("tunnel", r.Project.Sauce.Tunnel.Name).
Msg("Starting suite.")

if suite.Timeout <= 0 {
suite.Timeout = 24 * time.Hour
Expand Down
4 changes: 2 additions & 2 deletions internal/tunnel/tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ func ValidateTunnel(service Service, name string, owner string, filter Filter, d

// This wait value is deliberately not configurable.
wait := 30 * time.Second
log.Info().Str("timeout", wait.String()).Msg("Performing tunnel readiness check...")
log.Info().Str("timeout", wait.String()).Str("tunnel", name).Msg("Performing tunnel readiness check...")
if err := service.IsTunnelRunning(context.Background(), name, owner, filter, wait); err != nil {
return err
}

log.Info().Msg("Tunnel is ready!")
log.Info().Str("tunnel", name).Msg("Tunnel is ready!")
return nil
}

0 comments on commit c95eb7b

Please sign in to comment.