-
Notifications
You must be signed in to change notification settings - Fork 685
Remove test constructors or mark as TestOnly #5216
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
Conversation
Signed-off-by: Ben Sherman <[email protected]>
✅ Deploy Preview for nextflow-docs-staging canceled.
|
@pditommaso do these changes look reasonable to you |
|
Signed-off-by: Ben Sherman <[email protected]>
I think I tried to remove test constructors in favor of using the real constructors as much as possible, where it didn't require too many changes to tests. I think there was some issue recently where a test didn't catch a bug because it was using a test constructor and wasn't testing the behavior correctly. For this reason the test constructors seem like an anti-pattern, but in many cases they are convenient and it would be a hassle to remove them. So I just marked those with @testonly so that at least they are easier to track. As for charliecloud, as far as I can tell that removed code is never used because |
5a93547
to
27345a6
Compare
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
@tom-seqera this PR should give you a nice survey of all the unit tests 😄 I created this PR because I encountered some error that wasn't caught by a unit test because the unit test was using a test constructor and bypassing the actual behavior I have gone through the codebased and marked every test constructor as I know you have ideas to improve the tests at a higher level, especially around correctness. I hope this PR is a step in the right direction. If these changes make sense to you, please approve and I will merge it. Let me know if you have any questions. If you find any of the test changes confusing, we can just revert them. |
Signed-off-by: Ben Sherman <[email protected]>
Signed-off-by: Ben Sherman <[email protected]>
@tom-seqera all good now |
Note, the failing nf-google tests are a separate issue and not related to this PR |
…IALS is not defined, following changes in commit d4fadd4 introduced in PR nextflow-io#5216 Signed-off-by: kdesnos <[email protected]>
@bentsherman As done in my PR code, I suggest adding the |
Thanks @kdesnos , I see that I missed this failure because I have google credentials defined in my local environment. I have submitted a patch. It also seems to be affect some PRs but not all. No idea why 🤷♂️ |
Fell down a rabbit hole while working on #5045 . Trying to remove test constructors where it's easy to do so, otherwise mark them as TestOnly. Would be good to get rid of them over time as they suggest to me that a class isn't easily testable.