diff --git a/internal/acceptance/README.md b/internal/acceptance/README.md index 7317db9f0..243de7716 100644 --- a/internal/acceptance/README.md +++ b/internal/acceptance/README.md @@ -25,8 +25,11 @@ go run github.com/onsi/ginkgo/ginkgo ### Workflows These are written in Go and use [godog](https://github.com/cucumber/godog) (a Cucumber test framework). +> PS: Export GITHUB_TOKEN as an env var before running the acceptance tests + ```bash # from anywhere in the repo you can run: +export GITHUB_TOKEN="$(gh auth token)" go test -v --tags acceptance --timeout=1h github.com/pivotal-cf/kiln/internal/acceptance/workflows ``` diff --git a/internal/commands/update_release.go b/internal/commands/update_release.go index 003890f1a..d17a8445e 100644 --- a/internal/commands/update_release.go +++ b/internal/commands/update_release.go @@ -78,7 +78,6 @@ func (u UpdateRelease) Execute(args []string) error { StemcellOS: kilnfileLock.Stemcell.OS, GitHubRepository: releaseSpec.GitHubRepository, }, false) - if err != nil { if component.IsErrNotFound(err) { return fmt.Errorf("error finding the release: %w", err) @@ -99,7 +98,6 @@ func (u UpdateRelease) Execute(args []string) error { StemcellVersion: kilnfileLock.Stemcell.Version, GitHubRepository: releaseSpec.GitHubRepository, }) - if err != nil { if component.IsErrNotFound(err) { return fmt.Errorf("error finding the release: %w", err) diff --git a/internal/commands/update_stemcell.go b/internal/commands/update_stemcell.go index 128ec23f1..36992c79f 100644 --- a/internal/commands/update_stemcell.go +++ b/internal/commands/update_stemcell.go @@ -48,7 +48,6 @@ func (update UpdateStemcell) Execute(args []string) error { kilnStemcellVersion := kilnfile.Stemcell.Version releaseVersionConstraint, err = semver.NewConstraint(kilnStemcellVersion) - if err != nil { return fmt.Errorf("invalid stemcell constraint in kilnfile: %w", err) } diff --git a/internal/gh/uri.go b/internal/gh/uri.go index 5d558501b..9a0a4db93 100644 --- a/internal/gh/uri.go +++ b/internal/gh/uri.go @@ -20,7 +20,7 @@ func RepositoryHostOwnerAndNameFromPath(urlStr string) (string, string, string, return fmt.Errorf("failed to parse owner and repo name from URI %q: %w", urlStr, err) } if strings.HasPrefix(urlStr, "git@") { - exp := regexp.MustCompile(`git@(?P.*):(?P[^/]+)/(?P.+)\.git`) + exp := regexp.MustCompile(`git@(?P.+):(?P[^/]+)/(?P.+)(\.git)?`) m := exp.FindStringSubmatch(urlStr) if m == nil { return "", "", "", fmt.Errorf("path missing expected parts") diff --git a/pkg/cargo/kilnfile.go b/pkg/cargo/kilnfile.go index dc9212a72..c3d6ad3b6 100644 --- a/pkg/cargo/kilnfile.go +++ b/pkg/cargo/kilnfile.go @@ -4,9 +4,10 @@ import ( "context" "errors" "fmt" + "strings" + "github.com/google/go-github/v50/github" "golang.org/x/oauth2" - "strings" "gopkg.in/yaml.v3" diff --git a/pkg/planitest/internal/config.go b/pkg/planitest/internal/config.go index 7e5b40463..4c3bb5cd6 100644 --- a/pkg/planitest/internal/config.go +++ b/pkg/planitest/internal/config.go @@ -43,7 +43,6 @@ func MergeAdditionalProductProperties(configFile io.Reader, additionalProperties var inputConfig ProductConfiguration err = yaml.Unmarshal(yamlInput, &inputConfig) - if err != nil { return nil, fmt.Errorf("could not parse config file: %s", err) } diff --git a/pkg/planitest/internal/om_runner.go b/pkg/planitest/internal/om_runner.go index 40fc80249..906bcb8be 100644 --- a/pkg/planitest/internal/om_runner.go +++ b/pkg/planitest/internal/om_runner.go @@ -89,7 +89,6 @@ func (o OMRunner) ResetAndConfigure(productName string, productVersion string, c "--product-name", productName, "--product-version", productVersion, ) - if err != nil { return fmt.Errorf("Unable to stage product %q, version %q: %s: %s", productName, productVersion, err, errOutput) @@ -114,7 +113,6 @@ func (o OMRunner) ResetAndConfigure(productName string, productVersion string, c "configure-product", "--config", configFile.Name(), ) - if err != nil { return fmt.Errorf("Unable to configure product %q: %s: %s", productName, err, errOutput) }