From 99b9f3a9ed6928af1faec8df33e3a0841828d539 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 18:01:25 +0000 Subject: [PATCH] build(deps): Bump github.com/onsi/ginkgo/v2 in /tests Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.28.1 to 2.32.0. - [Release notes](https://github.com/onsi/ginkgo/releases) - [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/ginkgo/compare/v2.28.1...v2.32.0) --- updated-dependencies: - dependency-name: github.com/onsi/ginkgo/v2 dependency-version: 2.32.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- tests/go.mod | 6 +- tests/go.sum | 12 +- .../github.com/onsi/ginkgo/v2/.gitignore | 1 + .../github.com/onsi/ginkgo/v2/CHANGELOG.md | 45 +++++ .../github.com/onsi/ginkgo/v2/README.md | 15 +- .../github.com/onsi/ginkgo/v2/core_dsl.go | 5 +- .../onsi/ginkgo/v2/ginkgo/command/program.go | 164 ++++++++++++++++++ .../github.com/onsi/ginkgo/v2/ginkgo/main.go | 1 + .../onsi/ginkgo/v2/ginkgo/outline/ginkgo.go | 6 +- .../onsi/ginkgo/v2/ginkgo/outline/outline.go | 27 +++ .../onsi/ginkgo/v2/ginkgo/run/run_command.go | 4 + .../ginkgo/v2/ginkgo/watch/watch_command.go | 4 + .../github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go | 4 + .../github.com/onsi/ginkgo/v2/helpergo_dsl.go | 143 +++++++++++++++ .../onsi/ginkgo/v2/internal/global/init.go | 7 + .../onsi/ginkgo/v2/internal/suite.go | 37 ++++ .../internal/testingtproxy/testing_t_proxy.go | 9 + .../ginkgo/v2/reporters/default_reporter.go | 57 +++++- .../github.com/onsi/ginkgo/v2/types/config.go | 42 ++++- .../github.com/onsi/ginkgo/v2/types/errors.go | 17 +- .../github.com/onsi/ginkgo/v2/types/flags.go | 18 ++ .../onsi/ginkgo/v2/types/version.go | 2 +- .../github.com/onsi/gomega/CHANGELOG.md | 8 + .../github.com/onsi/gomega/gomega_dsl.go | 2 +- tests/vendor/modules.txt | 8 +- 25 files changed, 618 insertions(+), 26 deletions(-) create mode 100644 tests/vendor/github.com/onsi/ginkgo/v2/helpergo_dsl.go diff --git a/tests/go.mod b/tests/go.mod index 4660ba76c..e99989cbd 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -3,8 +3,8 @@ module github.com/NVIDIA/nvidia-container-toolkit/tests go 1.25.0 require ( - github.com/onsi/ginkgo/v2 v2.28.1 - github.com/onsi/gomega v1.39.1 + github.com/onsi/ginkgo/v2 v2.32.0 + github.com/onsi/gomega v1.40.0 github.com/pelletier/go-toml v1.9.5 golang.org/x/crypto v0.53.0 golang.org/x/mod v0.38.0 @@ -15,7 +15,7 @@ require ( github.com/go-logr/logr v1.4.3 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/go-cmp v0.7.0 // indirect - github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 // indirect + github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/net v0.56.0 // indirect golang.org/x/sync v0.21.0 // indirect diff --git a/tests/go.sum b/tests/go.sum index a0fec05c6..7e1385644 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -16,8 +16,8 @@ github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw= github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 h1:z2ogiKUYzX5Is6zr/vP9vJGqPwcdqsWjOt+V8J7+bTc= -github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= +github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 h1:EwtI+Al+DeppwYX2oXJCETMO23COyaKGP6fHVpkpWpg= +github.com/google/pprof v0.0.0-20260402051712-545e8a4df936/go.mod h1:MxpfABSjhmINe3F1It9d+8exIHFvUqtLIRCdOGNXqiI= github.com/joshdk/go-junit v1.0.0 h1:S86cUKIdwBHWwA6xCmFlf3RTLfVXYQfvanM5Uh+K6GE= github.com/joshdk/go-junit v1.0.0/go.mod h1:TiiV0PqkaNfFXjEiyjWM3XXrhVyCa1K4Zfga6W52ung= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= @@ -28,10 +28,10 @@ github.com/maruel/natural v1.1.1 h1:Hja7XhhmvEFhcByqDoHz9QZbkWey+COd9xWfCfn1ioo= github.com/maruel/natural v1.1.1/go.mod h1:v+Rfd79xlw1AgVBjbO0BEQmptqb5HvL/k9GRHB7ZKEg= github.com/mfridman/tparse v0.18.0 h1:wh6dzOKaIwkUGyKgOntDW4liXSo37qg5AXbIhkMV3vE= github.com/mfridman/tparse v0.18.0/go.mod h1:gEvqZTuCgEhPbYk/2lS3Kcxg1GmTxxU7kTC8DvP0i/A= -github.com/onsi/ginkgo/v2 v2.28.1 h1:S4hj+HbZp40fNKuLUQOYLDgZLwNUVn19N3Atb98NCyI= -github.com/onsi/ginkgo/v2 v2.28.1/go.mod h1:CLtbVInNckU3/+gC8LzkGUb9oF+e8W8TdUsxPwvdOgE= -github.com/onsi/gomega v1.39.1 h1:1IJLAad4zjPn2PsnhH70V4DKRFlrCzGBNrNaru+Vf28= -github.com/onsi/gomega v1.39.1/go.mod h1:hL6yVALoTOxeWudERyfppUcZXjMwIMLnuSfruD2lcfg= +github.com/onsi/ginkgo/v2 v2.32.0 h1:Hw7s2pVrQo/8Yz5N77qdnpHaoc+c6cC9WIV1Jce+J6E= +github.com/onsi/ginkgo/v2 v2.32.0/go.mod h1:+aXOY+vzZ5mu2iI2HpTZUPmM//oQfsNFX6gU9kNcA44= +github.com/onsi/gomega v1.40.0 h1:Vtol0e1MghCD2ZVIilPDIg44XSL9l2QAn8ZNaljWcJc= +github.com/onsi/gomega v1.40.0/go.mod h1:M/Uqpu/8qTjtzCLUA2zJHX9Iilrau25x1PdoSRbWh5A= github.com/pelletier/go-toml v1.9.5 h1:4yBQzkHv+7BHq2PQUZF3Mx0IYxG7LsP222s7Agd3ve8= github.com/pelletier/go-toml v1.9.5/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/.gitignore b/tests/vendor/github.com/onsi/ginkgo/v2/.gitignore index 6faaaf315..c9f054620 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/.gitignore +++ b/tests/vendor/github.com/onsi/ginkgo/v2/.gitignore @@ -1,6 +1,7 @@ .DS_Store TODO tmp/**/* +integration/tmp_*/ *.coverprofile .vscode .idea/ diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md b/tests/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md index 70050f35d..10e608564 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md +++ b/tests/vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md @@ -1,3 +1,48 @@ +## 2.32.0 + +`-fd` generate RSpec-style documentation output. Thank @woodie ! +--sleep-on-failure pauses a failed spec before teardown. Thanks @qinqon ! + +## 2.31.0 + +Add a bunch of Claude Skills via the marketplace: + +``` +/plugin marketplace add onsi/ginkgo +/plugin install ginkgo@ginkgo +``` + +## 2.30.0 + +### Features +Ginkgo now allows `extentions/global.Reset` to support running multiple suites from within a single process. This may take some massaging on your part (see [1672](https://github.com/onsi/ginkgo/issues/1672)) but can dramatically speed up codebases with O(hundreds) of test suites. + +Thanks @lawrencejones ! + +### Fixes + +- Fix nested --github-output group for progress report nested inside timeline [4f62d7a] + +## 2.29.0 + +`GinkgoHelperGo` makes it easier to write test helpers that need to run in goroutines. Specifically, it makes managing the failure state and capturing failure panics correctly straightforward. + +`ginkgo outline` now includes entries defined in `DescribeTableSubtree` + +## 2.28.3 + +### Maintenance +Bump all dependencies + +## 2.28.2 + +- Add ArtifactDir() to support Go 1.26 testing.TB interface [f3a36b6] +- Implement shell completion [94151c8] +- Add asan CLI option mirroring msan implementation [4d21dbb] +- Bump uri from 1.0.3 to 1.0.4 in /docs (#1630) [c102161] +- fix aspect ratio [9619647] +- update logos [5779304] + ## 2.28.1 Update all dependencies. This auto-updated the required version of Go to 1.24, consistent with the fact that Go 1.23 has been out of support for almost six months. diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/README.md b/tests/vendor/github.com/onsi/ginkgo/v2/README.md index b4c3ce0ad..ad5e45f67 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/README.md +++ b/tests/vendor/github.com/onsi/ginkgo/v2/README.md @@ -106,6 +106,19 @@ And that's just Ginkgo! [Gomega](https://onsi.github.io/gomega/) brings a rich, Happy Testing! +## Using Ginkgo with Claude Code + +Ginkgo ships a set of [Claude Code](https://claude.com/claude-code) skills as a plugin, with this repo doubling as the marketplace, so an agent writing specs in *your* project has Ginkgo's idioms, decorators, and gotchas on hand. From inside Claude Code: + +``` +/plugin marketplace add onsi/ginkgo +/plugin install ginkgo@ginkgo +``` + +(or non-interactively: `claude plugin marketplace add onsi/ginkgo` then `claude plugin install ginkgo@ginkgo`) + +This installs a family of `ginkgo:*` skills that activate automatically while you write and run specs. Start with `ginkgo:overview`; see the [plugin README](plugins/ginkgo/README.md) for the full list. + ## License Ginkgo is MIT-Licensed @@ -120,6 +133,6 @@ Sponsors commit to a [sponsorship](https://github.com/sponsors/onsi) for a year.

Browser testing via - +

diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/core_dsl.go b/tests/vendor/github.com/onsi/ginkgo/v2/core_dsl.go index 1c5a39a1f..fb5761c1f 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/core_dsl.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/core_dsl.go @@ -39,7 +39,6 @@ var flagSet types.GinkgoFlagSet var deprecationTracker = types.NewDeprecationTracker() var suiteConfig = types.NewDefaultSuiteConfig() var reporterConfig = types.NewDefaultReporterConfig() -var suiteDidRun = false var outputInterceptor internal.OutputInterceptor var client parallel_support.Client @@ -259,10 +258,10 @@ for more on how specs are parallelized in Ginkgo. You can also pass suite-level Label() decorators to RunSpecs. The passed-in labels will apply to all specs in the suite. */ func RunSpecs(t GinkgoTestingT, description string, args ...any) bool { - if suiteDidRun { + if global.SuiteDidRun { exitIfErr(types.GinkgoErrors.RerunningSuite()) } - suiteDidRun = true + global.SuiteDidRun = true err := global.PushClone() if err != nil { exitIfErr(err) diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go index c3f6d3a11..53114904c 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/command/program.go @@ -1,9 +1,13 @@ package command import ( + "bufio" "fmt" "io" + "maps" "os" + "path/filepath" + "slices" "strings" "github.com/onsi/ginkgo/v2/formatter" @@ -158,6 +162,166 @@ func (p Program) handleHelpRequestsAndExit(writer io.Writer, args []string) { } } +type completionOptions = struct { + Complete bool + Install bool +} + +func (p *Program) BuildCompletionCommand() Command { + opts := completionOptions{} + flags, err := types.NewGinkgoFlagSet( + types.GinkgoFlags{ + {Name: "complete", KeyPath: "Complete", Usage: "Generate completion for arguments after --"}, + {Name: "install", KeyPath: "Install", Usage: "Install shell completion script into $XDG_DATA_HOME, ~/.local/share"}, + }, + &opts, + types.GinkgoFlagSections{}, + ) + if err != nil { + panic(err) + } + return Command{ + Name: "completion", + Usage: "ginkgo completion [-- ]", + Flags: flags, + ShortDoc: "Generate shell completion", + Documentation: `To use install completion script for your shell (bash, fish, zsh). +Or load completion code by: {{bold}}source <(ginkgo completion ){{/}}.`, + Command: func(args []string, completeArgs []string) { + p.handleCompletionAndExit(args, completeArgs, opts) + }, + } +} + +func (p Program) generateShellCompletionScript(shell string) (scriptPath string, script string) { + switch shell { + case "bash": + scriptPath = fmt.Sprintf("bash-completion/completions/%s", p.Name) + script = fmt.Sprintf(`__%s_complete_bash() { + mapfile -t COMPREPLY < <("${COMP_WORDS[0]}" completion --complete bash -- "${COMP_WORDS[@]:1:COMP_CWORD}") +} +complete -o bashdefault -o default -F __%[1]s_complete_bash %[1]s +`, p.Name) + + case "fish": + scriptPath = fmt.Sprintf("fish/vendor_completions.d/%s.fish", p.Name) + script = fmt.Sprintf(`function __fish_%[1]s_complete + set -l args (commandline -opc) (commandline -ct) + set -e args[1] + %[1]s completion --complete fish -- $args +end +complete -c %[1]s -a "(__fish_%[1]s_complete)" +`, p.Name) + + case "zsh": + scriptPath = fmt.Sprintf("zsh/site-functions/_%s", p.Name) + script = fmt.Sprintf(`#compdef %[1]s +_%[1]s() { + local -a completions + completions=(${(f)"$("${words[1]}" completion --complete zsh -- "${words[@]:1:$((CURRENT-1))}")"}) + if (( ${#completions[@]} )); then + _describe 'completions' completions + else + _default + fi +} +compdef _%[1]s %[1]s +if [ "$funcstack[1]" = "_%[1]s" ]; then + _%[1]s +fi +`, p.Name) + + case "": + AbortWithUsage("Shell is not specified") + default: + AbortWith("Shell %q is not supported yet. Choose: bash, fish, zsh", shell) + } + + return scriptPath, script +} + +func (p Program) handleCompletionAndExit(args, completeArgs []string, opts completionOptions) { + writer := p.OutWriter + if writer == nil { + writer = os.Stdout + } + buffer := bufio.NewWriter(writer) + defer buffer.Flush() + + var shell string + if len(args) > 0 { + shell = args[0] + } + + if !opts.Complete { + scriptPath, script := p.generateShellCompletionScript(shell) + if opts.Install { + dataHomeDir := os.Getenv("XDG_DATA_HOME") + if dataHomeDir == "" { + userHomeDir, err := os.UserHomeDir() + AbortIfError("Failed to find home", err) + dataHomeDir = filepath.Join(userHomeDir, ".local/share") + } + scriptPath = filepath.Join(dataHomeDir, scriptPath) + fmt.Fprintf(buffer, "Installing completion script: %v\n", scriptPath) + err := os.WriteFile(scriptPath, []byte(script), 0644) + AbortIfError("Failed to install completion script", err) + } else { + buffer.Write([]byte(script)) + } + Abort(AbortDetails{}) + } + + var lastArg string + var result map[string]string + if len(completeArgs) > 0 { + lastArg = completeArgs[len(completeArgs)-1] + } + + if delim := slices.Index(completeArgs, "--"); delim >= 0 && delim != len(completeArgs)-1 { + // No completion for pass-through arguments after "--" + } else if len(lastArg) > 0 && lastArg[0] == '-' { + // Complete flags + cmd := &p.DefaultCommand + for i := range p.Commands { + if p.Commands[i].Name == completeArgs[0] { + cmd = &p.Commands[i] + break + } + } + result = cmd.Flags.Completion(lastArg) + } else if len(completeArgs) <= 1 { + // Complete commands + result = make(map[string]string, len(p.Commands)+1) + for _, cmd := range append(p.Commands, p.DefaultCommand) { + if strings.HasPrefix(cmd.Name, lastArg) { + result[cmd.Name] = cmd.Usage + } + } + } + + width := 0 + for suggest := range result { + width = max(width, len(suggest)) + } + + for _, suggest := range slices.Sorted(maps.Keys(result)) { + usage := result[suggest] + switch { + case shell == "bash" && usage != "" && len(result) > 1: + fmt.Fprintf(buffer, "%*s (%s)\n", -width-2, suggest, usage) + case shell == "fish": + fmt.Fprintf(buffer, "%s\t%s\n", suggest, usage) + case shell == "zsh": + fmt.Fprintf(buffer, "%s:%s\n", suggest, usage) + default: + fmt.Fprintln(buffer, suggest) + } + } + + Abort(AbortDetails{}) +} + func (p Program) EmitUsage(writer io.Writer) { fmt.Fprintln(writer, formatter.F(p.Heading)) fmt.Fprintln(writer, formatter.F("{{gray}}%s{{/}}", strings.Repeat("-", len(p.Heading)))) diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go index 419589b48..596c210cf 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/main.go @@ -41,6 +41,7 @@ func main() { {Name: "nodot", Deprecation: types.Deprecations.Nodot()}, }, } + program.Commands = append(program.Commands, program.BuildCompletionCommand()) program.RunAndExit(os.Args) } diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/ginkgo.go b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/ginkgo.go index 5d8d00bb1..c380bbf21 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/ginkgo.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/ginkgo.go @@ -163,17 +163,17 @@ func ginkgoNodeFromCallExpr(fset *token.FileSet, ce *ast.CallExpr, ginkgoPackage n.Text = textOrAltFromCallExpr(ce, undefinedTextAlt) n.Labels = labelFromCallExpr(ce) return &n, ginkgoPackageName != nil && *ginkgoPackageName == packageName - case "Context", "Describe", "When", "DescribeTable": + case "Context", "Describe", "When", "DescribeTable", "DescribeTableSubtree": n.Text = textOrAltFromCallExpr(ce, undefinedTextAlt) n.Labels = labelFromCallExpr(ce) n.Pending = pendingFromCallExpr(ce) return &n, ginkgoPackageName != nil && *ginkgoPackageName == packageName - case "FContext", "FDescribe", "FWhen", "FDescribeTable": + case "FContext", "FDescribe", "FWhen", "FDescribeTable", "FDescribeTableSubtree": n.Focused = true n.Text = textOrAltFromCallExpr(ce, undefinedTextAlt) n.Labels = labelFromCallExpr(ce) return &n, ginkgoPackageName != nil && *ginkgoPackageName == packageName - case "PContext", "PDescribe", "PWhen", "XContext", "XDescribe", "XWhen", "PDescribeTable", "XDescribeTable": + case "PContext", "PDescribe", "PWhen", "XContext", "XDescribe", "XWhen", "PDescribeTable", "XDescribeTable", "PDescribeTableSubtree", "XDescribeTableSubtree": n.Pending = true n.Text = textOrAltFromCallExpr(ce, undefinedTextAlt) n.Labels = labelFromCallExpr(ce) diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/outline.go b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/outline.go index e99d557d1..206043f1d 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/outline.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/outline/outline.go @@ -54,6 +54,7 @@ func FromASTFile(fset *token.FileSet, src *ast.File) (*outline, error) { // Node is not a Ginkgo spec or container, so it was not pushed onto the stack, continue return true } + expandSubtree(lastVisitedGinkgoNode) stack = stack[0 : len(stack)-1] return true }) @@ -128,3 +129,29 @@ func (o *outline) StringIndent(width int) string { return b.String() } + +// expandSubtree restructures a DescribeTableSubtree node so that each Entry +// child gets a copy of the subtree's spec nodes as its children. This mirrors +// the runtime behavior where each Entry generates a container with the specs +// defined in the DescribeTableSubtree body. +func expandSubtree(gn *ginkgoNode) { + if !strings.Contains(gn.Name, "DescribeTableSubtree") { + return + } + subNodes, entries := splitSubtreeSubnodes(gn.Nodes) + gn.Nodes = entries + for _, entry := range entries { + entry.Nodes = subNodes + } +} + +// splitSubtreeSubnodes splits the child nodes of a DescribeTableSubtree into +// spec/container nodes (defined in the body) and Entry nodes. +func splitSubtreeSubnodes(nodes []*ginkgoNode) ([]*ginkgoNode, []*ginkgoNode) { + for i, node := range nodes { + if strings.Contains(node.Name, "Entry") { + return nodes[:i], nodes[i:] + } + } + return nodes, nil +} diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go index c5091e6de..7b6c2cc22 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/run/run_command.go @@ -39,6 +39,10 @@ func BuildRunCommand() command.Command { cliConfig, goFlagsConfig, errors = types.VetAndInitializeCLIAndGoConfig(cliConfig, goFlagsConfig) command.AbortIfErrors("Ginkgo detected configuration issues:", errors) + if types.ReconcileFdOutputConfiguration(reporterConfig, &suiteConfig, &cliConfig) { + fmt.Println("--fd is incompatible with parallel runs (-p/-procs) and -randomize-all; ignoring those flags and running specs in series, in declaration order.") + } + runner := &SpecRunner{ cliConfig: cliConfig, goFlagsConfig: goFlagsConfig, diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go index fe1ca3051..c60d7115f 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo/watch/watch_command.go @@ -37,6 +37,10 @@ func BuildWatchCommand() command.Command { cliConfig, goFlagsConfig, errors = types.VetAndInitializeCLIAndGoConfig(cliConfig, goFlagsConfig) command.AbortIfErrors("Ginkgo detected configuration issues:", errors) + if types.ReconcileFdOutputConfiguration(reporterConfig, &suiteConfig, &cliConfig) { + fmt.Println("--fd is incompatible with parallel runs (-p/-procs) and -randomize-all; ignoring those flags and running specs in series, in declaration order.") + } + watcher := &SpecWatcher{ cliConfig: cliConfig, goFlagsConfig: goFlagsConfig, diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go index 40d1e1ab5..db3e24847 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/ginkgo_t_dsl.go @@ -72,6 +72,7 @@ type GinkgoTInterface interface { TempDir() string Attr(key, value string) Output() io.Writer + ArtifactDir() string } /* @@ -196,3 +197,6 @@ func (g *GinkgoTBWrapper) Attr(key, value string) { func (g *GinkgoTBWrapper) Output() io.Writer { return g.GinkgoT.Output() } +func (g *GinkgoTBWrapper) ArtifactDir() string { + return g.GinkgoT.ArtifactDir() +} diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/helpergo_dsl.go b/tests/vendor/github.com/onsi/ginkgo/v2/helpergo_dsl.go new file mode 100644 index 000000000..9d04cc845 --- /dev/null +++ b/tests/vendor/github.com/onsi/ginkgo/v2/helpergo_dsl.go @@ -0,0 +1,143 @@ +package ginkgo + +import ( + "github.com/onsi/ginkgo/v2/internal/global" + ginkgotypes "github.com/onsi/ginkgo/v2/types" +) + +// GinkgoHelperGo synchronously calls the specified “helper” function in a new +// go routine and with a “defer GinkgoRecover()” already in place, passing the +// function a “helper Fail”. GinkgoHelperGo is typically called from custom test +// helpers that in turn need to synchronously execute caller-supplied custom +// test code in a new Go routine while waiting for this new Go routine to +// terminate (either successfully or failing). +// +// GinkgoHelperGo hides the non-trivial details of correctly unblocking the +// caller's waiting go routine as well as reporting the correct call sites, +// depending on whether the test helper failed, or the caller-supplied function +// had its assertions failing or panicked. +// +// Let's take the following example of a test helper named “EnsureSprockets” +// that runs a set of caller-supplied assertions synchronously on a new Go +// routine and waits for the outcome before returning to the caller of the test +// helper. This is just using Ginkgo: +// +// func EnsureSprockets(sprockets int, assertions func()) { +// GinkgoHelper() +// GinkgoHelperGo(func(helperFail func(string, ...int)) { +// if sprockets == 0 { +// helperFail("sprockets must not be zero") +// } +// assertions() +// }) +// } +// +// And now for an example that additionally uses Gomega assertions. +// +// func EnsureSprockets(sprockets int, assertions func()) { +// GinkgoHelper() +// GinkgoHelperGo(func(helperFail func(string, ...int)) { +// g := gomega.NewGomega(helperFail) +// g.Expect(sprockets).Not(BeZero()) +// assertions() +// }) +// } +// +// The called helper function should make any custom helper-related assertions +// using the passed “helper Fail”. Gomega users will want to create a new Gomega +// wired into this helper Fail. It is expected for the helper function at some +// point to call into a user-supplied function that might contain its own +// assertions. In the example above, that would be the function passed as +// assertions. +// +// Any failing assertion using the helper Gomega in the helper function will be +// reported as a fail at the call site of GinkgoHelperGo. Preferably, only +// custom test helpers call GinkgoHelperGo and thus mark themselves as +// [GinkgoHelper] also: in this case, the fail will be shown at the call site of +// the custom test helper. +// +// Any other failing assertions inside the caller-supplied custom test code and +// thus inside the helper function will instead be reported at the location of +// the failed assertion. +// +// If the caller-supplied custom test code panics, GinkgoHelperGo will fail at +// its call site, or at the call site of the custom test helper if it uses +// GinkgoHelper, reporting the usual stack trace for the panic, as a plain +// GinkgoRecover would also do. +// +// Important: the Gomega passed to the called function must only be used in +// assertions belonging to the test helper, but not any user test code called +// from the test helper. Thus, do not pass the Gomega passed to the helper +// function further on to any user test code functions. +func GinkgoHelperGo(fn func(fail func(message string, callerSkip ...int))) { + // userPanicked signals that the called user code panicked, such as due to a + // failed Gomega assertion. + type userPanicked struct{} + + // helperPanicked signals that some helper code assertion panicked in the + // separate Go routine and we are expected to Fail the current test with that + // reason, but on the caller's Go routine. + type helperPanicked string + + GinkgoHelper() + + // possible types of values sent over the result channel: + // - nil (untyped): no problem at all, proceed. + // - helperPanicked: the message with which to (re)fail in the caller's + // go routine. + // - userPanicked: indication to (also) fail on the caller's go routine; + // the message doesn't matter as the user code fail takes precedence. + ch := make(chan any) + + go func() { + isHelperPanic := false + helperFail := func(message string, callerSkip ...int) { + isHelperPanic = true + Fail(message, callerSkip...) + } + // Please note that we cannot simply recover a helper panic before + // GinkgoRecover kicks in as then GinkgoRecover would always report the + // stack trace only from the place of rethrown panic ... and that's + // pretty useless, because it would just consist of the panic rethrow. + defer func() { + // We need to unblock and immediately fail the waiting caller's + // go routine either for a reason, or just "because" when + // GinkgoRecover has already failed the current test on the + // separate go routine. + if global.Failer.GetState() != ginkgotypes.SpecStatePassed { + if isHelperPanic { + _, failure := global.Failer.Drain() + ch <- helperPanicked(failure.Message) + } else { + // keep the panic failure already recorded by GinkgoRecover. + ch <- userPanicked{} + } + } + close(ch) // causes a nil in case there were no panics anywhere. + }() + // Nota bene: GinkgoRecover always eats any user panic and channel the + // panic value into Ginkgo's Failer.Panic(). We can peek at the last + // failure recorded, which should be nil if GinkgoRecover didn't swallow + // a user code panic. The "problem" with GinkgoRecover is that it turns + // any panic value into a string message, so we loose any specific + // typing. + defer GinkgoRecover() + + fn(helperFail) + }() + + // Did we run into trouble? + switch v := (<-ch).(type) { + case userPanicked: + // The message actually is irrelevant, as it comes only second to + // the already registered user panic message. We just need Fail to + // panic on the caller's go routine in order to unblock the test. + Fail("fn panicked", 1) + case helperPanicked: + // Report the failure on the new go routine instead on the caller's go + // routine. + Fail(string(v), 1) + default: + // It's all fine! + } +} diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/internal/global/init.go b/tests/vendor/github.com/onsi/ginkgo/v2/internal/global/init.go index 464e3c97f..14d2552b7 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/internal/global/init.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/internal/global/init.go @@ -8,6 +8,12 @@ var Suite *internal.Suite var Failer *internal.Failer var backupSuite *internal.Suite +// SuiteDidRun tracks whether RunSpecs has already been invoked for the current global +// suite. It lives here (rather than in package ginkgo) so that InitializeGlobals can +// clear it, allowing extensions/globals.Reset to support running multiple suites +// sequentially in a single process. +var SuiteDidRun bool + func init() { InitializeGlobals() } @@ -15,6 +21,7 @@ func init() { func InitializeGlobals() { Failer = internal.NewFailer() Suite = internal.NewSuite() + SuiteDidRun = false } func PushClone() error { diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/internal/suite.go b/tests/vendor/github.com/onsi/ginkgo/v2/internal/suite.go index 57c1cffe7..6c879855e 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/internal/suite.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/internal/suite.go @@ -996,6 +996,7 @@ func (suite *Suite) runNode(node Node, specDeadline time.Time, text string) (typ } else { failure.Message, failure.Location, failure.ForwardedPanic, failure.TimelineLocation = failureFromRun.Message, failureFromRun.Location, failureFromRun.ForwardedPanic, failureFromRun.TimelineLocation suite.reporter.EmitFailure(outcomeFromRun, failure) + suite.pauseOnFailureIfRequested(node) return outcomeFromRun, failure } case <-gracePeriodChannel: @@ -1079,6 +1080,42 @@ func (suite *Suite) runNode(node Node, specDeadline time.Time, text string) (typ } } +// pauseOnFailureIfRequested pauses the suite at the moment a failure is identified, +// when the user has set --sleep-on-failure. This hooks directly into runNode's failure +// path so the pause happens immediately at the point of failure - before any teardown +// or cleanup runs - leaving the system live for inspection. +// +// We only pause for failures in setup and subject nodes (It, Before*, BeforeSuite...), +// i.e. nodes that run before teardown. Pausing on a failure in a teardown/cleanup or +// reporting node would be pointless (the system is already being torn down) and could +// interfere with interrupt handling, so those are skipped. +// +// The pause is interruptible: pressing ^C (or any interrupt) ends the pause early and +// the suite proceeds to run cleanup as usual. It is a no-op if the feature is disabled. +func (suite *Suite) pauseOnFailureIfRequested(node Node) { + if suite.config.SleepOnFailure <= 0 { + return + } + // only pause before teardown - skip teardown/cleanup/reporting nodes + if node.NodeType.Is(types.NodeTypesAllowedDuringCleanupInterrupt | types.NodeTypesAllowedDuringReportInterrupt) { + return + } + + duration := suite.config.SleepOnFailure + report := suite.generateProgressReport(false) + report.Message = fmt.Sprintf("{{bold}}{{orange}}Paused on failure for up to %s.{{/}}\nThe spec failed and Ginkgo has paused before running any teardown so you can inspect the live system.\nPress {{bold}}^C{{/}} to end the pause and proceed to cleanup.", duration) + suite.emitProgressReport(report) + + timer := time.NewTimer(duration) + defer timer.Stop() + // wait for the pause to elapse, or for the user to interrupt - in which case we end + // the pause early and let runNode return so cleanup can proceed + select { + case <-timer.C: + case <-suite.interruptHandler.Status().Channel: + } +} + // TODO: search for usages and consider if reporter.EmitFailure() is necessary func (suite *Suite) failureForLeafNodeWithMessage(node Node, message string) types.Failure { return types.Failure{ diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go b/tests/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go index 5704f0fdf..e6fbaee41 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/internal/testingtproxy/testing_t_proxy.go @@ -181,6 +181,15 @@ func (t *ginkgoTestingTProxy) TempDir() string { return tmpDir } +func (t *ginkgoTestingTProxy) ArtifactDir() string { + artifactDir, err := os.MkdirTemp("", "ginkgo") + if err != nil { + t.fail(fmt.Sprintf("Failed to create artifact directory: %v", err), 1) + return "" + } + return artifactDir +} + // FullGinkgoTInterface func (t *ginkgoTestingTProxy) AddReportEntryVisibilityAlways(name string, args ...any) { finalArgs := []any{internal.Offset(1), types.ReportEntryVisibilityAlways} diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go b/tests/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go index ef66b2289..f3e15a913 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go @@ -31,6 +31,7 @@ type DefaultReporter struct { specDenoter string retryDenoter string formatter formatter.Formatter + fdHierarchy []string runningInParallel bool lock *sync.Mutex @@ -82,6 +83,8 @@ func (r *DefaultReporter) SuiteWillBegin(report types.Report) { if report.SuiteConfig.ParallelTotal > 1 { r.emit(r.f("- %d procs ", report.SuiteConfig.ParallelTotal)) } + } else if r.conf.FdOutput { + return } else { banner := r.f("Running Suite: %s - %s", report.SuiteDescription, report.SuitePath) r.emitBlock(banner) @@ -124,7 +127,7 @@ func (r *DefaultReporter) SuiteWillBegin(report types.Report) { func (r *DefaultReporter) SuiteDidEnd(report types.Report) { failures := report.SpecReports.WithState(types.SpecStateFailureStates) - if len(failures) > 0 { + if !r.conf.FdOutput && len(failures) > 0 { r.emitBlock("\n") if len(failures) > 1 { r.emitBlock(r.f("{{red}}{{bold}}Summarizing %d Failures:{{/}}", len(failures))) @@ -227,6 +230,10 @@ func (r *DefaultReporter) DidRun(report types.SpecReport) { return } + if r.conf.FdOutput { + r.didRunFd(report) + return + } header := r.specDenoter if report.LeafNodeType.Is(types.NodeTypesForSuiteLevelNodes) { header = fmt.Sprintf("[%s]", report.LeafNodeType) @@ -358,6 +365,51 @@ func (r *DefaultReporter) DidRun(report types.SpecReport) { r.emitDelimiter(0) } +func (r *DefaultReporter) didRunFd(report types.SpecReport) { + r.lock.Lock() + defer r.lock.Unlock() + + if !report.LeafNodeType.Is(types.NodeTypeIt) { + return + } + + hierarchy := report.ContainerHierarchyTexts + + // blank line when top-level container changes + if len(r.fdHierarchy) > 0 && + (len(hierarchy) == 0 || hierarchy[0] != r.fdHierarchy[0]) { + fmt.Fprintln(r.writer) + } + + // emit newly-diverged container lines + divergeAt := 0 + for divergeAt < len(r.fdHierarchy) && divergeAt < len(hierarchy) && + r.fdHierarchy[divergeAt] == hierarchy[divergeAt] { + divergeAt++ + } + for i := divergeAt; i < len(hierarchy); i++ { + fmt.Fprintf(r.writer, "%s%s\n", strings.Repeat(" ", i), hierarchy[i]) + } + + // leaf label + depth := len(hierarchy) + indent := strings.Repeat(" ", depth) + label := report.LeafNodeText + + switch report.State { + case types.SpecStateFailed, types.SpecStatePanicked: + label = fmt.Sprintf("%s (FAILED)", label) + case types.SpecStatePending: + label = fmt.Sprintf("%s (PENDING)", label) + case types.SpecStateSkipped: + label = fmt.Sprintf("%s (SKIPPED)", label) + } + + color := r.highlightColorForState(report.State) + fmt.Fprintf(r.writer, "%s%s\n", indent, r.f(color+"%s{{/}}", label)) + r.fdHierarchy = hierarchy +} + func (r *DefaultReporter) highlightColorForState(state types.SpecState) string { switch state { case types.SpecStatePassed: @@ -423,7 +475,7 @@ func (r *DefaultReporter) emitTimeline(indent uint, report types.SpecReport, tim case types.ReportEntry: r.emitReportEntry(indent, x) case types.ProgressReport: - r.emitProgressReport(indent, false, isVeryVerbose, x) + r.emitProgressReport(indent, isVeryVerbose, false, x) case types.SpecEvent: if isVeryVerbose || !x.IsOnlyVisibleAtVeryVerbose() || r.conf.ShowNodeEvents { r.emitSpecEvent(indent, x, isVeryVerbose) @@ -533,6 +585,7 @@ func (r *DefaultReporter) emitProgressReport(indent uint, emitGinkgoWriterOutput indent -= 1 } + // Emit only top-level groups because github logging cannot handle nested groups correctly. if r.conf.GithubOutput && emitGroup { r.emitBlock(r.fi(indent, "::group::Progress Report")) } diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/types/config.go b/tests/vendor/github.com/onsi/ginkgo/v2/types/config.go index f84703604..854fec6a3 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/types/config.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/types/config.go @@ -38,6 +38,7 @@ type SuiteConfig struct { OutputInterceptorMode string SourceRoots []string GracePeriod time.Duration + SleepOnFailure time.Duration ParallelProcess int ParallelTotal int @@ -94,6 +95,7 @@ type ReporterConfig struct { GithubOutput bool SilenceSkips bool ForceNewlines bool + FdOutput bool JSONReport string GoJSONReport string @@ -215,6 +217,7 @@ type GoFlagsConfig struct { N bool ModFile string ModCacheRW bool + ASan bool MSan bool PkgDir string Tags string @@ -292,6 +295,8 @@ var SuiteConfigFlags = GinkgoFlags{ Usage: "Make up to this many attempts to run each spec. If any of the attempts succeed, the suite will not be failed."}, {KeyPath: "S.FailOnEmpty", Name: "fail-on-empty", SectionKey: "failure", Usage: "If set, ginkgo will mark the test suite as failed if no specs are run."}, + {KeyPath: "S.SleepOnFailure", Name: "sleep-on-failure", SectionKey: "failure", UsageDefaultValue: "0 - disabled", + Usage: "If set, ginkgo will pause for this duration after a spec fails - before its teardown (AfterEach/JustAfterEach/DeferCleanup) runs - so you can inspect the live system. Press ^C to end the pause early and proceed to cleanup. Serial only: cannot be combined with -p/--procs."}, {KeyPath: "S.DryRun", Name: "dry-run", SectionKey: "debug", DeprecatedName: "dryRun", DeprecatedDocLink: "changed-command-line-flags", Usage: "If set, ginkgo will walk the test hierarchy without actually running anything. Best paired with -v."}, @@ -357,7 +362,8 @@ var ReporterConfigFlags = GinkgoFlags{ Usage: "If set, default reporter will not print out skipped tests."}, {KeyPath: "R.ForceNewlines", Name: "force-newlines", SectionKey: "output", Usage: "If set, default reporter will ensure a newline appears after each test."}, - + {KeyPath: "R.FdOutput", Name: "fd", SectionKey: "output", + Usage: "If set, emits RSpec-style 'format documentation' output instead of Ginkgo's default output. --fd is exclusive: it overrides -p/-procs and -randomize-all, forcing specs to run serially in declaration order, since fd's hierarchical output can't be rendered sensibly when specs are parallelized or randomized."}, {KeyPath: "R.JSONReport", Name: "json-report", UsageArgument: "filename.json", SectionKey: "output", Usage: "If set, Ginkgo will generate a JSON-formatted test report at the specified location."}, {KeyPath: "R.GoJSONReport", Name: "gojson-report", UsageArgument: "filename.json", SectionKey: "output", @@ -428,6 +434,14 @@ func VetConfig(flagSet GinkgoFlagSet, suiteConfig SuiteConfig, reporterConfig Re errors = append(errors, GinkgoErrors.GracePeriodCannotBeZero()) } + if suiteConfig.SleepOnFailure < 0 { + errors = append(errors, GinkgoErrors.InvalidSleepOnFailureConfiguration()) + } + + if suiteConfig.SleepOnFailure > 0 && suiteConfig.ParallelTotal > 1 { + errors = append(errors, GinkgoErrors.SleepOnFailureInParallelConfiguration()) + } + if len(suiteConfig.FocusFiles) > 0 { _, err := ParseFileFilters(suiteConfig.FocusFiles) if err != nil { @@ -475,6 +489,30 @@ func VetConfig(flagSet GinkgoFlagSet, suiteConfig SuiteConfig, reporterConfig Re return errors } +// ReconcileFdOutputConfiguration forces serial, in-order execution when --fd is combined with +// -p, -procs (>1), or -randomize-all. fd's RSpec-style hierarchical output assumes specs run +// one at a time, in declaration order -- parallelism and randomization both break that assumption +// and produce fragmented, hard-to-read output. Rather than refusing to run, Ginkgo ignores those +// flags and runs in series instead. suiteConfig and cliConfig are mutated in place; the return +// value is true if anything was overridden, so callers can let the user know what was ignored. +func ReconcileFdOutputConfiguration(reporterConfig ReporterConfig, suiteConfig *SuiteConfig, cliConfig *CLIConfig) bool { + if !reporterConfig.FdOutput { + return false + } + + changed := false + if cliConfig.ComputedProcs() > 1 { + cliConfig.Procs = 1 + cliConfig.Parallel = false + changed = true + } + if suiteConfig.RandomizeAllSpecs { + suiteConfig.RandomizeAllSpecs = false + changed = true + } + return changed +} + // GinkgoCLISharedFlags provides flags shared by the Ginkgo CLI's build, watch, and run commands var GinkgoCLISharedFlags = GinkgoFlags{ {KeyPath: "C.Recurse", Name: "r", SectionKey: "multiple-suites", @@ -570,6 +608,8 @@ var GoBuildFlags = GinkgoFlags{ Usage: "leave newly-created directories in the module cache read-write instead of making them read-only."}, {KeyPath: "Go.ModFile", Name: "modfile", UsageArgument: "file", SectionKey: "go-build", Usage: `in module aware mode, read (and possibly write) an alternate go.mod file instead of the one in the module root directory. A file named go.mod must still be present in order to determine the module root directory, but it is not accessed. When -modfile is specified, an alternate go.sum file is also used: its path is derived from the -modfile flag by trimming the ".mod" extension and appending ".sum".`}, + {KeyPath: "Go.ASan", Name: "asan", SectionKey: "go-build", + Usage: "enable interoperation with address sanitizer."}, {KeyPath: "Go.MSan", Name: "msan", SectionKey: "go-build", Usage: "enable interoperation with memory sanitizer. Supported only on linux/amd64, linux/arm64 and only with Clang/LLVM as the host C compiler. On linux/arm64, pie build mode will be used."}, {KeyPath: "Go.N", Name: "n", SectionKey: "go-build", diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/types/errors.go b/tests/vendor/github.com/onsi/ginkgo/v2/types/errors.go index 623e54b66..636070c12 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/types/errors.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/types/errors.go @@ -455,7 +455,7 @@ func (g ginkgoErrors) InvalidEmptyComponentForSemVerConstraint(cl CodeLocation) Heading: "Invalid Empty Component for ComponentSemVerConstraint", Message: "ComponentSemVerConstraint requires a non-empty component name", CodeLocation: cl, - DocLink: "spec-semantic-version-filtering", + DocLink: "spec-semantic-version-filtering", } } @@ -621,6 +621,21 @@ func (g ginkgoErrors) GracePeriodCannotBeZero() error { } } +func (g ginkgoErrors) InvalidSleepOnFailureConfiguration() error { + return GinkgoError{ + Heading: "Ginkgo requires a non-negative --sleep-on-failure.", + Message: "Please set --sleep-on-failure to a positive duration (e.g. 5m), or 0 to disable it.", + } +} + +func (g ginkgoErrors) SleepOnFailureInParallelConfiguration() error { + return GinkgoError{ + Heading: "Ginkgo only supports --sleep-on-failure in serial mode.", + Message: "--sleep-on-failure pauses a failed spec on a live system for inspection, which only makes sense when the suite runs serially. Please run again without -p or --procs, or unset --sleep-on-failure.", + DocLink: "spec-timeouts-and-interruptible-nodes", + } +} + func (g ginkgoErrors) ConflictingVerbosityConfiguration() error { return GinkgoError{ Heading: "Conflicting reporter verbosity settings.", diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/types/flags.go b/tests/vendor/github.com/onsi/ginkgo/v2/types/flags.go index 8409653f9..eb04c3e78 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/types/flags.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/types/flags.go @@ -212,6 +212,24 @@ func (f GinkgoFlagSet) IsZero() bool { return f.flagSet == nil } +func (f GinkgoFlagSet) Completion(arg string) map[string]string { + if f.IsZero() { + return nil + } + prefix := strings.TrimLeft(arg, "-") + dash := arg[:len(arg)-len(prefix)] + if len(dash) < 1 || len(dash) > 3 { + return nil + } + result := make(map[string]string, len(f.flags)) + for _, flag := range f.flags { + if flag.Name != "" && strings.HasPrefix(flag.Name, prefix) { + result[dash+flag.Name] = flag.Usage + } + } + return result +} + func (f GinkgoFlagSet) WasSet(name string) bool { found := false f.flagSet.Visit(func(f *flag.Flag) { diff --git a/tests/vendor/github.com/onsi/ginkgo/v2/types/version.go b/tests/vendor/github.com/onsi/ginkgo/v2/types/version.go index 1df09be00..dc28324c1 100644 --- a/tests/vendor/github.com/onsi/ginkgo/v2/types/version.go +++ b/tests/vendor/github.com/onsi/ginkgo/v2/types/version.go @@ -1,3 +1,3 @@ package types -const VERSION = "2.28.1" +const VERSION = "2.32.0" diff --git a/tests/vendor/github.com/onsi/gomega/CHANGELOG.md b/tests/vendor/github.com/onsi/gomega/CHANGELOG.md index 91e65521b..9c94d0e6c 100644 --- a/tests/vendor/github.com/onsi/gomega/CHANGELOG.md +++ b/tests/vendor/github.com/onsi/gomega/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.40.0 + +We're adopting a new release strategy to minimize dependency bloat in projects that consume Gomega. It is a limitation of the go mod toolchain that _test_ subdependencies of your project's direct dependencies get pulled in as *indirect* dependencies. In the case of Gomega, this ends up pulling in all of Ginkgo into your `go.mod` even if you are only using Gomega (Gomega uses Ginkgo for its own tests). + +Going forward, releases will strip out all tests, tidy up the `go.mod` and then push this stripped down version to a new `master-lite` branch. These stripped-down versions will receive the `vx.y.z` git tag and will be picked up by the go toolchain. + +Please open an issue if this new release process causes unexpected changes for your projects. + ## 1.39.1 Update all dependencies. This auto-updated the required version of Go to 1.24, consistent with the fact that Go 1.23 has been out of support for almost six months. diff --git a/tests/vendor/github.com/onsi/gomega/gomega_dsl.go b/tests/vendor/github.com/onsi/gomega/gomega_dsl.go index 87c70692b..af1341bdb 100644 --- a/tests/vendor/github.com/onsi/gomega/gomega_dsl.go +++ b/tests/vendor/github.com/onsi/gomega/gomega_dsl.go @@ -22,7 +22,7 @@ import ( "github.com/onsi/gomega/types" ) -const GOMEGA_VERSION = "1.39.1" +const GOMEGA_VERSION = "1.40.0" const nilGomegaPanic = `You are trying to make an assertion, but haven't registered Gomega's fail handler. If you're using Ginkgo then you probably forgot to put your assertion in an It(). diff --git a/tests/vendor/modules.txt b/tests/vendor/modules.txt index 1030ebbe8..b81f505a1 100644 --- a/tests/vendor/modules.txt +++ b/tests/vendor/modules.txt @@ -15,11 +15,11 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/pprof v0.0.0-20260115054156-294ebfa9ad83 +# github.com/google/pprof v0.0.0-20260402051712-545e8a4df936 ## explicit; go 1.24.0 github.com/google/pprof/profile -# github.com/onsi/ginkgo/v2 v2.28.1 -## explicit; go 1.24.0 +# github.com/onsi/ginkgo/v2 v2.32.0 +## explicit; go 1.25.0 github.com/onsi/ginkgo/v2 github.com/onsi/ginkgo/v2/config github.com/onsi/ginkgo/v2/formatter @@ -42,7 +42,7 @@ github.com/onsi/ginkgo/v2/internal/reporters github.com/onsi/ginkgo/v2/internal/testingtproxy github.com/onsi/ginkgo/v2/reporters github.com/onsi/ginkgo/v2/types -# github.com/onsi/gomega v1.39.1 +# github.com/onsi/gomega v1.40.0 ## explicit; go 1.24.0 github.com/onsi/gomega github.com/onsi/gomega/format