testifylint
testifylint copied to clipboard
feature: report on usage `suite.T().Run` instead of `suite.Run`
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.
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?
- https://github.com/stretchr/testify/issues/1139
- https://github.com/stretchr/testify/issues/889
- https://github.com/stretchr/testify/pull/510
- https://gophers.slack.com/archives/C92321HDJ/p1628032842014900?thread_ts=1627781651.013900&cid=C92321HDJ
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 🙂.
Ah, already mentioned:
Also look at open for contribution checkers
Sorry for noise.