Skip to content

Conversation

renzoarreaza
Copy link
Contributor

@renzoarreaza renzoarreaza commented May 25, 2025

Summary

Add testify's own "count" argument -testify.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

The first change 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 dolmen added enhancement pkg-suite Change related to package testify/suite labels May 30, 2025
Repeat tests without rerunning Setup/TeardownSuite
@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

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