summaryrefslogtreecommitdiff
path: root/vendor/github.com/onsi/ginkgo/types/types.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2019-02-05 11:51:41 +0100
committerValentin Rothberg <rothberg@redhat.com>2019-02-06 11:14:06 +0100
commit9ac0ebb0791851aea81ecc847802db5a39bfb6e7 (patch)
tree30ad98bcc2c2dd1136f46a48cbc44d422adfa184 /vendor/github.com/onsi/ginkgo/types/types.go
parent51714d5da7aaa19014fd67b48b79dfbd5f69c1f0 (diff)
downloadpodman-9ac0ebb0791851aea81ecc847802db5a39bfb6e7.tar.gz
podman-9ac0ebb0791851aea81ecc847802db5a39bfb6e7.tar.bz2
podman-9ac0ebb0791851aea81ecc847802db5a39bfb6e7.zip
Cirrus: add vendor_check_task
* Make sure that all vendored dependencies are in sync with the code and the vendor.conf by running `make vendor` with a follow-up status check of the git tree. * Vendor ginkgo and gomega to include the test dependencies. Signed-off-by: Chris Evic <cevich@redhat.com> Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/onsi/ginkgo/types/types.go')
-rw-r--r--vendor/github.com/onsi/ginkgo/types/types.go174
1 files changed, 174 insertions, 0 deletions
diff --git a/vendor/github.com/onsi/ginkgo/types/types.go b/vendor/github.com/onsi/ginkgo/types/types.go
new file mode 100644
index 000000000..0e89521be
--- /dev/null
+++ b/vendor/github.com/onsi/ginkgo/types/types.go
@@ -0,0 +1,174 @@
+package types
+
+import (
+ "strconv"
+ "time"
+)
+
+const GINKGO_FOCUS_EXIT_CODE = 197
+
+/*
+SuiteSummary represents the a summary of the test suite and is passed to both
+Reporter.SpecSuiteWillBegin
+Reporter.SpecSuiteDidEnd
+
+this is unfortunate as these two methods should receive different objects. When running in parallel
+each node does not deterministically know how many specs it will end up running.
+
+Unfortunately making such a change would break backward compatibility.
+
+Until Ginkgo 2.0 comes out we will continue to reuse this struct but populate unkown fields
+with -1.
+*/
+type SuiteSummary struct {
+ SuiteDescription string
+ SuiteSucceeded bool
+ SuiteID string
+
+ NumberOfSpecsBeforeParallelization int
+ NumberOfTotalSpecs int
+ NumberOfSpecsThatWillBeRun int
+ NumberOfPendingSpecs int
+ NumberOfSkippedSpecs int
+ NumberOfPassedSpecs int
+ NumberOfFailedSpecs int
+ // Flaked specs are those that failed initially, but then passed on a
+ // subsequent try.
+ NumberOfFlakedSpecs int
+ RunTime time.Duration
+}
+
+type SpecSummary struct {
+ ComponentTexts []string
+ ComponentCodeLocations []CodeLocation
+
+ State SpecState
+ RunTime time.Duration
+ Failure SpecFailure
+ IsMeasurement bool
+ NumberOfSamples int
+ Measurements map[string]*SpecMeasurement
+
+ CapturedOutput string
+ SuiteID string
+}
+
+func (s SpecSummary) HasFailureState() bool {
+ return s.State.IsFailure()
+}
+
+func (s SpecSummary) TimedOut() bool {
+ return s.State == SpecStateTimedOut
+}
+
+func (s SpecSummary) Panicked() bool {
+ return s.State == SpecStatePanicked
+}
+
+func (s SpecSummary) Failed() bool {
+ return s.State == SpecStateFailed
+}
+
+func (s SpecSummary) Passed() bool {
+ return s.State == SpecStatePassed
+}
+
+func (s SpecSummary) Skipped() bool {
+ return s.State == SpecStateSkipped
+}
+
+func (s SpecSummary) Pending() bool {
+ return s.State == SpecStatePending
+}
+
+type SetupSummary struct {
+ ComponentType SpecComponentType
+ CodeLocation CodeLocation
+
+ State SpecState
+ RunTime time.Duration
+ Failure SpecFailure
+
+ CapturedOutput string
+ SuiteID string
+}
+
+type SpecFailure struct {
+ Message string
+ Location CodeLocation
+ ForwardedPanic string
+
+ ComponentIndex int
+ ComponentType SpecComponentType
+ ComponentCodeLocation CodeLocation
+}
+
+type SpecMeasurement struct {
+ Name string
+ Info interface{}
+ Order int
+
+ Results []float64
+
+ Smallest float64
+ Largest float64
+ Average float64
+ StdDeviation float64
+
+ SmallestLabel string
+ LargestLabel string
+ AverageLabel string
+ Units string
+ Precision int
+}
+
+func (s SpecMeasurement) PrecisionFmt() string {
+ if s.Precision == 0 {
+ return "%f"
+ }
+
+ str := strconv.Itoa(s.Precision)
+
+ return "%." + str + "f"
+}
+
+type SpecState uint
+
+const (
+ SpecStateInvalid SpecState = iota
+
+ SpecStatePending
+ SpecStateSkipped
+ SpecStatePassed
+ SpecStateFailed
+ SpecStatePanicked
+ SpecStateTimedOut
+)
+
+func (state SpecState) IsFailure() bool {
+ return state == SpecStateTimedOut || state == SpecStatePanicked || state == SpecStateFailed
+}
+
+type SpecComponentType uint
+
+const (
+ SpecComponentTypeInvalid SpecComponentType = iota
+
+ SpecComponentTypeContainer
+ SpecComponentTypeBeforeSuite
+ SpecComponentTypeAfterSuite
+ SpecComponentTypeBeforeEach
+ SpecComponentTypeJustBeforeEach
+ SpecComponentTypeJustAfterEach
+ SpecComponentTypeAfterEach
+ SpecComponentTypeIt
+ SpecComponentTypeMeasure
+)
+
+type FlagType uint
+
+const (
+ FlagTypeNone FlagType = iota
+ FlagTypeFocused
+ FlagTypePending
+)