Skip to content

Conversation

@renzoarreaza
Copy link
Contributor

@renzoarreaza renzoarreaza commented May 25, 2025

Summary

Add testify's own "count" argument -testify.c -suite.c to run tests multiple times without rerunning Setup/TeardownSuite

Changes

I've added a new (uint) flag to the top of suite/suite.go.
And I add the same InternalTest object that is created multiple times to the tests slice.

Motivation

This allows tests to be repeated multiple times. Using go test's -count option results in the Setup/TeardownSuite also running multiple times. This is especially valuable when you have a SetupSuite that takes a long time.

Related

@dolmen
Copy link
Collaborator

dolmen commented Jun 23, 2025

It doesn't make sense to have this flag named with a testify. prefix while the flag is specific to suite. I know there is a precedent here with testify.m which is really unfortunate.

@renzoarreaza
Copy link
Contributor Author

What do you think of naming it suite.c. We could also add an alias to for testify.m to suite.m.
I believe the second change means adding a third-party dependency, but I haven't looked into it yet.

@renzoarreaza
Copy link
Contributor Author

What do you think of naming it suite.c. We could also add an alias to for testify.m to suite.m. I believe the second change means adding a third-party dependency, but I haven't looked into it yet.

@dolmen any thoughts on this before I write the code

@renzoarreaza
Copy link
Contributor Author

I picking this back up again. I've renamed the flags with the suite prefix instead of testify while keeping support for the existing testify.m.

@renzoarreaza renzoarreaza changed the title suite: add support for -testify.c suite: add support for -suite.c Dec 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement pkg-suite Change related to package testify/suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants