🌱 Bump github.com/onsi/ginkgo/v2 from 2.28.1 to 2.28.2 (#1503)

Bumps [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) from 2.28.1 to 2.28.2.
- [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.28.2)

---
updated-dependencies:
- dependency-name: github.com/onsi/ginkgo/v2
  dependency-version: 2.28.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
dependabot[bot]
2026-05-06 15:05:56 +00:00
committed by GitHub
parent 78709441e4
commit ba8198717c
12 changed files with 214 additions and 6 deletions

2
go.mod
View File

@@ -15,7 +15,7 @@ require (
github.com/google/cel-go v0.28.0
github.com/google/go-cmp v0.7.0
github.com/itchyny/gojq v0.12.19
github.com/onsi/ginkgo/v2 v2.28.1
github.com/onsi/ginkgo/v2 v2.28.2
github.com/onsi/gomega v1.39.1
github.com/openshift/api v0.0.0-20251125174858-5cf710f68a92
github.com/openshift/build-machinery-go v0.0.0-20250602125535-1b6d00b8c37c

4
go.sum
View File

@@ -315,8 +315,8 @@ github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU=
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/ginkgo/v2 v2.28.2 h1:DTrMfpqxiNUyQ3Y0zhn1n3cOO2euFgQPYIpkWwxVFps=
github.com/onsi/ginkgo/v2 v2.28.2/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/openshift/api v0.0.0-20251125174858-5cf710f68a92 h1:84/QWiBTDwOgOBflOL5hKqp4XdGkH3rODzd3Yx48Jts=

View File

@@ -1,3 +1,12 @@
## 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.

View File

@@ -120,6 +120,6 @@ Sponsors commit to a [sponsorship](https://github.com/sponsors/onsi) for a year.
<p style="font-size:21px; color:black;">Browser testing via
<a href="https://www.testmu.ai/" target="_blank">
<img src="https://www.testmu.ai/blue-logo.png" style="vertical-align: middle;" width="250" height="45" />
<img src="https://assets.testmu.ai/resources/images/logos/white-logo.png" style="vertical-align: middle;" width="250" />
</a>
</p>

View File

@@ -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> <SHELL> [-- <COMPLETE>]",
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 <SHELL>){{/}}.`,
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))))

View File

@@ -41,6 +41,7 @@ func main() {
{Name: "nodot", Deprecation: types.Deprecations.Nodot()},
},
}
program.Commands = append(program.Commands, program.BuildCompletionCommand())
program.RunAndExit(os.Args)
}

View File

@@ -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()
}

View File

@@ -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}

View File

@@ -215,6 +215,7 @@ type GoFlagsConfig struct {
N bool
ModFile string
ModCacheRW bool
ASan bool
MSan bool
PkgDir string
Tags string
@@ -570,6 +571,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",

View File

@@ -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) {

View File

@@ -1,3 +1,3 @@
package types
const VERSION = "2.28.1"
const VERSION = "2.28.2"

2
vendor/modules.txt vendored
View File

@@ -496,7 +496,7 @@ github.com/modern-go/reflect2
# github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822
## explicit
github.com/munnerz/goautoneg
# github.com/onsi/ginkgo/v2 v2.28.1
# github.com/onsi/ginkgo/v2 v2.28.2
## explicit; go 1.24.0
github.com/onsi/ginkgo/v2
github.com/onsi/ginkgo/v2/config