mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-25 08:16:33 +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.
56 lines
1.5 KiB
Go
56 lines
1.5 KiB
Go
package leafnodes
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/onsi/ginkgo/internal/failer"
|
|
"github.com/onsi/ginkgo/types"
|
|
)
|
|
|
|
type SuiteNode interface {
|
|
Run(parallelNode int, parallelTotal int, syncHost string) bool
|
|
Passed() bool
|
|
Summary() *types.SetupSummary
|
|
}
|
|
|
|
type simpleSuiteNode struct {
|
|
runner *runner
|
|
outcome types.SpecState
|
|
failure types.SpecFailure
|
|
runTime time.Duration
|
|
}
|
|
|
|
func (node *simpleSuiteNode) Run(parallelNode int, parallelTotal int, syncHost string) bool {
|
|
t := time.Now()
|
|
node.outcome, node.failure = node.runner.run()
|
|
node.runTime = time.Since(t)
|
|
|
|
return node.outcome == types.SpecStatePassed
|
|
}
|
|
|
|
func (node *simpleSuiteNode) Passed() bool {
|
|
return node.outcome == types.SpecStatePassed
|
|
}
|
|
|
|
func (node *simpleSuiteNode) Summary() *types.SetupSummary {
|
|
return &types.SetupSummary{
|
|
ComponentType: node.runner.nodeType,
|
|
CodeLocation: node.runner.codeLocation,
|
|
State: node.outcome,
|
|
RunTime: node.runTime,
|
|
Failure: node.failure,
|
|
}
|
|
}
|
|
|
|
func NewBeforeSuiteNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer) SuiteNode {
|
|
return &simpleSuiteNode{
|
|
runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeBeforeSuite, 0),
|
|
}
|
|
}
|
|
|
|
func NewAfterSuiteNode(body interface{}, codeLocation types.CodeLocation, timeout time.Duration, failer *failer.Failer) SuiteNode {
|
|
return &simpleSuiteNode{
|
|
runner: newRunner(body, codeLocation, timeout, failer, types.SpecComponentTypeAfterSuite, 0),
|
|
}
|
|
}
|