Skip to content

Commit

Permalink
Merge pull request #438 from onsi/issue-436
Browse files Browse the repository at this point in the history
Do not set the run time of a spec when the dryRun flag is used

Solves #436
  • Loading branch information
kirederik committed Mar 12, 2018
2 parents 9008c7b + 457e2d9 commit ba8e856
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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

0 comments on commit ba8e856

Please sign in to comment.