build(deps): bump the golang group with 5 updates
Bumps the golang group with 5 updates: | Package | From | To | | --- | --- | --- | | [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) | `0.11.4` | `0.12.0` | | [github.com/alexflint/go-filemutex](https://github.com/alexflint/go-filemutex) | `1.2.0` | `1.3.0` | | [github.com/onsi/ginkgo/v2](https://github.com/onsi/ginkgo) | `2.13.2` | `2.16.0` | | [github.com/onsi/gomega](https://github.com/onsi/gomega) | `1.30.0` | `1.31.1` | | [golang.org/x/sys](https://github.com/golang/sys) | `0.15.0` | `0.17.0` | Updates `github.com/Microsoft/hcsshim` from 0.11.4 to 0.12.0 - [Release notes](https://github.com/Microsoft/hcsshim/releases) - [Commits](https://github.com/Microsoft/hcsshim/compare/v0.11.4...v0.12.0) Updates `github.com/alexflint/go-filemutex` from 1.2.0 to 1.3.0 - [Release notes](https://github.com/alexflint/go-filemutex/releases) - [Commits](https://github.com/alexflint/go-filemutex/compare/v1.2.0...v1.3.0) Updates `github.com/onsi/ginkgo/v2` from 2.13.2 to 2.16.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.13.2...v2.16.0) Updates `github.com/onsi/gomega` from 1.30.0 to 1.31.1 - [Release notes](https://github.com/onsi/gomega/releases) - [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md) - [Commits](https://github.com/onsi/gomega/compare/v1.30.0...v1.31.1) Updates `golang.org/x/sys` from 0.15.0 to 0.17.0 - [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.17.0) --- updated-dependencies: - dependency-name: github.com/Microsoft/hcsshim dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang - dependency-name: github.com/alexflint/go-filemutex dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang - dependency-name: github.com/onsi/ginkgo/v2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang - dependency-name: github.com/onsi/gomega dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang - dependency-name: golang.org/x/sys dependency-type: direct:production update-type: version-update:semver-minor dependency-group: golang ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
113
vendor/github.com/onsi/ginkgo/v2/table_dsl.go
generated
vendored
113
vendor/github.com/onsi/ginkgo/v2/table_dsl.go
generated
vendored
@ -46,7 +46,7 @@ And can explore some Table patterns here: https://onsi.github.io/ginkgo/#table-s
|
||||
*/
|
||||
func DescribeTable(description string, args ...interface{}) bool {
|
||||
GinkgoHelper()
|
||||
generateTable(description, args...)
|
||||
generateTable(description, false, args...)
|
||||
return true
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ You can focus a table with `FDescribeTable`. This is equivalent to `FDescribe`.
|
||||
func FDescribeTable(description string, args ...interface{}) bool {
|
||||
GinkgoHelper()
|
||||
args = append(args, internal.Focus)
|
||||
generateTable(description, args...)
|
||||
generateTable(description, false, args...)
|
||||
return true
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ You can mark a table as pending with `PDescribeTable`. This is equivalent to `P
|
||||
func PDescribeTable(description string, args ...interface{}) bool {
|
||||
GinkgoHelper()
|
||||
args = append(args, internal.Pending)
|
||||
generateTable(description, args...)
|
||||
generateTable(description, false, args...)
|
||||
return true
|
||||
}
|
||||
|
||||
@ -75,6 +75,71 @@ You can mark a table as pending with `XDescribeTable`. This is equivalent to `X
|
||||
*/
|
||||
var XDescribeTable = PDescribeTable
|
||||
|
||||
/*
|
||||
DescribeTableSubtree describes a table-driven spec that generates a set of tests for each entry.
|
||||
|
||||
For example:
|
||||
|
||||
DescribeTableSubtree("a subtree table",
|
||||
func(url string, code int, message string) {
|
||||
var resp *http.Response
|
||||
BeforeEach(func() {
|
||||
var err error
|
||||
resp, err = http.Get(url)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
DeferCleanup(resp.Body.Close)
|
||||
})
|
||||
|
||||
It("should return the expected status code", func() {
|
||||
Expect(resp.StatusCode).To(Equal(code))
|
||||
})
|
||||
|
||||
It("should return the expected message", func() {
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(string(body)).To(Equal(message))
|
||||
})
|
||||
},
|
||||
Entry("default response", "example.com/response", http.StatusOK, "hello world"),
|
||||
Entry("missing response", "example.com/missing", http.StatusNotFound, "wat?"),
|
||||
)
|
||||
|
||||
Note that you **must** place define an It inside the body function.
|
||||
|
||||
You can learn more about DescribeTableSubtree here: https://onsi.github.io/ginkgo/#table-specs
|
||||
And can explore some Table patterns here: https://onsi.github.io/ginkgo/#table-specs-patterns
|
||||
*/
|
||||
func DescribeTableSubtree(description string, args ...interface{}) bool {
|
||||
GinkgoHelper()
|
||||
generateTable(description, true, args...)
|
||||
return true
|
||||
}
|
||||
|
||||
/*
|
||||
You can focus a table with `FDescribeTableSubtree`. This is equivalent to `FDescribe`.
|
||||
*/
|
||||
func FDescribeTableSubtree(description string, args ...interface{}) bool {
|
||||
GinkgoHelper()
|
||||
args = append(args, internal.Focus)
|
||||
generateTable(description, true, args...)
|
||||
return true
|
||||
}
|
||||
|
||||
/*
|
||||
You can mark a table as pending with `PDescribeTableSubtree`. This is equivalent to `PDescribe`.
|
||||
*/
|
||||
func PDescribeTableSubtree(description string, args ...interface{}) bool {
|
||||
GinkgoHelper()
|
||||
args = append(args, internal.Pending)
|
||||
generateTable(description, true, args...)
|
||||
return true
|
||||
}
|
||||
|
||||
/*
|
||||
You can mark a table as pending with `XDescribeTableSubtree`. This is equivalent to `XDescribe`.
|
||||
*/
|
||||
var XDescribeTableSubtree = PDescribeTableSubtree
|
||||
|
||||
/*
|
||||
TableEntry represents an entry in a table test. You generally use the `Entry` constructor.
|
||||
*/
|
||||
@ -131,14 +196,14 @@ var XEntry = PEntry
|
||||
var contextType = reflect.TypeOf(new(context.Context)).Elem()
|
||||
var specContextType = reflect.TypeOf(new(SpecContext)).Elem()
|
||||
|
||||
func generateTable(description string, args ...interface{}) {
|
||||
func generateTable(description string, isSubtree bool, args ...interface{}) {
|
||||
GinkgoHelper()
|
||||
cl := types.NewCodeLocation(0)
|
||||
containerNodeArgs := []interface{}{cl}
|
||||
|
||||
entries := []TableEntry{}
|
||||
var itBody interface{}
|
||||
var itBodyType reflect.Type
|
||||
var internalBody interface{}
|
||||
var internalBodyType reflect.Type
|
||||
|
||||
var tableLevelEntryDescription interface{}
|
||||
tableLevelEntryDescription = func(args ...interface{}) string {
|
||||
@ -166,11 +231,11 @@ func generateTable(description string, args ...interface{}) {
|
||||
case t.Kind() == reflect.Func && t.NumOut() == 1 && t.Out(0) == reflect.TypeOf(""):
|
||||
tableLevelEntryDescription = arg
|
||||
case t.Kind() == reflect.Func:
|
||||
if itBody != nil {
|
||||
if internalBody != nil {
|
||||
exitIfErr(types.GinkgoErrors.MultipleEntryBodyFunctionsForTable(cl))
|
||||
}
|
||||
itBody = arg
|
||||
itBodyType = reflect.TypeOf(itBody)
|
||||
internalBody = arg
|
||||
internalBodyType = reflect.TypeOf(internalBody)
|
||||
default:
|
||||
containerNodeArgs = append(containerNodeArgs, arg)
|
||||
}
|
||||
@ -200,39 +265,47 @@ func generateTable(description string, args ...interface{}) {
|
||||
err = types.GinkgoErrors.InvalidEntryDescription(entry.codeLocation)
|
||||
}
|
||||
|
||||
itNodeArgs := []interface{}{entry.codeLocation}
|
||||
itNodeArgs = append(itNodeArgs, entry.decorations...)
|
||||
internalNodeArgs := []interface{}{entry.codeLocation}
|
||||
internalNodeArgs = append(internalNodeArgs, entry.decorations...)
|
||||
|
||||
hasContext := false
|
||||
if itBodyType.NumIn() > 0. {
|
||||
if itBodyType.In(0).Implements(specContextType) {
|
||||
if internalBodyType.NumIn() > 0. {
|
||||
if internalBodyType.In(0).Implements(specContextType) {
|
||||
hasContext = true
|
||||
} else if itBodyType.In(0).Implements(contextType) && (len(entry.parameters) == 0 || !reflect.TypeOf(entry.parameters[0]).Implements(contextType)) {
|
||||
} else if internalBodyType.In(0).Implements(contextType) && (len(entry.parameters) == 0 || !reflect.TypeOf(entry.parameters[0]).Implements(contextType)) {
|
||||
hasContext = true
|
||||
}
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
err = validateParameters(itBody, entry.parameters, "Table Body function", entry.codeLocation, hasContext)
|
||||
err = validateParameters(internalBody, entry.parameters, "Table Body function", entry.codeLocation, hasContext)
|
||||
}
|
||||
|
||||
if hasContext {
|
||||
itNodeArgs = append(itNodeArgs, func(c SpecContext) {
|
||||
internalNodeArgs = append(internalNodeArgs, func(c SpecContext) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
invokeFunction(itBody, append([]interface{}{c}, entry.parameters...))
|
||||
invokeFunction(internalBody, append([]interface{}{c}, entry.parameters...))
|
||||
})
|
||||
if isSubtree {
|
||||
exitIfErr(types.GinkgoErrors.ContextsCannotBeUsedInSubtreeTables(cl))
|
||||
}
|
||||
} else {
|
||||
itNodeArgs = append(itNodeArgs, func() {
|
||||
internalNodeArgs = append(internalNodeArgs, func() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
invokeFunction(itBody, entry.parameters)
|
||||
invokeFunction(internalBody, entry.parameters)
|
||||
})
|
||||
}
|
||||
|
||||
pushNode(internal.NewNode(deprecationTracker, types.NodeTypeIt, description, itNodeArgs...))
|
||||
internalNodeType := types.NodeTypeIt
|
||||
if isSubtree {
|
||||
internalNodeType = types.NodeTypeContainer
|
||||
}
|
||||
|
||||
pushNode(internal.NewNode(deprecationTracker, internalNodeType, description, internalNodeArgs...))
|
||||
}
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user