dependencies: update to ginkgo v2.1.6 and gomega v1.20.1
Ginkgo v2.1.6 adds ginkgo.SuppressProgressReporting which is needed to suppress too verbose output each time the ReportAfterEach of the custom progress reporter is invoked.
This commit is contained in:
28
vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md
generated
vendored
28
vendor/github.com/onsi/ginkgo/v2/CHANGELOG.md
generated
vendored
@@ -1,3 +1,31 @@
|
||||
## 2.1.6
|
||||
|
||||
### Fixes
|
||||
- Add `SuppressProgressReporting` decorator to turn off --progress announcements for a given node [dfef62a]
|
||||
- chore: remove duplicate word in comments [7373214]
|
||||
|
||||
## 2.1.5
|
||||
|
||||
### Fixes
|
||||
- drop -mod=mod instructions; fixes #1026 [6ad7138]
|
||||
- Ensure `CurrentSpecReport` and `AddReportEntry` are thread-safe [817c09b]
|
||||
- remove stale importmap gcflags flag test [3cd8b93]
|
||||
- Always emit spec summary [5cf23e2] - even when only one spec has failed
|
||||
- Fix ReportAfterSuite usage in docs [b1864ad]
|
||||
- fixed typo (#997) [219cc00]
|
||||
- TrimRight is not designed to trim Suffix [71ebb74]
|
||||
- refactor: replace strings.Replace with strings.ReplaceAll (#978) [143d208]
|
||||
- fix syntax in examples (#975) [b69554f]
|
||||
|
||||
### Maintenance
|
||||
- Bump github.com/onsi/gomega from 1.20.0 to 1.20.1 (#1027) [e5dfce4]
|
||||
- Bump tzinfo from 1.2.9 to 1.2.10 in /docs (#1006) [7ae91c4]
|
||||
- Bump github.com/onsi/gomega from 1.19.0 to 1.20.0 (#1005) [e87a85a]
|
||||
- test: add new Go 1.19 to test matrix (#1014) [bbefe12]
|
||||
- Bump golang.org/x/tools from 0.1.11 to 0.1.12 (#1012) [9327906]
|
||||
- Bump golang.org/x/tools from 0.1.10 to 0.1.11 (#993) [f44af96]
|
||||
- Bump nokogiri from 1.13.3 to 1.13.6 in /docs (#981) [ef336aa]
|
||||
|
||||
## 2.1.4
|
||||
|
||||
### Fixes
|
||||
|
4
vendor/github.com/onsi/ginkgo/v2/core_dsl.go
generated
vendored
4
vendor/github.com/onsi/ginkgo/v2/core_dsl.go
generated
vendored
@@ -630,7 +630,7 @@ func JustAfterEach(args ...interface{}) bool {
|
||||
}
|
||||
|
||||
/*
|
||||
BeforeAll nodes are Setup nodes that can occur inside Ordered contaienrs. They run just once before any specs in the Ordered container run.
|
||||
BeforeAll nodes are Setup nodes that can occur inside Ordered containers. They run just once before any specs in the Ordered container run.
|
||||
|
||||
Multiple BeforeAll nodes can be defined in a given Ordered container however they cannot be nested inside any other container.
|
||||
|
||||
@@ -643,7 +643,7 @@ func BeforeAll(args ...interface{}) bool {
|
||||
}
|
||||
|
||||
/*
|
||||
AfterAll nodes are Setup nodes that can occur inside Ordered contaienrs. They run just once after all specs in the Ordered container have run.
|
||||
AfterAll nodes are Setup nodes that can occur inside Ordered containers. They run just once after all specs in the Ordered container have run.
|
||||
|
||||
Multiple AfterAll nodes can be defined in a given Ordered container however they cannot be nested inside any other container.
|
||||
|
||||
|
6
vendor/github.com/onsi/ginkgo/v2/decorator_dsl.go
generated
vendored
6
vendor/github.com/onsi/ginkgo/v2/decorator_dsl.go
generated
vendored
@@ -80,3 +80,9 @@ Labels are the type for spec Label decorators. Use Label(...) to construct Labe
|
||||
You can learn more here: https://onsi.github.io/ginkgo/#spec-labels
|
||||
*/
|
||||
type Labels = internal.Labels
|
||||
|
||||
/*
|
||||
SuppressProgressReporting is a decorator that allows you to disable progress reporting of a particular node. This is useful if `ginkgo -v -progress` is generating too much noise; particularly
|
||||
if you have a `ReportAfterEach` node that is running for every skipped spec and is generating lots of progress reports.
|
||||
*/
|
||||
const SuppressProgressReporting = internal.SuppressProgressReporting
|
||||
|
6
vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_command.go
generated
vendored
6
vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generate_command.go
generated
vendored
@@ -136,8 +136,8 @@ func generateTestFileForSubject(subject string, conf GeneratorsConfig) {
|
||||
}
|
||||
|
||||
func formatSubject(name string) string {
|
||||
name = strings.Replace(name, "-", "_", -1)
|
||||
name = strings.Replace(name, " ", "_", -1)
|
||||
name = strings.ReplaceAll(name, "-", "_")
|
||||
name = strings.ReplaceAll(name, " ", "_")
|
||||
name = strings.Split(name, ".go")[0]
|
||||
name = strings.Split(name, "_test")[0]
|
||||
return name
|
||||
@@ -223,7 +223,7 @@ func getPackageImportPath() string {
|
||||
if modRoot != "" {
|
||||
modName := moduleName(modRoot)
|
||||
if modName != "" {
|
||||
cd := strings.Replace(workingDir, modRoot, "", -1)
|
||||
cd := strings.ReplaceAll(workingDir, modRoot, "")
|
||||
cd = strings.ReplaceAll(cd, sep, "/")
|
||||
return modName + cd
|
||||
}
|
||||
|
10
vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generators_common.go
generated
vendored
10
vendor/github.com/onsi/ginkgo/v2/ginkgo/generators/generators_common.go
generated
vendored
@@ -19,8 +19,8 @@ func getPackageAndFormattedName() (string, string, string) {
|
||||
path, err := os.Getwd()
|
||||
command.AbortIfError("Could not get current working directory:", err)
|
||||
|
||||
dirName := strings.Replace(filepath.Base(path), "-", "_", -1)
|
||||
dirName = strings.Replace(dirName, " ", "_", -1)
|
||||
dirName := strings.ReplaceAll(filepath.Base(path), "-", "_")
|
||||
dirName = strings.ReplaceAll(dirName, " ", "_")
|
||||
|
||||
pkg, err := build.ImportDir(path, 0)
|
||||
packageName := pkg.Name
|
||||
@@ -47,10 +47,10 @@ func ensureLegalPackageName(name string) string {
|
||||
}
|
||||
|
||||
func prettifyName(name string) string {
|
||||
name = strings.Replace(name, "-", " ", -1)
|
||||
name = strings.Replace(name, "_", " ", -1)
|
||||
name = strings.ReplaceAll(name, "-", " ")
|
||||
name = strings.ReplaceAll(name, "_", " ")
|
||||
name = strings.Title(name)
|
||||
name = strings.Replace(name, " ", "", -1)
|
||||
name = strings.ReplaceAll(name, " ", "")
|
||||
return name
|
||||
}
|
||||
|
||||
|
4
vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.go
generated
vendored
4
vendor/github.com/onsi/ginkgo/v2/ginkgo/internal/run.go
generated
vendored
@@ -330,8 +330,8 @@ func runAfterRunHook(command string, noColor bool, suite TestSuite) {
|
||||
if suite.State.Is(TestSuiteStatePassed) {
|
||||
passed = "[PASS]"
|
||||
}
|
||||
command = strings.Replace(command, "(ginkgo-suite-passed)", passed, -1)
|
||||
command = strings.Replace(command, "(ginkgo-suite-name)", suite.PackageName, -1)
|
||||
command = strings.ReplaceAll(command, "(ginkgo-suite-passed)", passed)
|
||||
command = strings.ReplaceAll(command, "(ginkgo-suite-name)", suite.PackageName)
|
||||
|
||||
// Must break command into parts
|
||||
splitArgs := regexp.MustCompile(`'.+'|".+"|\S+`)
|
||||
|
59
vendor/github.com/onsi/ginkgo/v2/internal/node.go
generated
vendored
59
vendor/github.com/onsi/ginkgo/v2/internal/node.go
generated
vendored
@@ -40,13 +40,14 @@ type Node struct {
|
||||
ReportEachBody func(types.SpecReport)
|
||||
ReportAfterSuiteBody func(types.Report)
|
||||
|
||||
MarkedFocus bool
|
||||
MarkedPending bool
|
||||
MarkedSerial bool
|
||||
MarkedOrdered bool
|
||||
MarkedOncePerOrdered bool
|
||||
FlakeAttempts int
|
||||
Labels Labels
|
||||
MarkedFocus bool
|
||||
MarkedPending bool
|
||||
MarkedSerial bool
|
||||
MarkedOrdered bool
|
||||
MarkedOncePerOrdered bool
|
||||
MarkedSuppressProgressReporting bool
|
||||
FlakeAttempts int
|
||||
Labels Labels
|
||||
|
||||
NodeIDWhereCleanupWasGenerated uint
|
||||
}
|
||||
@@ -57,12 +58,14 @@ type pendingType bool
|
||||
type serialType bool
|
||||
type orderedType bool
|
||||
type honorsOrderedType bool
|
||||
type suppressProgressReporting bool
|
||||
|
||||
const Focus = focusType(true)
|
||||
const Pending = pendingType(true)
|
||||
const Serial = serialType(true)
|
||||
const Ordered = orderedType(true)
|
||||
const OncePerOrdered = honorsOrderedType(true)
|
||||
const SuppressProgressReporting = suppressProgressReporting(true)
|
||||
|
||||
type FlakeAttempts uint
|
||||
type Offset uint
|
||||
@@ -114,6 +117,8 @@ func isDecoration(arg interface{}) bool {
|
||||
return true
|
||||
case t == reflect.TypeOf(OncePerOrdered):
|
||||
return true
|
||||
case t == reflect.TypeOf(SuppressProgressReporting):
|
||||
return true
|
||||
case t == reflect.TypeOf(FlakeAttempts(0)):
|
||||
return true
|
||||
case t == reflect.TypeOf(Labels{}):
|
||||
@@ -176,7 +181,6 @@ func NewNode(deprecationTracker *types.DeprecationTracker, nodeType types.NodeTy
|
||||
remainingArgs = []interface{}{}
|
||||
//now process the rest of the args
|
||||
for _, arg := range args {
|
||||
|
||||
switch t := reflect.TypeOf(arg); {
|
||||
case t == reflect.TypeOf(float64(0)):
|
||||
break //ignore deprecated timeouts
|
||||
@@ -205,6 +209,11 @@ func NewNode(deprecationTracker *types.DeprecationTracker, nodeType types.NodeTy
|
||||
if !nodeType.Is(types.NodeTypeBeforeEach | types.NodeTypeJustBeforeEach | types.NodeTypeAfterEach | types.NodeTypeJustAfterEach) {
|
||||
appendError(types.GinkgoErrors.InvalidDecoratorForNodeType(node.CodeLocation, nodeType, "OncePerOrdered"))
|
||||
}
|
||||
case t == reflect.TypeOf(SuppressProgressReporting):
|
||||
node.MarkedSuppressProgressReporting = bool(arg.(suppressProgressReporting))
|
||||
if nodeType.Is(types.NodeTypeContainer) {
|
||||
appendError(types.GinkgoErrors.InvalidDecoratorForNodeType(node.CodeLocation, nodeType, "SuppressProgressReporting"))
|
||||
}
|
||||
case t == reflect.TypeOf(FlakeAttempts(0)):
|
||||
node.FlakeAttempts = int(arg.(FlakeAttempts))
|
||||
if !nodeType.Is(types.NodeTypesForContainerAndIt) {
|
||||
@@ -223,6 +232,18 @@ func NewNode(deprecationTracker *types.DeprecationTracker, nodeType types.NodeTy
|
||||
}
|
||||
}
|
||||
case t.Kind() == reflect.Func:
|
||||
if nodeType.Is(types.NodeTypeReportBeforeEach | types.NodeTypeReportAfterEach) {
|
||||
if node.ReportEachBody != nil {
|
||||
appendError(types.GinkgoErrors.MultipleBodyFunctions(node.CodeLocation, nodeType))
|
||||
trackedFunctionError = true
|
||||
break
|
||||
}
|
||||
|
||||
//we can trust that the function is valid because the compiler has our back here
|
||||
node.ReportEachBody = arg.(func(types.SpecReport))
|
||||
break
|
||||
}
|
||||
|
||||
if node.Body != nil {
|
||||
appendError(types.GinkgoErrors.MultipleBodyFunctions(node.CodeLocation, nodeType))
|
||||
trackedFunctionError = true
|
||||
@@ -251,7 +272,7 @@ func NewNode(deprecationTracker *types.DeprecationTracker, nodeType types.NodeTy
|
||||
appendError(types.GinkgoErrors.InvalidDeclarationOfFocusedAndPending(node.CodeLocation, nodeType))
|
||||
}
|
||||
|
||||
if node.Body == nil && !node.MarkedPending && !trackedFunctionError {
|
||||
if node.Body == nil && node.ReportEachBody == nil && !node.MarkedPending && !trackedFunctionError {
|
||||
appendError(types.GinkgoErrors.MissingBodyFunction(node.CodeLocation, nodeType))
|
||||
}
|
||||
for _, arg := range remainingArgs {
|
||||
@@ -285,26 +306,6 @@ func NewSynchronizedAfterSuiteNode(allProcsBody func(), proc1Body func(), codeLo
|
||||
}, nil
|
||||
}
|
||||
|
||||
func NewReportBeforeEachNode(body func(types.SpecReport), codeLocation types.CodeLocation) (Node, []error) {
|
||||
return Node{
|
||||
ID: UniqueNodeID(),
|
||||
NodeType: types.NodeTypeReportBeforeEach,
|
||||
ReportEachBody: body,
|
||||
CodeLocation: codeLocation,
|
||||
NestingLevel: -1,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func NewReportAfterEachNode(body func(types.SpecReport), codeLocation types.CodeLocation) (Node, []error) {
|
||||
return Node{
|
||||
ID: UniqueNodeID(),
|
||||
NodeType: types.NodeTypeReportAfterEach,
|
||||
ReportEachBody: body,
|
||||
CodeLocation: codeLocation,
|
||||
NestingLevel: -1,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func NewReportAfterSuiteNode(text string, body func(types.Report), codeLocation types.CodeLocation) (Node, []error) {
|
||||
return Node{
|
||||
ID: UniqueNodeID(),
|
||||
|
23
vendor/github.com/onsi/ginkgo/v2/internal/suite.go
generated
vendored
23
vendor/github.com/onsi/ginkgo/v2/internal/suite.go
generated
vendored
@@ -2,6 +2,7 @@ package internal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/onsi/ginkgo/v2/formatter"
|
||||
@@ -35,18 +36,20 @@ type Suite struct {
|
||||
interruptHandler interrupt_handler.InterruptHandlerInterface
|
||||
config types.SuiteConfig
|
||||
|
||||
skipAll bool
|
||||
report types.Report
|
||||
currentSpecReport types.SpecReport
|
||||
currentNode Node
|
||||
skipAll bool
|
||||
report types.Report
|
||||
currentSpecReport types.SpecReport
|
||||
currentSpecReportUserAccessLock *sync.Mutex
|
||||
currentNode Node
|
||||
|
||||
client parallel_support.Client
|
||||
}
|
||||
|
||||
func NewSuite() *Suite {
|
||||
return &Suite{
|
||||
tree: &TreeNode{},
|
||||
phase: PhaseBuildTopLevel,
|
||||
tree: &TreeNode{},
|
||||
phase: PhaseBuildTopLevel,
|
||||
currentSpecReportUserAccessLock: &sync.Mutex{},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,14 +215,20 @@ func (suite *Suite) pushCleanupNode(node Node) error {
|
||||
Spec Running methods - used during PhaseRun
|
||||
*/
|
||||
func (suite *Suite) CurrentSpecReport() types.SpecReport {
|
||||
suite.currentSpecReportUserAccessLock.Lock()
|
||||
defer suite.currentSpecReportUserAccessLock.Unlock()
|
||||
report := suite.currentSpecReport
|
||||
if suite.writer != nil {
|
||||
report.CapturedGinkgoWriterOutput = string(suite.writer.Bytes())
|
||||
}
|
||||
report.ReportEntries = make([]ReportEntry, len(report.ReportEntries))
|
||||
copy(report.ReportEntries, suite.currentSpecReport.ReportEntries)
|
||||
return report
|
||||
}
|
||||
|
||||
func (suite *Suite) AddReportEntry(entry ReportEntry) error {
|
||||
suite.currentSpecReportUserAccessLock.Lock()
|
||||
defer suite.currentSpecReportUserAccessLock.Unlock()
|
||||
if suite.phase != PhaseRun {
|
||||
return types.GinkgoErrors.AddReportEntryNotDuringRunPhase(entry.Location)
|
||||
}
|
||||
@@ -560,7 +569,7 @@ func (suite *Suite) runNode(node Node, interruptChannel chan interface{}, text s
|
||||
suite.currentNode = Node{}
|
||||
}()
|
||||
|
||||
if suite.config.EmitSpecProgress {
|
||||
if suite.config.EmitSpecProgress && !node.MarkedSuppressProgressReporting {
|
||||
if text == "" {
|
||||
text = "TOP-LEVEL"
|
||||
}
|
||||
|
8
vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go
generated
vendored
8
vendor/github.com/onsi/ginkgo/v2/reporters/default_reporter.go
generated
vendored
@@ -251,9 +251,13 @@ func (r *DefaultReporter) DidRun(report types.SpecReport) {
|
||||
|
||||
func (r *DefaultReporter) SuiteDidEnd(report types.Report) {
|
||||
failures := report.SpecReports.WithState(types.SpecStateFailureStates)
|
||||
if len(failures) > 1 {
|
||||
if len(failures) > 0 {
|
||||
r.emitBlock("\n\n")
|
||||
r.emitBlock(r.f("{{red}}{{bold}}Summarizing %d Failures:{{/}}", len(failures)))
|
||||
if len(failures) > 1 {
|
||||
r.emitBlock(r.f("{{red}}{{bold}}Summarizing %d Failures:{{/}}", len(failures)))
|
||||
} else {
|
||||
r.emitBlock(r.f("{{red}}{{bold}}Summarizing 1 Failure:{{/}}"))
|
||||
}
|
||||
for _, specReport := range failures {
|
||||
highlightColor, heading := "{{red}}", "[FAIL]"
|
||||
switch specReport.State {
|
||||
|
12
vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go
generated
vendored
12
vendor/github.com/onsi/ginkgo/v2/reporters/teamcity_report.go
generated
vendored
@@ -17,12 +17,12 @@ import (
|
||||
)
|
||||
|
||||
func tcEscape(s string) string {
|
||||
s = strings.Replace(s, "|", "||", -1)
|
||||
s = strings.Replace(s, "'", "|'", -1)
|
||||
s = strings.Replace(s, "\n", "|n", -1)
|
||||
s = strings.Replace(s, "\r", "|r", -1)
|
||||
s = strings.Replace(s, "[", "|[", -1)
|
||||
s = strings.Replace(s, "]", "|]", -1)
|
||||
s = strings.ReplaceAll(s, "|", "||")
|
||||
s = strings.ReplaceAll(s, "'", "|'")
|
||||
s = strings.ReplaceAll(s, "\n", "|n")
|
||||
s = strings.ReplaceAll(s, "\r", "|r")
|
||||
s = strings.ReplaceAll(s, "[", "|[")
|
||||
s = strings.ReplaceAll(s, "]", "|]")
|
||||
return s
|
||||
}
|
||||
|
||||
|
14
vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go
generated
vendored
14
vendor/github.com/onsi/ginkgo/v2/reporting_dsl.go
generated
vendored
@@ -79,8 +79,11 @@ receives a SpecReport. They are called before the spec starts.
|
||||
You cannot nest any other Ginkgo nodes within a ReportBeforeEach node's closure.
|
||||
You can learn more about ReportBeforeEach here: https://onsi.github.io/ginkgo/#generating-reports-programmatically
|
||||
*/
|
||||
func ReportBeforeEach(body func(SpecReport)) bool {
|
||||
return pushNode(internal.NewReportBeforeEachNode(body, types.NewCodeLocation(1)))
|
||||
func ReportBeforeEach(body func(SpecReport), args ...interface{}) bool {
|
||||
combinedArgs := []interface{}{body}
|
||||
combinedArgs = append(combinedArgs, args...)
|
||||
|
||||
return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeReportBeforeEach, "", combinedArgs...))
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -90,8 +93,11 @@ receives a SpecReport. They are called after the spec has completed and receive
|
||||
You cannot nest any other Ginkgo nodes within a ReportAfterEach node's closure.
|
||||
You can learn more about ReportAfterEach here: https://onsi.github.io/ginkgo/#generating-reports-programmatically
|
||||
*/
|
||||
func ReportAfterEach(body func(SpecReport)) bool {
|
||||
return pushNode(internal.NewReportAfterEachNode(body, types.NewCodeLocation(1)))
|
||||
func ReportAfterEach(body func(SpecReport), args ...interface{}) bool {
|
||||
combinedArgs := []interface{}{body}
|
||||
combinedArgs = append(combinedArgs, args...)
|
||||
|
||||
return pushNode(internal.NewNode(deprecationTracker, types.NodeTypeReportAfterEach, "", combinedArgs...))
|
||||
}
|
||||
|
||||
/*
|
||||
|
2
vendor/github.com/onsi/ginkgo/v2/types/code_location.go
generated
vendored
2
vendor/github.com/onsi/ginkgo/v2/types/code_location.go
generated
vendored
@@ -65,7 +65,7 @@ func NewCodeLocationWithStackTrace(skip int) CodeLocation {
|
||||
func PruneStack(fullStackTrace string, skip int) string {
|
||||
stack := strings.Split(fullStackTrace, "\n")
|
||||
// Ensure that the even entries are the method names and the
|
||||
// the odd entries the source code information.
|
||||
// odd entries the source code information.
|
||||
if len(stack) > 0 && strings.HasPrefix(stack[0], "goroutine ") {
|
||||
// Ignore "goroutine 29 [running]:" line.
|
||||
stack = stack[1:]
|
||||
|
2
vendor/github.com/onsi/ginkgo/v2/types/version.go
generated
vendored
2
vendor/github.com/onsi/ginkgo/v2/types/version.go
generated
vendored
@@ -1,3 +1,3 @@
|
||||
package types
|
||||
|
||||
const VERSION = "2.1.4"
|
||||
const VERSION = "2.1.6"
|
||||
|
Reference in New Issue
Block a user