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

Disperse tests in test package to where they belong #708

Closed
wants to merge 1 commit into from

Conversation

masih
Copy link
Member

@masih masih commented Oct 8, 2024

Originally, all tests were put in test package to avoid circular dependency. This no longer holds true. Therefore:

  • Move all simulation tests to sim
  • Move sim/signing package to internal since it is used by a number of tests across the repo as well as cmd/f3.
  • Move signing suite tests to the now existing internal/signing

These changes keep with the go convention of keeping tests in the package they are testing.

@masih masih requested review from Stebalien and Kubuxu October 8, 2024 14:06
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.44%. Comparing base (cbf9c5f) to head (f327002).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #708      +/-   ##
==========================================
- Coverage   76.54%   76.44%   -0.10%     
==========================================
  Files          69       71       +2     
  Lines        5584     5709     +125     
==========================================
+ Hits         4274     4364      +90     
- Misses        901      925      +24     
- Partials      409      420      +11     
Files with missing lines Coverage Δ
internal/signing/bls.go 84.00% <ø> (ø)
internal/signing/fake.go 88.00% <ø> (ø)

... and 4 files with indirect coverage changes

@Stebalien
Copy link
Member

I'm not sure the sim tests belong in sim because they're not testing the simulation, they're just using it.

@masih
Copy link
Member Author

masih commented Oct 8, 2024

I'm not sure the sim tests belong in sim because they're not testing the simulation, they're just using it.

Do you prefer to keep the test package or would you like to see them moved to sim/adversary or else?

Originally, all tests were put in `test` package to avoid circular
dependency. This no longer holds true. Therefore:

* Move all simulation tests to `sim`
* Move `sim/signing` package to `internal` since it is used by a number
  of tests across the repo as well as `cmd/f3`.
* Move signing suite tests to the now existing `internal/signing`

These changes keep with the go convention of keeping tests in the
package they are testing.
@masih masih force-pushed the masih/disperse-test-package branch from 0d05237 to f327002 Compare October 8, 2024 14:26
@Stebalien
Copy link
Member

IMO, they belong in a separate test package. Maybe "sim/test", but they could also live in some internal/test package (really sim should live in internal as well).

Basically, I'd expect any tests directly in sim to be testing the simulation itself (e.g., message_queue_test.go).

@Stebalien
Copy link
Member

If we were to strictly follow the rule "tests live next to the components they test", they'd live in gpbft itself. But it's kind of nice to have these in a separate package given how slow they are.

@masih
Copy link
Member Author

masih commented Oct 8, 2024

OK this is not worth the effort. Closing.

@masih masih closed this Oct 8, 2024
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.

2 participants