ginkgo
ginkgo copied to clipboard
Call ReportAfterSuite in --dry-run mode
I've been running ginkgo in --dry-run
mode to generate a custom report of all the tests in my project without having to run them (it's a long-running integration test suite)
After migrating to Ginkgo v2 I notice that ReportAfterSuite()
isn't called when --dry-run
is enabled, I think because of this block - https://github.com/onsi/ginkgo/blob/master/internal/suite.go#L528-L530:
if suite.config.DryRun {
suite.currentSpecReport.State = types.SpecStatePassed
return
}
The same occurs with ReportAfterEach()
Would you consider changing the behaviour so that the reporting hooks are called even in dry-run mode?
iirc i turned this off intentionally. your usecase makes sense to me though so let me dig into why i'd done that and circle back.
I've been able to find a way around the change by setting --focus
in such a way that all tests are skipped, i.e. ginkgo --focus NoSpecsMatchThisString
Seems to be working OK so far, but a modified --dry-run
behaviour would make my intentions more explicit!
Makes sense - but I think I agree that the intent behind --dry-run
is to report on how the suite will run which should include running the reporting nodes. Will take a look sometime this week.
@onsi thanks for the quick fix, could you pls let me know which minor version of v2 will include this fix and the timeline for the release? https://github.com/onsi/ginkgo/commit/aae4480d35116455d7115e71120566e8be55b4a4?
it'll be in the next release - not sure yet when I'll cut a release, though. hopefully in the next few days/week.