smartystreets / goconvey

Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go.
http://smartystreets.github.io/goconvey/
Other
8.25k stars 555 forks source link

Sibling Conveys with identical message causes template failure in UI #326

Open mdwhatcott opened 9 years ago

mdwhatcott commented 9 years ago

...when you have 2 or more Convey statements with the same message (in my case as siblings) the tests will show just three question marks in the UI.

Looking at the stack trace unfortunately doesn't provide much more insight, as the only relevant line number I could find was the close of the top most Convey statement. The only way I found this error was by slowly narrowing the scope of what tests were being run using comments, then taking blind shots in the dark.

It would be very nice if a more explicit error message was presented in this case.

ruzz311 commented 8 years ago

347 mentions this issue and suggests a panic in the case of duplicate sibling tests.

riannucci commented 8 years ago

I think it DOES panic the test binary, but the UI shows a nonsensical message like the following image:

screen shot 2016-03-16 at 10 04 21 am

Here's the code to repro:

package something

import (
    "testing"

    . "github.com/smartystreets/goconvey/convey"
)

func TestBad(t *testing.T) {
    Convey("Bad", t, func() {
        Convey("Inner", func() {})
        Convey("Inner", func() {})
    })
}