-
Notifications
You must be signed in to change notification settings - Fork 249
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
Output when using go test #68
Comments
Hi, depends on what exactly are you seeing, for example godog itself has a test suite integrated in TestMain with a Note, you do not see the exact scenarios printed since it is a progress format. If you change it to pretty then you will get all details. func TestMain(m *testing.M) {
status := RunWithOptions("godog", func(s *Suite) {
SuiteContext(s)
}, Options{
Format: "pretty",
Paths: []string{"features/load.feature:22"}, // only one scenario for this example
})
if st := m.Run(); st > status {
status = st
}
os.Exit(status)
} That is the intended behavior. If you are seeing different things then give me more context about your environment.. Additionally, you can leverage -v option which go test is using and change the formatter based on that: func TestMain(m *testing.M) {
format := "progress"
for _, arg := range os.Args[1:] {
if arg == "-test.v=true" { // go test transforms -v option
format = "pretty"
break
}
}
status := RunWithOptions("godog", func(s *Suite) {
SuiteContext(s)
}, Options{
Format: format,
Paths: []string{"features/load.feature:22"},
})
if st := m.Run(); st > status {
status = st
}
os.Exit(status)
} And then instead of progress if |
Thanks for the prompt feedback, very helpful! I also just noticed that I was a bit imprecise: I'm actually using
The no tests to run is due to the fact that I only have features, and just have a Running Was just wondering if anybody had an explanation for the difference in output behavior of As this is actually a question about |
Turns out that this is normal behavior - |
When using
go test
to run godog features as described in the readme (usingTestMain
), when the tests are successful, I don't get any output about whichfeatures / steps are run in case of success, but I do get output for example
from a gin http server running as part of the test suite.
Is this intended behavior?
The text was updated successfully, but these errors were encountered: