-
Notifications
You must be signed in to change notification settings - Fork 346
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
Add -template option for testify #109
Conversation
🤔 I don't think I can cover these bad paths without purposely introducing ill-formatted templates into the new templates directory... https://coveralls.io/builds/26460602/source?filename=internal%2Frender%2Frender.go#L62 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, though I'm no expert in testify
. Please see my comment below.
Covering more patterns both with and without subtests.
@cweill I've made changes on the function template so that it now supports generating test cases without using subtests and also supporting Please have another look. Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shihanng: This is looking good. Almost ready to be merged. Only thing is test coverage is dropping about 1%. Could you please add the following test cases:
- Pass an argument to
--template
that is invalid. - Pass an argument to
--template
that is a directory, but the templates are unparseable/invalid.
With those tests, I feel good about merging this PR.
@cweill, thank you for the comments. Regarding the following:
I think this is covered in https://github.com/cweill/gotests/pull/109/files#diff-2831232d50f25c12514b6d6ceaaee101R675-R681?
Since we are embedding the testify template as binary assert using |
Okay, looks good.
That sounds good to me. Let me know once that's done, and I'll approve. |
- Test with empty directory - Test with invalid template (copied from testify and removed a bracket)
For testing invalid template, we only need one template that is invalid and the others can be empty files.
@cweill thanks for the advice. I've added two test cases:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shihanng LGTM! Thanks for this PR.
This is very good work. Thank you for your patience.
Close #47
Allow test codes using github.com/stretchr/testify/assert to be generated with the following option
Hi, @cweill , this PR is based on the discussion on #47. Thank you for reviewing.