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

Consider moving away from assert libraries #79

Open
insomniacslk opened this issue Jul 8, 2018 · 4 comments
Open

Consider moving away from assert libraries #79

insomniacslk opened this issue Jul 8, 2018 · 4 comments
Assignees
Labels

Comments

@insomniacslk
Copy link
Owner

As discussed in #71 , it is worth considering moving away from assertion libraries like the one we use, github.com/stretchr/testify.

@insomniacslk insomniacslk self-assigned this Jul 8, 2018
@get9
Copy link
Collaborator

get9 commented Jul 8, 2018

I tried to find some of the relevant documentation on this and... I’m not really convinced this is really worth the time. Sure, Equals does some magic runtime comparisons, but I think that’s better than having to write yet more “if foo != bar” lines after every operation.

@insomniacslk
Copy link
Owner Author

This is just a question, not a proposal - I am not saying we have to move away from stretchr/testify, just that it's worth doing some research to understand pros and cons. When I'll have researched and studied more on the matter, I'll be able to decide if I'll suggest to move away from it or not

@davebarrau
Copy link
Contributor

Hey @insomniacslk, did you come to any conclusion on this? Thinking about writing some test cases and don't want to use the wrong library (or have them need to be rewritten later on).

I think for unit testing, it doesn't matter if you fail early, as the end game is you get all tests to pass prior to committing, and you should be running tests often enough that a whole bunch should not blow up at the same time.

I also think the level of automatic detail when using the assert/require libs is great, and it keeps the tests concise.

The point that was made about it not being idiomatic Go.. does it really matter for test code? Happy to go with either option though.

@insomniacslk
Copy link
Owner Author

Hey @davebarrau,
For now I don't have yet evidence of the benefits of moving away from the testify library, so we will probably stick with it for the foreseeable future. And as you suggest, for our use case this seems to be just fine.
I am ok to continue using the current assertion library, and keep this open for reconsideration in the future. If we eventually realize that all this was a mistake I'm ok with adjusting all the tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants