Skip to content

Commit

Permalink
feat!: drop support for cypress v1alpha (#925)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexplischke authored Jul 15, 2024
1 parent e3a6079 commit 9b173b0
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 2,054 deletions.
15 changes: 0 additions & 15 deletions api/global.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@
}
},
"allOf": [
{
"if": {
"properties": {
"kind": {
"const": "cypress"
},
"apiVersion": {
"const": "v1alpha"
}
}
},
"then": {
"$ref": "v1alpha/framework/cypress.schema.json"
}
},
{
"if": {
"properties": {
Expand Down
859 changes: 324 additions & 535 deletions api/saucectl.schema.json

Large diffs are not rendered by default.

199 changes: 0 additions & 199 deletions api/v1alpha/framework/cypress.schema.json

This file was deleted.

44 changes: 0 additions & 44 deletions internal/cmd/ini/cypress.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ import (
_ "embed"
"fmt"
"os"
"strconv"
"strings"

"github.com/rs/zerolog/log"
cmds "github.com/saucelabs/saucectl/internal/cmd"
"github.com/saucelabs/saucectl/internal/config"
"github.com/saucelabs/saucectl/internal/cypress"
v1 "github.com/saucelabs/saucectl/internal/cypress/v1"
"github.com/saucelabs/saucectl/internal/cypress/v1alpha"
"github.com/saucelabs/saucectl/internal/segment"
"github.com/saucelabs/saucectl/internal/usage"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -59,47 +56,6 @@ func CypressCmd() *cobra.Command {
}

func configureCypress(cfg *initConfig) interface{} {
versions := strings.Split(cfg.frameworkVersion, ".")
version, err := strconv.Atoi(versions[0])
if err != nil {
log.Err(err).Msg("failed to parse framework version")
}
if version < 10 {
return v1alpha.Project{
TypeDef: config.TypeDef{
APIVersion: v1alpha.APIVersion,
Kind: cypress.Kind,
},
Sauce: config.SauceConfig{
Region: cfg.region,
Sauceignore: ".sauceignore",
Concurrency: cfg.concurrency,
},
RootDir: ".",
Cypress: v1alpha.Cypress{
Version: cfg.frameworkVersion,
ConfigFile: cfg.cypressConfigFile,
},
Suites: []v1alpha.Suite{
{
Name: fmt.Sprintf("cypress - %s - %s", cfg.platformName, cfg.browserName),
PlatformName: cfg.platformName,
Browser: cfg.browserName,
Config: v1alpha.SuiteConfig{
TestFiles: []string{"**/*.*"},
},
},
},
Artifacts: config.Artifacts{
Download: config.ArtifactDownload{
When: cfg.artifactWhen,
Directory: "./artifacts",
Match: []string{"*"},
},
},
}
}

return v1.Project{
TypeDef: config.TypeDef{
APIVersion: v1.APIVersion,
Expand Down
7 changes: 4 additions & 3 deletions internal/cypress/config.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package cypress

import (
"errors"

"github.com/saucelabs/saucectl/internal/config"
"github.com/saucelabs/saucectl/internal/cypress/suite"
v1 "github.com/saucelabs/saucectl/internal/cypress/v1"
"github.com/saucelabs/saucectl/internal/cypress/v1alpha"
"github.com/saucelabs/saucectl/internal/saucereport"
)

Expand Down Expand Up @@ -67,8 +68,8 @@ func FromFile(cfgPath string) (Project, error) {
if err != nil {
return nil, err
}
if version == v1alpha.APIVersion {
return v1alpha.FromFile(cfgPath)
if version == "v1alpha" {
return nil, errors.New("cypress v1alpha is no longer supported")
}
return v1.FromFile(cfgPath)
}
Loading

0 comments on commit 9b173b0

Please sign in to comment.