rebase: update packages in go.mod to latest releases

updated few packages in go.mod to latest
available release.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2021-06-04 14:29:18 +05:30
committed by mergify[bot]
parent 0f44c6acb7
commit fb7dc13dfe
590 changed files with 28243 additions and 6376 deletions

22
vendor/github.com/onsi/ginkgo/internal/global/init.go generated vendored Normal file
View File

@ -0,0 +1,22 @@
package global
import (
"time"
"github.com/onsi/ginkgo/internal/failer"
"github.com/onsi/ginkgo/internal/suite"
)
const DefaultTimeout = time.Duration(1 * time.Second)
var Suite *suite.Suite
var Failer *failer.Failer
func init() {
InitializeGlobals()
}
func InitializeGlobals() {
Failer = failer.New()
Suite = suite.New(Failer)
}

View File

@ -197,11 +197,11 @@ func (aggregator *Aggregator) announceSpec(specSummary *types.SpecSummary) {
switch specSummary.State {
case types.SpecStatePassed:
if specSummary.IsMeasurement {
aggregator.stenographer.AnnounceSuccesfulMeasurement(specSummary, aggregator.config.Succinct)
aggregator.stenographer.AnnounceSuccessfulMeasurement(specSummary, aggregator.config.Succinct)
} else if specSummary.RunTime.Seconds() >= aggregator.config.SlowSpecThreshold {
aggregator.stenographer.AnnounceSuccesfulSlowSpec(specSummary, aggregator.config.Succinct)
aggregator.stenographer.AnnounceSuccessfulSlowSpec(specSummary, aggregator.config.Succinct)
} else {
aggregator.stenographer.AnnounceSuccesfulSpec(specSummary)
aggregator.stenographer.AnnounceSuccessfulSpec(specSummary)
}
case types.SpecStatePending:

View File

@ -7,7 +7,8 @@ import (
"io/ioutil"
"os"
"github.com/hpcloud/tail"
"github.com/nxadm/tail"
"golang.org/x/sys/unix"
)
func NewOutputInterceptor() OutputInterceptor {
@ -35,12 +36,10 @@ func (interceptor *outputInterceptor) StartInterceptingOutput() error {
return err
}
// Call a function in ./syscall_dup_*.go
// If building for everything other than linux_arm64,
// use a "normal" syscall.Dup2(oldfd, newfd) call. If building for linux_arm64 (which doesn't have syscall.Dup2)
// call syscall.Dup3(oldfd, newfd, 0). They are nearly identical, see: http://linux.die.net/man/2/dup3
syscallDup(int(interceptor.redirectFile.Fd()), 1)
syscallDup(int(interceptor.redirectFile.Fd()), 2)
// This might call Dup3 if the dup2 syscall is not available, e.g. on
// linux/arm64 or linux/riscv64
unix.Dup2(int(interceptor.redirectFile.Fd()), 1)
unix.Dup2(int(interceptor.redirectFile.Fd()), 2)
if interceptor.streamTarget != nil {
interceptor.tailer, _ = tail.TailFile(interceptor.redirectFile.Name(), tail.Config{Follow: true})

View File

@ -1,11 +0,0 @@
// +build linux,arm64
package remote
import "syscall"
// linux_arm64 doesn't have syscall.Dup2 which ginkgo uses, so
// use the nearly identical syscall.Dup3 instead
func syscallDup(oldfd int, newfd int) (err error) {
return syscall.Dup3(oldfd, newfd, 0)
}

View File

@ -1,11 +0,0 @@
// +build linux,riscv64
package remote
import "syscall"
// linux_riscv64 doesn't have syscall.Dup2 which ginkgo uses, so
// use the nearly identical syscall.Dup3 instead
func syscallDup(oldfd int, newfd int) (err error) {
return syscall.Dup3(oldfd, newfd, 0)
}

View File

@ -1,9 +0,0 @@
// +build solaris
package remote
import "golang.org/x/sys/unix"
func syscallDup(oldfd int, newfd int) (err error) {
return unix.Dup2(oldfd, newfd)
}

View File

@ -1,12 +0,0 @@
// +build !linux !arm64
// +build !linux !riscv64
// +build !windows
// +build !solaris
package remote
import "syscall"
func syscallDup(oldfd int, newfd int) (err error) {
return syscall.Dup2(oldfd, newfd)
}

View File

@ -4,6 +4,7 @@ import (
"math/rand"
"regexp"
"sort"
"strings"
)
type Specs struct {
@ -46,11 +47,11 @@ func (e *Specs) Shuffle(r *rand.Rand) {
e.names = names
}
func (e *Specs) ApplyFocus(description string, focusString string, skipString string) {
if focusString == "" && skipString == "" {
func (e *Specs) ApplyFocus(description string, focus, skip []string) {
if len(focus)+len(skip) == 0 {
e.applyProgrammaticFocus()
} else {
e.applyRegExpFocusAndSkip(description, focusString, skipString)
e.applyRegExpFocusAndSkip(description, focus, skip)
}
}
@ -90,14 +91,13 @@ func (e *Specs) toMatch(description string, i int) []byte {
}
}
func (e *Specs) applyRegExpFocusAndSkip(description string, focusString string, skipString string) {
var focusFilter *regexp.Regexp
if focusString != "" {
focusFilter = regexp.MustCompile(focusString)
func (e *Specs) applyRegExpFocusAndSkip(description string, focus, skip []string) {
var focusFilter, skipFilter *regexp.Regexp
if len(focus) > 0 {
focusFilter = regexp.MustCompile(strings.Join(focus, "|"))
}
var skipFilter *regexp.Regexp
if skipString != "" {
skipFilter = regexp.MustCompile(skipString)
if len(skip) > 0 {
skipFilter = regexp.MustCompile(strings.Join(skip, "|"))
}
for i, spec := range e.specs {

View File

@ -22,25 +22,37 @@ type ginkgoTestingT interface {
Fail()
}
type deferredContainerNode struct {
text string
body func()
flag types.FlagType
codeLocation types.CodeLocation
}
type Suite struct {
topLevelContainer *containernode.ContainerNode
currentContainer *containernode.ContainerNode
containerIndex int
beforeSuiteNode leafnodes.SuiteNode
afterSuiteNode leafnodes.SuiteNode
runner *specrunner.SpecRunner
failer *failer.Failer
running bool
deferredContainerNodes []deferredContainerNode
containerIndex int
beforeSuiteNode leafnodes.SuiteNode
afterSuiteNode leafnodes.SuiteNode
runner *specrunner.SpecRunner
failer *failer.Failer
running bool
expandTopLevelNodes bool
}
func New(failer *failer.Failer) *Suite {
topLevelContainer := containernode.New("[Top Level]", types.FlagTypeNone, types.CodeLocation{})
return &Suite{
topLevelContainer: topLevelContainer,
currentContainer: topLevelContainer,
failer: failer,
containerIndex: 1,
topLevelContainer: topLevelContainer,
currentContainer: topLevelContainer,
failer: failer,
containerIndex: 1,
deferredContainerNodes: []deferredContainerNode{},
}
}
@ -53,6 +65,11 @@ func (suite *Suite) Run(t ginkgoTestingT, description string, reporters []report
panic("ginkgo.parallel.node is one-indexed and must be <= ginkgo.parallel.total")
}
suite.expandTopLevelNodes = true
for _, deferredNode := range suite.deferredContainerNodes {
suite.PushContainerNode(deferredNode.text, deferredNode.body, deferredNode.flag, deferredNode.codeLocation)
}
r := rand.New(rand.NewSource(config.RandomSeed))
suite.topLevelContainer.Shuffle(r)
iterator, hasProgrammaticFocus := suite.generateSpecsIterator(description, config)
@ -80,7 +97,7 @@ func (suite *Suite) generateSpecsIterator(description string, config config.Gink
specs.Shuffle(rand.New(rand.NewSource(config.RandomSeed)))
}
specs.ApplyFocus(description, config.FocusString, config.SkipString)
specs.ApplyFocus(description, config.FocusStrings, config.SkipStrings)
if config.SkipMeasurements {
specs.SkipMeasurements()
@ -102,6 +119,9 @@ func (suite *Suite) generateSpecsIterator(description string, config config.Gink
}
func (suite *Suite) CurrentRunningSpecSummary() (*types.SpecSummary, bool) {
if !suite.running {
return nil, false
}
return suite.runner.CurrentSpecSummary()
}
@ -134,6 +154,23 @@ func (suite *Suite) SetSynchronizedAfterSuiteNode(bodyA interface{}, bodyB inter
}
func (suite *Suite) PushContainerNode(text string, body func(), flag types.FlagType, codeLocation types.CodeLocation) {
/*
We defer walking the container nodes (which immediately evaluates the `body` function)
until `RunSpecs` is called. We do this by storing off the deferred container nodes. Then, when
`RunSpecs` is called we actually go through and add the container nodes to the test structure.
This allows us to defer calling all the `body` functions until _after_ the top level functions
have been walked, _after_ func init()s have been called, and _after_ `go test` has called `flag.Parse()`.
This allows users to load up configuration information in the `TestX` go test hook just before `RunSpecs`
is invoked and solves issues like #693 and makes the lifecycle easier to reason about.
*/
if !suite.expandTopLevelNodes {
suite.deferredContainerNodes = append(suite.deferredContainerNodes, deferredContainerNode{text, body, flag, codeLocation})
return
}
container := containernode.New(text, flag, codeLocation)
suite.currentContainer.PushContainerNode(container)

View File

@ -6,21 +6,34 @@ import (
)
type failFunc func(message string, callerSkip ...int)
type skipFunc func(message string, callerSkip ...int)
type failedFunc func() bool
type nameFunc func() string
func New(writer io.Writer, fail failFunc, offset int) *ginkgoTestingTProxy {
func New(writer io.Writer, fail failFunc, skip skipFunc, failed failedFunc, name nameFunc, offset int) *ginkgoTestingTProxy {
return &ginkgoTestingTProxy{
fail: fail,
offset: offset,
writer: writer,
skip: skip,
failed: failed,
name: name,
}
}
type ginkgoTestingTProxy struct {
fail failFunc
skip skipFunc
failed failedFunc
name nameFunc
offset int
writer io.Writer
}
func (t *ginkgoTestingTProxy) Cleanup(func()) {
// No-op
}
func (t *ginkgoTestingTProxy) Error(args ...interface{}) {
t.fail(fmt.Sprintln(args...), t.offset)
}
@ -37,6 +50,10 @@ func (t *ginkgoTestingTProxy) FailNow() {
t.fail("failed", t.offset)
}
func (t *ginkgoTestingTProxy) Failed() bool {
return t.failed()
}
func (t *ginkgoTestingTProxy) Fatal(args ...interface{}) {
t.fail(fmt.Sprintln(args...), t.offset)
}
@ -45,6 +62,10 @@ func (t *ginkgoTestingTProxy) Fatalf(format string, args ...interface{}) {
t.fail(fmt.Sprintf(format, args...), t.offset)
}
func (t *ginkgoTestingTProxy) Helper() {
// No-op
}
func (t *ginkgoTestingTProxy) Log(args ...interface{}) {
fmt.Fprintln(t.writer, args...)
}
@ -53,24 +74,31 @@ func (t *ginkgoTestingTProxy) Logf(format string, args ...interface{}) {
t.Log(fmt.Sprintf(format, args...))
}
func (t *ginkgoTestingTProxy) Failed() bool {
return false
func (t *ginkgoTestingTProxy) Name() string {
return t.name()
}
func (t *ginkgoTestingTProxy) Parallel() {
// No-op
}
func (t *ginkgoTestingTProxy) Skip(args ...interface{}) {
fmt.Println(args...)
}
func (t *ginkgoTestingTProxy) Skipf(format string, args ...interface{}) {
t.Skip(fmt.Sprintf(format, args...))
t.skip(fmt.Sprintln(args...), t.offset)
}
func (t *ginkgoTestingTProxy) SkipNow() {
t.skip("skip", t.offset)
}
func (t *ginkgoTestingTProxy) Skipf(format string, args ...interface{}) {
t.skip(fmt.Sprintf(format, args...), t.offset)
}
func (t *ginkgoTestingTProxy) Skipped() bool {
return false
}
func (t *ginkgoTestingTProxy) TempDir() string {
// No-op
return ""
}