Skip to content

Commit

Permalink
fix: should respect --runner-version flag (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
tianfeng92 authored Oct 11, 2024
1 parent 2c1e00f commit 829f8d5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion internal/saucecloud/cucumber.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@ func (r *CucumberRunner) RunProject() (int, error) {
// The framework version might be set to `package.json`.
func (r *CucumberRunner) setVersions(m framework.Metadata) {
r.Project.Playwright.Version = m.FrameworkVersion
r.Project.RunnerVersion = m.CloudRunnerVersion
// RunnerVersion can be set via `--runner-version`.
// If not provided, it uses the fetched framework runner version.
if r.Project.RunnerVersion == "" {
r.Project.RunnerVersion = m.CloudRunnerVersion
}
}

func (r *CucumberRunner) validateFramework(m framework.Metadata) error {
Expand Down
6 changes: 5 additions & 1 deletion internal/saucecloud/cypress.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ func (r *CypressRunner) setNodeRuntime(m framework.Metadata) error {
// The framework version might be set to `package.json`.
func (r *CypressRunner) setVersions(m framework.Metadata) {
r.Project.SetVersion(m.FrameworkVersion)
r.Project.SetRunnerVersion(m.CloudRunnerVersion)
// RunnerVersion can be set via `--runner-version`.
// If not provided, it uses the fetched framework runner version.
if r.Project.GetRunnerVersion() == "" {
r.Project.SetRunnerVersion(m.CloudRunnerVersion)
}
}

func (r *CypressRunner) validateFramework(m framework.Metadata) error {
Expand Down
6 changes: 5 additions & 1 deletion internal/saucecloud/playwright.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ func (r *PlaywrightRunner) setNodeRuntime(m framework.Metadata) error {
// The framework version might be set to `package.json`.
func (r *PlaywrightRunner) setVersions(m framework.Metadata) {
r.Project.Playwright.Version = m.FrameworkVersion
r.Project.RunnerVersion = m.CloudRunnerVersion
// RunnerVersion can be set via `--runner-version`.
// If not provided, it uses the fetched framework runner version.
if r.Project.RunnerVersion == "" {
r.Project.RunnerVersion = m.CloudRunnerVersion
}
}

func (r *PlaywrightRunner) validateFramework(m framework.Metadata) error {
Expand Down
6 changes: 5 additions & 1 deletion internal/saucecloud/testcafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ func (r *TestcafeRunner) setNodeRuntime(m framework.Metadata) error {
// The framework version might be set to `package.json`.
func (r *TestcafeRunner) setVersions(m framework.Metadata) {
r.Project.Testcafe.Version = m.FrameworkVersion
r.Project.RunnerVersion = m.CloudRunnerVersion
// RunnerVersion can be set via `--runner-version`.
// If not provided, it uses the fetched framework runner version.
if r.Project.RunnerVersion == "" {
r.Project.RunnerVersion = m.CloudRunnerVersion
}
}

func (r *TestcafeRunner) validateFramework(m framework.Metadata) error {
Expand Down

0 comments on commit 829f8d5

Please sign in to comment.