Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not set the run time of a spec when the dryRun flag is used #438

Merged
merged 1 commit into from
Mar 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (spec *Spec) Summary(suiteID string) *types.SpecSummary {
componentCodeLocations[len(spec.containers)] = spec.subject.CodeLocation()

runTime := spec.runTime
if runTime == 0 {
if runTime == 0 && !spec.startTime.IsZero() {
runTime = time.Since(spec.startTime)
}

Expand Down
7 changes: 7 additions & 0 deletions internal/specrunner/spec_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ var _ = Describe("Spec Runner", func() {
Ω(reporter1.EndSummary.NumberOfPassedSpecs).Should(Equal(0))
Ω(reporter1.EndSummary.NumberOfFailedSpecs).Should(Equal(0))
})

It("should not report a slow test", func() {
summaries := reporter1.SpecSummaries
for _, s := range summaries {
Expect(s.RunTime).To(BeZero())
}
})
})
})

Expand Down