Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please update the documentation to include clearer instructions on upgrading the ginkgo cli #1129

Closed
plastikfan opened this issue Jan 31, 2023 · 2 comments

Comments

@plastikfan
Copy link

plastikfan commented Jan 31, 2023

The referenced documentation does not explicitly say how to upgrade an existing ginkgo cli install, it just mentions that the cli version should be kept up to date with the package version (in go.mod). So its not explicit enough and can therefore be interpreted various ways.

So does this mean, use:

  • go get ?
  • 'go install` ?
  • use both ?
  • and do you need to specify the version number?

I already have version 2.6.1 of the cli installed, but my package version is 2.7.0, so I'm simply trying to upgrade the cli to 2.7.


❌ When I tried this:

go install github.com/onsi/ginkgo/v2/ginkgo

resulted in:

 plastikfan@Janus  ~/dev/github/go/snivilised/extendio λ   feat/create-resume-spawner ±  go install github.com/onsi/ginkgo/v2/ginkgo
../../../../../go/pkg/mod/github.com/onsi/ginkgo/v2@v2.7.0/ginkgo/generators/bootstrap_command.go:10:2: missing go.sum entry for module providing package github.com/go-task/slim-sprig (imported by github.com/onsi/ginkgo/v2/ginkgo/generators); to add:
        go get github.com/onsi/ginkgo/v2/ginkgo/generators@v2.7.0
../../../../../go/pkg/mod/github.com/onsi/ginkgo/v2@v2.7.0/ginkgo/internal/profiles_and_reports.go:12:2: missing go.sum entry for module providing package github.com/google/pprof/profile (imported by github.com/onsi/ginkgo/v2/ginkgo/internal); to add:
        go get github.com/onsi/ginkgo/v2/ginkgo/internal@v2.7.0
../../../../../go/pkg/mod/github.com/onsi/ginkgo/v2@v2.7.0/ginkgo/labels/labels_command.go:15:2: missing go.sum entry for module providing package golang.org/x/tools/go/ast/inspector (imported by github.com/onsi/ginkgo/v2/ginkgo/labels); to add:
        go get github.com/onsi/ginkgo/v2/ginkgo/labels@v2.7.0

... which did NOT upate the cli version

Referring to the above output:

go get github.com/onsi/ginkgo/v2/ginkgo/labels@v2.7.0

I tried that, which again, did NOT update the Cli.


❌ Next I tried:

go get github.com/onsi/ginkgo/v2/ginkgo

... resulting in:

go: downloading github.com/onsi/ginkgo v1.16.5
go: downloading github.com/onsi/ginkgo/v2 v2.8.0
go: upgraded github.com/onsi/ginkgo/v2 v2.7.0 => v2.8.0
go: upgraded golang.org/x/tools v0.4.0 => v0.5.0

which still didnt upate the cli, but just upgraded the package version to 2.8 and left the cli at 2.6.1, and made an aweful mess of my project.


❌ Next I tried:

go get github.com/onsi/ginkgo/v2@v2.7.0

which did NOT upgrade the Cli.


❌ Finally following the instructions here:

Ginkgo detected a version mismatch between the Ginkgo CLI and the version of Ginkgo imported by your packages:
  Ginkgo CLI Version:
    2.6.1
  Mismatched package versions found:
    2.7.0 used by collections, nav, utils

  Ginkgo will continue to attempt to run but you may see errors (including flag
  parsing errors) and should either update your go.mod or your version of the
  Ginkgo CLI to match.

  To install the matching version of the CLI run
    go install github.com/onsi/ginkgo/v2/ginkgo
  from a path that contains a go.mod file.  Alternatively you can use
    go run github.com/onsi/ginkgo/v2/ginkgo
  from a path that contains a go.mod file to invoke the matching version of the
  Ginkgo CLI.

  If you are attempting to test multiple packages that each have a different
  version of the Ginkgo library with a single Ginkgo CLI that is currently
  unsupported.

did not help:

 plastikfan@Janus  ~/dev/github/go/snivilised/extendio λ   feat/create-resume-spawner ±  go install github.com/onsi/ginkgo/v2/ginkgo
../../../../../go/pkg/mod/github.com/onsi/ginkgo/v2@v2.7.0/ginkgo/generators/bootstrap_command.go:10:2: missing go.sum entry for module providing package github.com/go-task/slim-sprig (imported by github.com/onsi/ginkgo/v2/ginkgo/generators); to add:
        go get github.com/onsi/ginkgo/v2/ginkgo/generators@v2.7.0
../../../../../go/pkg/mod/github.com/onsi/ginkgo/v2@v2.7.0/ginkgo/internal/profiles_and_reports.go:12:2: missing go.sum entry for module providing package github.com/google/pprof/profile (imported by github.com/onsi/ginkgo/v2/ginkgo/internal); to add:
        go get github.com/onsi/ginkgo/v2/ginkgo/internal@v2.7.0
../../../../../go/pkg/mod/github.com/onsi/ginkgo/v2@v2.7.0/ginkgo/labels/labels_command.go:15:2: missing go.sum entry for module providing package golang.org/x/tools/go/ast/inspector (imported by github.com/onsi/ginkgo/v2/ginkgo/labels); to add:
        go get github.com/onsi/ginkgo/v2/ginkgo/labels@v2.7.0

so I tried the 3 commands in the output:

go get github.com/onsi/ginkgo/v2/ginkgo/generators@v2.7.0
go get github.com/onsi/ginkgo/v2/ginkgo/internal@v2.7.0
go get github.com/onsi/ginkgo/v2/ginkgo/labels@v2.7.0

still did not upgrade the Cli.


Now, I have successfully upgraded the cli in the past, but I have since forgotten how to do this, (my bad, I admit),_ but really it would be nice if this is documented, so that users don't have to guess what to do. The golang docs for upgrading cli packages seems to be lacking in this area (it probably is there somewhere, but the proverbial needle in haystack comes to mind).

Please, in the short term, can you simply give me the correct command to upgrade the cli, thanks.

@onsi
Copy link
Owner

onsi commented Jan 31, 2023

Ugh that sucks. Sorry about that - I'll update the docs with much clearer instructions but to unblock you:

go get github.com/onsi/ginkgo/v2/ginkgo@v2.7.0
go install github.com/onsi/ginkgo/v2/ginkgo

should do it for you. the first line tells go to fetch all the dependencies for the v2.7.0 cli. the second installs the cli.

if you don't include the version number in the first line go will think you are trying to upgrade to the latest version of ginkgo (which is why picked up v2.8.0)

@plastikfan
Copy link
Author

Bingo, that works a treat! thanks

@onsi onsi closed this as completed in 833a75e Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants