Merge pull request #6859 from containers/dependabot/go_modules/github.com/onsi/ginkgo-1.14.0

Bump github.com/onsi/ginkgo from 1.13.0 to 1.14.0
This commit is contained in:
OpenShift Merge Robot
2020-07-06 10:09:10 -04:00
committed by GitHub
12 changed files with 68 additions and 25 deletions

2
go.mod
View File

@ -35,7 +35,7 @@ require (
github.com/hpcloud/tail v1.0.0 github.com/hpcloud/tail v1.0.0
github.com/json-iterator/go v1.1.10 github.com/json-iterator/go v1.1.10
github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618 github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618
github.com/onsi/ginkgo v1.13.0 github.com/onsi/ginkgo v1.14.0
github.com/onsi/gomega v1.10.1 github.com/onsi/gomega v1.10.1
github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6 github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6

2
go.sum
View File

@ -308,6 +308,8 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y= github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y=
github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0=
github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=

View File

@ -1,3 +1,11 @@
## 1.14.0
### Features
- Defer running top-level container nodes until RunSpecs is called [d44dedf]
- [Document Ginkgo lifecycle](http://onsi.github.io/ginkgo/#understanding-ginkgos-lifecycle)
- Add `extensions/globals` package (#692) [3295c8f] - this can be helpful in contexts where you are test-driving your test-generation code (see [#692](https://github.com/onsi/ginkgo/pull/692))
- Print Skip reason in JUnit reporter if one was provided [820dfab]
## 1.13.0 ## 1.13.0
### Features ### Features

View File

@ -1,7 +1,7 @@
/* /*
Ginkgo accepts a number of configuration options. Ginkgo accepts a number of configuration options.
These are documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli) These are documented [here](http://onsi.github.io/ginkgo/#the-ginkgo-cli)
You can also learn more via You can also learn more via
@ -20,7 +20,7 @@ import (
"fmt" "fmt"
) )
const VERSION = "1.13.0" const VERSION = "1.14.0"
type GinkgoConfigType struct { type GinkgoConfigType struct {
RandomSeed int64 RandomSeed int64

View File

@ -21,12 +21,6 @@ type TableEntry struct {
} }
func (t TableEntry) generateIt(itBody reflect.Value) { func (t TableEntry) generateIt(itBody reflect.Value) {
if t.codeLocation == (types.CodeLocation{}) {
// The user created the TableEntry struct directly instead of having used the (F/P/X)Entry constructors.
// Therefore default to the code location of the surrounding DescribeTable.
t.codeLocation = codelocation.New(5)
}
var description string var description string
descriptionValue := reflect.ValueOf(t.Description) descriptionValue := reflect.ValueOf(t.Description)
switch descriptionValue.Kind() { switch descriptionValue.Kind() {

View File

@ -6,6 +6,7 @@ import (
) )
var ginkgoAndGomegaFilter = regexp.MustCompile(`github\.com/onsi/ginkgo|github\.com/onsi/gomega`) var ginkgoAndGomegaFilter = regexp.MustCompile(`github\.com/onsi/ginkgo|github\.com/onsi/gomega`)
var ginkgoIntegrationTestFilter = regexp.MustCompile(`github\.com/onsi/ginkgo/integration`) //allow us to integration test this thing
type Dependencies struct { type Dependencies struct {
deps map[string]int deps map[string]int
@ -77,7 +78,7 @@ func (d Dependencies) resolveAndAdd(deps []string, depth int) {
if err != nil { if err != nil {
continue continue
} }
if !pkg.Goroot && !ginkgoAndGomegaFilter.Match([]byte(pkg.Dir)) { if !pkg.Goroot && (!ginkgoAndGomegaFilter.Match([]byte(pkg.Dir)) || ginkgoIntegrationTestFilter.Match([]byte(pkg.Dir))) {
d.addDepIfNotPresent(pkg.Dir, depth) d.addDepIfNotPresent(pkg.Dir, depth)
} }
} }

View File

@ -4,7 +4,6 @@ require (
github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/nxadm/tail v1.4.4 github.com/nxadm/tail v1.4.4
github.com/onsi/gomega v1.10.1 github.com/onsi/gomega v1.10.1
github.com/sclevine/agouti v3.0.0+incompatible // indirect
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 golang.org/x/sys v0.0.0-20200519105757-fe76b779f299
golang.org/x/text v0.3.2 // indirect golang.org/x/text v0.3.2 // indirect
) )

View File

@ -25,8 +25,6 @@ github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/sclevine/agouti v3.0.0+incompatible h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4=
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=

View File

@ -13,6 +13,10 @@ var Suite *suite.Suite
var Failer *failer.Failer var Failer *failer.Failer
func init() { func init() {
InitializeGlobals()
}
func InitializeGlobals() {
Failer = failer.New() Failer = failer.New()
Suite = suite.New(Failer) Suite = suite.New(Failer)
} }

View File

@ -22,25 +22,37 @@ type ginkgoTestingT interface {
Fail() Fail()
} }
type deferredContainerNode struct {
text string
body func()
flag types.FlagType
codeLocation types.CodeLocation
}
type Suite struct { type Suite struct {
topLevelContainer *containernode.ContainerNode topLevelContainer *containernode.ContainerNode
currentContainer *containernode.ContainerNode currentContainer *containernode.ContainerNode
containerIndex int
beforeSuiteNode leafnodes.SuiteNode deferredContainerNodes []deferredContainerNode
afterSuiteNode leafnodes.SuiteNode
runner *specrunner.SpecRunner containerIndex int
failer *failer.Failer beforeSuiteNode leafnodes.SuiteNode
running bool afterSuiteNode leafnodes.SuiteNode
runner *specrunner.SpecRunner
failer *failer.Failer
running bool
expandTopLevelNodes bool
} }
func New(failer *failer.Failer) *Suite { func New(failer *failer.Failer) *Suite {
topLevelContainer := containernode.New("[Top Level]", types.FlagTypeNone, types.CodeLocation{}) topLevelContainer := containernode.New("[Top Level]", types.FlagTypeNone, types.CodeLocation{})
return &Suite{ return &Suite{
topLevelContainer: topLevelContainer, topLevelContainer: topLevelContainer,
currentContainer: topLevelContainer, currentContainer: topLevelContainer,
failer: failer, failer: failer,
containerIndex: 1, 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") 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)) r := rand.New(rand.NewSource(config.RandomSeed))
suite.topLevelContainer.Shuffle(r) suite.topLevelContainer.Shuffle(r)
iterator, hasProgrammaticFocus := suite.generateSpecsIterator(description, config) iterator, hasProgrammaticFocus := suite.generateSpecsIterator(description, config)
@ -137,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) { 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) container := containernode.New(text, flag, codeLocation)
suite.currentContainer.PushContainerNode(container) suite.currentContainer.PushContainerNode(container)

View File

@ -50,7 +50,7 @@ type JUnitFailureMessage struct {
} }
type JUnitSkipped struct { type JUnitSkipped struct {
XMLName xml.Name `xml:"skipped"` Message string `xml:",chardata"`
} }
type JUnitReporter struct { type JUnitReporter struct {
@ -132,6 +132,9 @@ func (reporter *JUnitReporter) SpecDidComplete(specSummary *types.SpecSummary) {
} }
if specSummary.State == types.SpecStateSkipped || specSummary.State == types.SpecStatePending { if specSummary.State == types.SpecStateSkipped || specSummary.State == types.SpecStatePending {
testCase.Skipped = &JUnitSkipped{} testCase.Skipped = &JUnitSkipped{}
if specSummary.Failure.Message != "" {
testCase.Skipped.Message = failureMessage(specSummary.Failure)
}
} }
testCase.Time = specSummary.RunTime.Seconds() testCase.Time = specSummary.RunTime.Seconds()
reporter.suite.TestCases = append(reporter.suite.TestCases, testCase) reporter.suite.TestCases = append(reporter.suite.TestCases, testCase)

2
vendor/modules.txt vendored
View File

@ -362,7 +362,7 @@ github.com/nxadm/tail/ratelimiter
github.com/nxadm/tail/util github.com/nxadm/tail/util
github.com/nxadm/tail/watch github.com/nxadm/tail/watch
github.com/nxadm/tail/winfile github.com/nxadm/tail/winfile
# github.com/onsi/ginkgo v1.13.0 # github.com/onsi/ginkgo v1.14.0
github.com/onsi/ginkgo github.com/onsi/ginkgo
github.com/onsi/ginkgo/config github.com/onsi/ginkgo/config
github.com/onsi/ginkgo/extensions/table github.com/onsi/ginkgo/extensions/table