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

types: start grouping tests in test suites #7395

Merged
merged 8 commits into from
Sep 27, 2020

Conversation

alessio
Copy link
Contributor

@alessio alessio commented Sep 25, 2020


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@codecov
Copy link

codecov bot commented Sep 25, 2020

Codecov Report

Merging #7395 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #7395   +/-   ##
=======================================
  Coverage   55.35%   55.35%           
=======================================
  Files         587      587           
  Lines       36469    36469           
=======================================
  Hits        20189    20189           
  Misses      14192    14192           
  Partials     2088     2088           

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@alessio alessio changed the title types: groups address tests types: group address tests Sep 25, 2020
@@ -1,4 +1,4 @@
package types
package types_test
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason of this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you use separate test packages you put yourself in the developers' shoes and get (almost) the guarantee that a client using the feature which broke in tests will also break when it's called (long story short: the whole point of using _test packages, which incidentally are very Go-idiomatic).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's a matter of a taste. With _test you are more focused on integration tests, and do potentially imports which could do cycle dependency. Without _test you can access private functions and unit tests them.

@alessio alessio changed the title types: group address tests types: start grouping tests in test suites Sep 27, 2020
@alessio alessio merged commit 04ff40a into master Sep 27, 2020
@alessio alessio deleted the alessio/types-address-test-suite branch September 27, 2020 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants