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

Call ReportAfterSuite in --dry-run mode #935

Closed
rcw5 opened this issue Feb 22, 2022 · 5 comments
Closed

Call ReportAfterSuite in --dry-run mode #935

rcw5 opened this issue Feb 22, 2022 · 5 comments

Comments

@rcw5
Copy link

rcw5 commented Feb 22, 2022

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?

@onsi
Copy link
Owner

onsi commented Feb 22, 2022

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.

@rcw5
Copy link
Author

rcw5 commented Feb 22, 2022

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!

@onsi
Copy link
Owner

onsi commented Feb 22, 2022

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.

@chendave
Copy link

chendave commented Apr 1, 2022

@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? aae4480?

@onsi
Copy link
Owner

onsi commented Apr 1, 2022

it'll be in the next release - not sure yet when I'll cut a release, though. hopefully in the next few days/week.

pohly pushed a commit to pohly/kubernetes that referenced this issue May 2, 2022
The spec will be added back in the future, here is just
a workaround for now.

ref: onsi/ginkgo#935

Signed-off-by: Dave Chen <dave.chen@arm.com>
@onsi onsi closed this as completed Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants