mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-18 12:59:31 +00:00
Upgraded from 99c19923, branch release-3.0. This required fetching or upgrading the following: * k8s.io/api to kubernetes-1.9.1 * k8s.io/apimachinery to kubernetes-1.9.1 * github.com/juju/ratelimit to 1.0.1 * github.com/spf13/pflag to 4c012f6d Also, update Scope's imports/function calls to be compatible with the new client.
43 lines
1.3 KiB
Go
43 lines
1.3 KiB
Go
package leafnodes
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/onsi/ginkgo/internal/failer"
|
|
"github.com/onsi/ginkgo/types"
|
|
)
|
|
|
|
type SetupNode struct {
|
|
runner *runner
|
|
}
|
|
|
|
func (node *SetupNode) Run() (outcome types.SpecState, failure types.SpecFailure) {
|
|
return node.runner.run()
|
|
}
|
|
|
|
func (node *SetupNode) Type() types.SpecComponentType {
|
|
return node.runner.nodeType
|
|
}
|
|
|
|
func (node *SetupNode) CodeLocation() types.CodeLocation {
|
|
return node.runner.codeLocation
|
|
}
|
|
|
|
func NewBeforeEachNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *SetupNode {
|
|
return &SetupNode{
|
|
runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeBeforeEach, componentIndex),
|
|
}
|
|
}
|
|
|
|
func NewAfterEachNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *SetupNode {
|
|
return &SetupNode{
|
|
runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeAfterEach, componentIndex),
|
|
}
|
|
}
|
|
|
|
func NewJustBeforeEachNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer, componentIndex int) *SetupNode {
|
|
return &SetupNode{
|
|
runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeJustBeforeEach, componentIndex),
|
|
}
|
|
}
|