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/[email protected]/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/[email protected]
../../../../../go/pkg/mod/github.com/onsi/ginkgo/[email protected]/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/[email protected]
../../../../../go/pkg/mod/github.com/onsi/ginkgo/[email protected]/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/[email protected]

... which did NOT upate the cli version

Referring to the above output:

go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]

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/[email protected]

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/[email protected]/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/[email protected]
../../../../../go/pkg/mod/github.com/onsi/ginkgo/[email protected]/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/[email protected]
../../../../../go/pkg/mod/github.com/onsi/ginkgo/[email protected]/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/[email protected]

so I tried the 3 commands in the output:

go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected]

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/[email protected]
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