Skip to content

Commit

Permalink
chore: Update deprecated tunnel configs (#948)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 authored Sep 10, 2024
1 parent a6a8bd1 commit f9ecfbd
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions internal/http/rdcservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ func (c *RDCService) StartJob(ctx context.Context, opts job.StartOptions) (jobID
TestsToSkip: opts.TestsToSkip,
DeviceQuery: c.deviceQuery(opts),
TestFramework: frameworkName,
TunnelName: opts.Tunnel.ID,
TunnelOwner: opts.Tunnel.Parent,
TunnelName: opts.Tunnel.Name,
TunnelOwner: opts.Tunnel.Owner,
UseTestOrchestrator: useTestOrchestrator,
Tags: opts.Tags,
Build: opts.Build,
Expand Down
8 changes: 4 additions & 4 deletions internal/http/webdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ type SauceOpts struct {
Batch Batch `json:"_batch,omitempty"`
IdleTimeout int `json:"idleTimeout,omitempty"`
MaxDuration int `json:"maxDuration,omitempty"`
TunnelIdentifier string `json:"tunnelIdentifier,omitempty"`
TunnelParent string `json:"parentTunnel,omitempty"` // note that 'parentTunnel` is backwards, because that's the way sauce likes it
TunnelName string `json:"tunnelName,omitempty"`
TunnelOwner string `json:"tunnelOwner,omitempty"`
ScreenResolution string `json:"screen_resolution,omitempty"`
UserAgent string `json:"user_agent,omitempty"`
TimeZone string `json:"timeZone,omitempty"`
Expand Down Expand Up @@ -136,8 +136,8 @@ func (c *Webdriver) StartJob(ctx context.Context, opts job.StartOptions) (jobID
PlatformVersion: opts.PlatformVersion,
SauceOptions: SauceOpts{
UserAgent: "saucectl/" + version.Version,
TunnelIdentifier: opts.Tunnel.ID,
TunnelParent: opts.Tunnel.Parent,
TunnelName: opts.Tunnel.Name,
TunnelOwner: opts.Tunnel.Owner,
ScreenResolution: opts.ScreenResolution,
TestName: opts.Name,
BuildName: opts.Build,
Expand Down
4 changes: 2 additions & 2 deletions internal/job/starter.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ type Instrumentation struct {

// TunnelOptions represents the options that configure the usage of a tunnel when running tests in the Sauce Labs cloud.
type TunnelOptions struct {
ID string `json:"id"`
Parent string `json:"parent,omitempty"`
Name string `json:"name"`
Owner string `json:"owner,omitempty"`
}

// SmartRetry represents the retry strategy.
Expand Down
2 changes: 1 addition & 1 deletion internal/saucecloud/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (r *CloudRunner) runJob(opts job.StartOptions) (j job.Job, skipped bool, er
log.Info().
Str("suite", opts.DisplayName).
Str("region", r.Region.String()).
Str("tunnel", opts.Tunnel.ID).
Str("tunnel", opts.Tunnel.Name).
Msg("Starting suite.")

id, _, err := r.JobService.StartJob(context.Background(), opts)
Expand Down
4 changes: 2 additions & 2 deletions internal/saucecloud/cucumber.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ func (r *CucumberRunner) runSuites(app string, otherApps []string) bool {
Build: r.Project.Sauce.Metadata.Build,
Tags: r.Project.Sauce.Metadata.Tags,
Tunnel: job.TunnelOptions{
ID: r.Project.Sauce.Tunnel.Name,
Parent: r.Project.Sauce.Tunnel.Owner,
Name: r.Project.Sauce.Tunnel.Name,
Owner: r.Project.Sauce.Tunnel.Owner,
},
ScreenResolution: s.ScreenResolution,
RunnerVersion: r.Project.RunnerVersion,
Expand Down
4 changes: 2 additions & 2 deletions internal/saucecloud/cypress.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ func (r *CypressRunner) runSuites(app string, otherApps []string) bool {
Build: r.Project.GetSauceCfg().Metadata.Build,
Tags: r.Project.GetSauceCfg().Metadata.Tags,
Tunnel: job.TunnelOptions{
ID: r.Project.GetSauceCfg().Tunnel.Name,
Parent: r.Project.GetSauceCfg().Tunnel.Owner,
Name: r.Project.GetSauceCfg().Tunnel.Name,
Owner: r.Project.GetSauceCfg().Tunnel.Owner,
},
ScreenResolution: s.ScreenResolution,
RunnerVersion: r.Project.GetRunnerVersion(),
Expand Down
4 changes: 2 additions & 2 deletions internal/saucecloud/espresso.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ func (r *EspressoRunner) startJob(jobOpts chan<- job.StartOptions, s espresso.Su
Build: r.Project.Sauce.Metadata.Build,
Tags: r.Project.Sauce.Metadata.Tags,
Tunnel: job.TunnelOptions{
ID: r.Project.Sauce.Tunnel.Name,
Parent: r.Project.Sauce.Tunnel.Owner,
Name: r.Project.Sauce.Tunnel.Name,
Owner: r.Project.Sauce.Tunnel.Owner,
},
Experiments: r.Project.Sauce.Experiments,
TestOptions: s.TestOptions,
Expand Down
4 changes: 2 additions & 2 deletions internal/saucecloud/playwright.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ func (r *PlaywrightRunner) runSuites(app string, otherApps []string) bool {
Build: r.Project.Sauce.Metadata.Build,
Tags: r.Project.Sauce.Metadata.Tags,
Tunnel: job.TunnelOptions{
ID: r.Project.Sauce.Tunnel.Name,
Parent: r.Project.Sauce.Tunnel.Owner,
Name: r.Project.Sauce.Tunnel.Name,
Owner: r.Project.Sauce.Tunnel.Owner,
},
ScreenResolution: s.ScreenResolution,
RunnerVersion: r.Project.RunnerVersion,
Expand Down
4 changes: 2 additions & 2 deletions internal/saucecloud/replay.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func (r *ReplayRunner) runSuites(fileURI string) bool {
Build: r.Project.Sauce.Metadata.Build,
Tags: r.Project.Sauce.Metadata.Tags,
Tunnel: job.TunnelOptions{
ID: r.Project.Sauce.Tunnel.Name,
Parent: r.Project.Sauce.Tunnel.Owner,
Name: r.Project.Sauce.Tunnel.Name,
Owner: r.Project.Sauce.Tunnel.Owner,
},
Experiments: r.Project.Sauce.Experiments,
Attempt: 0,
Expand Down
4 changes: 2 additions & 2 deletions internal/saucecloud/testcafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ func (r *TestcafeRunner) generateStartOpts(s testcafe.Suite) job.StartOptions {
Build: r.Project.Sauce.Metadata.Build,
Tags: r.Project.Sauce.Metadata.Tags,
Tunnel: job.TunnelOptions{
ID: r.Project.Sauce.Tunnel.Name,
Parent: r.Project.Sauce.Tunnel.Owner,
Name: r.Project.Sauce.Tunnel.Name,
Owner: r.Project.Sauce.Tunnel.Owner,
},
ScreenResolution: s.ScreenResolution,
RunnerVersion: r.Project.RunnerVersion,
Expand Down
4 changes: 2 additions & 2 deletions internal/saucecloud/xcuitest.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ func (r *XcuitestRunner) startJob(jobOpts chan<- job.StartOptions, appFileID, te
Build: r.Project.Sauce.Metadata.Build,
Tags: r.Project.Sauce.Metadata.Tags,
Tunnel: job.TunnelOptions{
ID: r.Project.Sauce.Tunnel.Name,
Parent: r.Project.Sauce.Tunnel.Owner,
Name: r.Project.Sauce.Tunnel.Name,
Owner: r.Project.Sauce.Tunnel.Owner,
},
Experiments: r.Project.Sauce.Experiments,
TestsToRun: s.TestOptions.Class,
Expand Down

0 comments on commit f9ecfbd

Please sign in to comment.