From 0718693ff7f084ae4eccb8a1c7f15c906cc82162 Mon Sep 17 00:00:00 2001 From: Onsi Fakhouri Date: Fri, 17 Feb 2023 14:34:36 -0700 Subject: [PATCH] remove tools.go hack from documentation --- docs/index.md | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/docs/index.md b/docs/index.md index b6e6f2576..450db69fc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -53,19 +53,17 @@ You should now be able to run `ginkgo version` at the command line and see the G To upgrade Ginkgo run: ```bash -go get github.com/onsi/ginkgo/v2/ginkgo +go get github.com/onsi/ginkgo/v2 go install github.com/onsi/ginkgo/v2/ginkgo ``` To pick a particular version: ```bash -go get github.com/onsi/ginkgo/v2/ginkgo@v2.m.p +go get github.com/onsi/ginkgo/v2@v2.m.p go install github.com/onsi/ginkgo/v2/ginkgo ``` -Note that in both cases we `go get` the `/v2/ginkgo` subpackage. This pulls in the CLI and its dependencies. If you only `go get github.com/onsi/ginkgo/v2` you may experience issues installing the cli - if you do simply run `go get github.com/onsi/ginkgo/v2/ginkgo` to fetch the missing dependencies. - ### Support Policy Ginkgo adheres to semantic versioning - the intent is for there to be no breaking changes along the `2.m.p` line with new functionality landing as minor releases and bug-fixes landing as patch releases (fixes are never back-ported). We work hard to maintain this policy however exceptions (while rare and typically minor) are possible, especially for brand new/emerging features. @@ -3510,21 +3508,6 @@ When running in CI you must make sure that the version of the `ginkgo` CLI you a `go run github.com/onsi/ginkgo/v2/ginkgo` -This alone, however, is often not enough. The Ginkgo CLI includes additional dependencies that aren't part of the Ginkgo library - since your code doesn't import the cli these dependencies probably aren't in your `go.sum` file. To get around this it is idiomatic Go to introduce a `tools.go` file. This can go anywhere in your module - for example, Gomega places its `tools.go` at the top-level. Your `tools.go` file should look like: - -```go -//go:build tools -// +build tools - -package main - -import ( - _ "github.com/onsi/ginkgo/v2/ginkgo" -) -``` - -The `//go:build tools` constraint ensures this code is never actually built, however the `_ "github.com/onsi/ginkgo/v2/ginkgo` import statement is enough to convince `go mod` to include the Ginkgo CLI dependencies in your `go.sum` file. - Once you have `ginkgo` running on CI, you'll want to pick and choose the optimal set of flags for your test runs. We recommend the following set of flags when running in a continuous integration environment: ```bash