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

v3(tests): use testify for assertion #2036

Merged
merged 8 commits into from
Aug 22, 2022
Merged

Conversation

trim21
Copy link
Contributor

@trim21 trim21 commented Aug 20, 2022

Please provide enough information so that others can review your pull request:
close #2035

Explain the details for making this change. What existing problem does the pull request solve?

replace all utils.AssertEqual with testify/require

@trim21 trim21 changed the base branch from master to v3-beta August 20, 2022 07:04
@trim21 trim21 marked this pull request as ready for review August 20, 2022 07:25
@trim21
Copy link
Contributor Author

trim21 commented Aug 20, 2022

I'm not very familiar with our PR merging workflow, can I just merge it or I should wait another maintainer to do it 🤔 @efectn

@ReneWerner87
Copy link
Member

Just wait for the maintainers. You can merge little things like dependencies updates, documentation or test update, but should wait for big decisions.

@ReneWerner87
Copy link
Member

And best never merge your own code without feedback from others, otherwise no one can give feedback.

@efectn
Copy link
Member

efectn commented Aug 20, 2022

Testify is OK to me since it has more detailed output and better methods.

@ReneWerner87
Copy link
Member

Just don't know if we should do that
The idea of fenny then, was to have as little dependence as possible

Hope in version 3 we can follow this idea as good as possible, so if it is not absolutely necessary, we should not make ourselves dependent

@efectn
Copy link
Member

efectn commented Aug 20, 2022

I think v3 has less deps than v2 at the moment. We can also write custom extractor instead of using msgp i suppose.

https://github.com/gofiber/fiber/blob/v3-beta/go.mod

@trim21
Copy link
Contributor Author

trim21 commented Aug 20, 2022

I want say that vendoring go package in internal/ is not a good idea .....

@ReneWerner87
Copy link
Member

Yes I agree, that's why I have already allowed some dependencies

My only question is if we got along with our native test functions so far, do we really need an extra package?
Should only be questioned so we have as few dependencies as possible

@trim21
Copy link
Contributor Author

trim21 commented Aug 20, 2022

that dependent on why we need to "have as little dependence as possible" I think 🤔

To make user download less code or something else?

@ReneWerner87
Copy link
Member

One dependency quickly becomes several, when the next developer wants to write his test with other libs we suddenly have a lot of dependencies.

But if we don't allow these from the beginning and extend our internal test function a bit, we would be free from these decisions.

I'll look at the code later which assertion is not possible with our internal function

@trim21
Copy link
Contributor Author

trim21 commented Aug 20, 2022

when the next developer wants to write his test with other libs we suddenly have a lot of dependencies.

I think we can have some code style guide about this...

I'll look at the code later which assertion is not possible with our internal function

there isn't, all assertions are possible in our internal function, I just use some gofmt rewrite rule to convert them (and some manually update).

#2035 (comment)

I think that it's better to use a popular assertion libaray than writing many our own assertion (or use a AssertEqual in many style) for maintaining

@ReneWerner87 ReneWerner87 merged commit c964fda into gofiber:v3-beta Aug 22, 2022
@trim21 trim21 deleted the v3-testify branch August 22, 2022 06:05
@efectn efectn added this to the v3 milestone Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

🚀 v3 Request: use https://github.com/stretchr/testify for testing
3 participants