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

suite-subtest-run: report on usage suite.T().Run instead of suite.Run #35

Closed
ArtAndreev opened this issue Nov 10, 2023 · 5 comments · Fixed by #104
Closed

suite-subtest-run: report on usage suite.T().Run instead of suite.Run #35

ArtAndreev opened this issue Nov 10, 2023 · 5 comments · Fixed by #104
Assignees
Labels
enhancement New feature or request

Comments

@ArtAndreev
Copy link

According to https://github.com/stretchr/testify/blob/db8608ed63f5bd9abdd03f669f5bb80569c114b6/suite/suite.go#L96 suite.Run should be used for running subtests instead of directly running subtests with testing.T.

I ran into some problems with invalid running subtests and want this linter to report such invalid usage.

@Antonboom
Copy link
Owner

Antonboom commented Nov 10, 2023

Hi, @ArtAndreev!

Thank you for request.
Do you mean CONTRIBUTING.md#suite-run?

Could you provide the concrete example this concrete problems? 🙏

P.S. Why s.T() just not return trimmed interface? 🤔 Maybe we already have known issue in testify project?

@ArtAndreev
Copy link
Author

Hi!

The problem occurs very rarely, it's hard to understand why it happens. It raises data race between tests, but the only t.Parallel call is in function that runs suite.

I have just read CONTRIBUTING.md, looks like the unimplemented checks from it should be mentioned in README.md, so I wouldn't have raised this issue. Anyway, sorry for noise 🙂.

@ArtAndreev
Copy link
Author

Ah, already mentioned:

Also look at open for contribution checkers

Sorry for noise.

@Antonboom Antonboom reopened this Jan 23, 2024
@Antonboom Antonboom added the enhancement New feature or request label Jan 23, 2024
@Antonboom Antonboom changed the title Report on usage suite.T().Run instead of suite.Run feature: report on usage suite.T().Run instead of suite.Run Jan 23, 2024
@Antonboom Antonboom self-assigned this Jun 4, 2024
@Antonboom Antonboom changed the title feature: report on usage suite.T().Run instead of suite.Run suite-subtest-run: report on usage suite.T().Run instead of suite.Run Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants