dependencies: ginkgo v2.13.0, gomega v1.28.0
Besides simply staying up-to-date, ginkgo v2.13.0 adds a `PreviewSpecs` which will be used for introspection of the E2E test suites.
This commit is contained in:
26
vendor/github.com/onsi/ginkgo/v2/internal/suite.go
generated
vendored
26
vendor/github.com/onsi/ginkgo/v2/internal/suite.go
generated
vendored
@@ -77,6 +77,20 @@ func NewSuite() *Suite {
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *Suite) Clone() (*Suite, error) {
|
||||
if suite.phase != PhaseBuildTopLevel {
|
||||
return nil, fmt.Errorf("cnanot clone suite after tree has been built")
|
||||
}
|
||||
return &Suite{
|
||||
tree: &TreeNode{},
|
||||
phase: PhaseBuildTopLevel,
|
||||
ProgressReporterManager: NewProgressReporterManager(),
|
||||
topLevelContainers: suite.topLevelContainers.Clone(),
|
||||
suiteNodes: suite.suiteNodes.Clone(),
|
||||
selectiveLock: &sync.Mutex{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (suite *Suite) BuildTree() error {
|
||||
// During PhaseBuildTopLevel, the top level containers are stored in suite.topLevelCotainers and entered
|
||||
// We now enter PhaseBuildTree where these top level containers are entered and added to the spec tree
|
||||
@@ -245,7 +259,9 @@ func (suite *Suite) pushCleanupNode(node Node) error {
|
||||
|
||||
node.NodeIDWhereCleanupWasGenerated = suite.currentNode.ID
|
||||
node.NestingLevel = suite.currentNode.NestingLevel
|
||||
suite.selectiveLock.Lock()
|
||||
suite.cleanupNodes = append(suite.cleanupNodes, node)
|
||||
suite.selectiveLock.Unlock()
|
||||
|
||||
return nil
|
||||
}
|
||||
@@ -326,6 +342,16 @@ func (suite *Suite) CurrentSpecReport() types.SpecReport {
|
||||
return report
|
||||
}
|
||||
|
||||
// Only valid in the preview context. In general suite.report only includes
|
||||
// the specs run by _this_ node - it is only at the end of the suite that
|
||||
// the parallel reports are aggregated. However in the preview context we run
|
||||
// in series and
|
||||
func (suite *Suite) GetPreviewReport() types.Report {
|
||||
suite.selectiveLock.Lock()
|
||||
defer suite.selectiveLock.Unlock()
|
||||
return suite.report
|
||||
}
|
||||
|
||||
func (suite *Suite) AddReportEntry(entry ReportEntry) error {
|
||||
if suite.phase != PhaseRun {
|
||||
return types.GinkgoErrors.AddReportEntryNotDuringRunPhase(entry.Location)
|
||||
|
||||
Reference in New Issue
Block a user