From 02d4261f72e6b7f81c67baf919ccc72f4ab5a07b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 18:29:56 +0000 Subject: [PATCH] fix(deps): update module github.com/onsi/ginkgo/v2 to v2.23.2 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- common/go.mod | 2 +- common/go.sum | 4 ++-- common/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md | 12 ++++++++++++ .../onsi/ginkgo/v2/ginkgo/command/command.go | 2 +- .../onsi/ginkgo/v2/ginkgo/internal/compile.go | 8 ++++---- .../onsi/ginkgo/v2/ginkgo/run/run_command.go | 2 +- .../onsi/ginkgo/v2/ginkgo/watch/watch_command.go | 2 +- .../vendor/github.com/onsi/ginkgo/v2/types/config.go | 10 +++++++++- .../vendor/github.com/onsi/ginkgo/v2/types/errors.go | 7 +++++++ .../github.com/onsi/ginkgo/v2/types/version.go | 2 +- common/vendor/modules.txt | 2 +- 11 files changed, 40 insertions(+), 13 deletions(-) diff --git a/common/go.mod b/common/go.mod index a838d05f60..56587476ad 100644 --- a/common/go.mod +++ b/common/go.mod @@ -26,7 +26,7 @@ require ( github.com/jinzhu/copier v0.4.0 github.com/json-iterator/go v1.1.12 github.com/moby/sys/capability v0.4.0 - github.com/onsi/ginkgo/v2 v2.23.1 + github.com/onsi/ginkgo/v2 v2.23.2 github.com/onsi/gomega v1.36.2 github.com/opencontainers/cgroups v0.0.1 github.com/opencontainers/go-digest v1.0.0 diff --git a/common/go.sum b/common/go.sum index 8dd25c15ec..4a1dd1e848 100644 --- a/common/go.sum +++ b/common/go.sum @@ -248,8 +248,8 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/onsi/ginkgo/v2 v2.23.1 h1:Ox0cOPv/t8RzKJUfDo9ZKtRvBOJY369sFJnl00CjqwY= -github.com/onsi/ginkgo/v2 v2.23.1/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM= +github.com/onsi/ginkgo/v2 v2.23.2 h1:LYLd7Wz401p0N7xR8y7WL6D2QZwKpbirDg0EVIvzvMM= +github.com/onsi/ginkgo/v2 v2.23.2/go.mod h1:zXTP6xIp3U8aVuXN8ENK9IXRaTjFnpVB9mGmaSRvxnM= github.com/onsi/gomega v1.36.2 h1:koNYke6TVk6ZmnyHrCXba/T/MoLBXFjeC1PtvYgw0A8= github.com/onsi/gomega v1.36.2/go.mod h1:DdwyADRjrc825LhMEkD76cHR5+pUnjhUN8GlHlRPHzY= github.com/opencontainers/cgroups v0.0.1 h1:MXjMkkFpKv6kpuirUa4USFBas573sSAY082B4CiHEVA= diff --git a/common/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md b/common/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md index 50af9d0baa..056dba6ef4 100644 --- a/common/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md +++ b/common/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md @@ -1,3 +1,15 @@ +## 2.23.2 + +🎉🎉🎉 + +At long last, some long-standing performance gaps between `ginkgo` and `go test` have been resolved! + +Ginkgo operates by running `go test -c` to generate test binaries, and then running those binaries. It turns out that the compilation step of `go test -c` is slower than `go test`'s compilation step because `go test` strips out debug symbols (`ldflags=-w`) whereas `go test -c` does not. + +Ginkgo now passes the appropriate `ldflags` to `go test -c` when running specs to strip out symbols. This is only done when it is safe to do so and symbols are preferred when profiling is enabled and when `ginkgo build` is called explicitly. + +This, coupled, with the [instructions for disabling XProtect on MacOS](https://onsi.github.io/ginkgo/#if-you-are-running-on-macos) yields a much better performance experience with Ginkgo. + ## 2.23.1 ## 🚨 For users on MacOS 🚨 diff --git a/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/command.go b/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/command.go index a9cf9fcb2c..12d4a32c87 100644 --- a/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/command.go +++ b/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/command.go @@ -26,7 +26,7 @@ func (c Command) Run(args []string, additionalArgs []string) { } for _, arg := range args { if strings.HasPrefix(arg, "-") { - AbortWith("Malformed arguments - make sure all flags appear {{bold}}after{{/}} the Ginkgo subcommand and {{bold}}before{{/}} your list of packages.\n{{gray}}e.g. 'ginkgo run -p my_package' is valid `ginkgo -p run my_package` is not.{{/}}") + AbortWith(types.GinkgoErrors.FlagAfterPositionalParameter().Error()) } } c.Command(args, additionalArgs) diff --git a/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/compile.go b/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/compile.go index 48827cc5ef..7bbe6be0fc 100644 --- a/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/compile.go +++ b/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/compile.go @@ -11,7 +11,7 @@ import ( "github.com/onsi/ginkgo/v2/types" ) -func CompileSuite(suite TestSuite, goFlagsConfig types.GoFlagsConfig) TestSuite { +func CompileSuite(suite TestSuite, goFlagsConfig types.GoFlagsConfig, preserveSymbols bool) TestSuite { if suite.PathToCompiledTest != "" { return suite } @@ -46,7 +46,7 @@ func CompileSuite(suite TestSuite, goFlagsConfig types.GoFlagsConfig) TestSuite suite.CompilationError = fmt.Errorf("Failed to get relative path from package to the current working directory:\n%s", err.Error()) return suite } - args, err := types.GenerateGoTestCompileArgs(goFlagsConfig, "./", pathToInvocationPath) + args, err := types.GenerateGoTestCompileArgs(goFlagsConfig, "./", pathToInvocationPath, preserveSymbols) if err != nil { suite.State = TestSuiteStateFailedToCompile suite.CompilationError = fmt.Errorf("Failed to generate go test compile flags:\n%s", err.Error()) @@ -120,7 +120,7 @@ func NewOrderedParallelCompiler(numCompilers int) *OrderedParallelCompiler { } } -func (opc *OrderedParallelCompiler) StartCompiling(suites TestSuites, goFlagsConfig types.GoFlagsConfig) { +func (opc *OrderedParallelCompiler) StartCompiling(suites TestSuites, goFlagsConfig types.GoFlagsConfig, preserveSymbols bool) { opc.stopped = false opc.idx = 0 opc.numSuites = len(suites) @@ -135,7 +135,7 @@ func (opc *OrderedParallelCompiler) StartCompiling(suites TestSuites, goFlagsCon stopped := opc.stopped opc.mutex.Unlock() if !stopped { - suite = CompileSuite(suite, goFlagsConfig) + suite = CompileSuite(suite, goFlagsConfig, preserveSymbols) } c <- suite } diff --git a/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go b/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go index b7d77390bb..03875b9796 100644 --- a/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go +++ b/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go @@ -107,7 +107,7 @@ OUTER_LOOP: } opc := internal.NewOrderedParallelCompiler(r.cliConfig.ComputedNumCompilers()) - opc.StartCompiling(suites, r.goFlagsConfig) + opc.StartCompiling(suites, r.goFlagsConfig, false) SUITE_LOOP: for { diff --git a/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go b/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go index bde4193ce7..fe1ca30519 100644 --- a/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go +++ b/common/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go @@ -153,7 +153,7 @@ func (w *SpecWatcher) WatchSpecs(args []string, additionalArgs []string) { } func (w *SpecWatcher) compileAndRun(suite internal.TestSuite, additionalArgs []string) internal.TestSuite { - suite = internal.CompileSuite(suite, w.goFlagsConfig) + suite = internal.CompileSuite(suite, w.goFlagsConfig, false) if suite.State.Is(internal.TestSuiteStateFailedToCompile) { fmt.Println(suite.CompilationError.Error()) return suite diff --git a/common/vendor/github.com/onsi/ginkgo/v2/types/config.go b/common/vendor/github.com/onsi/ginkgo/v2/types/config.go index 3d543c1219..ca837b0557 100644 --- a/common/vendor/github.com/onsi/ginkgo/v2/types/config.go +++ b/common/vendor/github.com/onsi/ginkgo/v2/types/config.go @@ -231,6 +231,10 @@ func (g GoFlagsConfig) BinaryMustBePreserved() bool { return g.BlockProfile != "" || g.CPUProfile != "" || g.MemProfile != "" || g.MutexProfile != "" } +func (g GoFlagsConfig) NeedsSymbols() bool { + return g.BinaryMustBePreserved() +} + // Configuration that were deprecated in 2.0 type deprecatedConfig struct { DebugParallel bool @@ -640,7 +644,7 @@ func VetAndInitializeCLIAndGoConfig(cliConfig CLIConfig, goFlagsConfig GoFlagsCo } // GenerateGoTestCompileArgs is used by the Ginkgo CLI to generate command line arguments to pass to the go test -c command when compiling the test -func GenerateGoTestCompileArgs(goFlagsConfig GoFlagsConfig, packageToBuild string, pathToInvocationPath string) ([]string, error) { +func GenerateGoTestCompileArgs(goFlagsConfig GoFlagsConfig, packageToBuild string, pathToInvocationPath string, preserveSymbols bool) ([]string, error) { // if the user has set the CoverProfile run-time flag make sure to set the build-time cover flag to make sure // the built test binary can generate a coverprofile if goFlagsConfig.CoverProfile != "" { @@ -663,6 +667,10 @@ func GenerateGoTestCompileArgs(goFlagsConfig GoFlagsConfig, packageToBuild strin goFlagsConfig.CoverPkg = strings.Join(adjustedCoverPkgs, ",") } + if !goFlagsConfig.NeedsSymbols() && goFlagsConfig.LDFlags == "" && !preserveSymbols { + goFlagsConfig.LDFlags = "-w -s" + } + args := []string{"test", "-c", packageToBuild} goArgs, err := GenerateFlagArgs( GoBuildFlags, diff --git a/common/vendor/github.com/onsi/ginkgo/v2/types/errors.go b/common/vendor/github.com/onsi/ginkgo/v2/types/errors.go index 854252ac2a..c3f562f776 100644 --- a/common/vendor/github.com/onsi/ginkgo/v2/types/errors.go +++ b/common/vendor/github.com/onsi/ginkgo/v2/types/errors.go @@ -636,6 +636,13 @@ func (g ginkgoErrors) ExpectFilenameNotPath(flag string, path string) error { } } +func (g ginkgoErrors) FlagAfterPositionalParameter() error { + return GinkgoError{ + Heading: "Malformed arguments - detected a flag after the package liste", + Message: "Make sure all flags appear {{bold}}after{{/}} the Ginkgo subcommand and {{bold}}before{{/}} your list of packages (or './...').\n{{gray}}e.g. 'ginkgo run -p my_package' is valid but `ginkgo -p run my_package` is not.\n{{gray}}e.g. 'ginkgo -p -vet ./...' is valid but 'ginkgo -p ./... -vet' is not{{/}}", + } +} + /* Stack-Trace parsing errors */ func (g ginkgoErrors) FailedToParseStackTrace(message string) error { diff --git a/common/vendor/github.com/onsi/ginkgo/v2/types/version.go b/common/vendor/github.com/onsi/ginkgo/v2/types/version.go index 8d38790bf2..48c1e88be3 100644 --- a/common/vendor/github.com/onsi/ginkgo/v2/types/version.go +++ b/common/vendor/github.com/onsi/ginkgo/v2/types/version.go @@ -1,3 +1,3 @@ package types -const VERSION = "2.23.1" +const VERSION = "2.23.2" diff --git a/common/vendor/modules.txt b/common/vendor/modules.txt index a7c3cd3527..08b12ffbc2 100644 --- a/common/vendor/modules.txt +++ b/common/vendor/modules.txt @@ -480,7 +480,7 @@ github.com/modern-go/reflect2 # github.com/oklog/ulid v1.3.1 ## explicit github.com/oklog/ulid -# github.com/onsi/ginkgo/v2 v2.23.1 +# github.com/onsi/ginkgo/v2 v2.23.2 ## explicit; go 1.23.0 github.com/onsi/ginkgo/v2 github.com/onsi/ginkgo/v2/config