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

Migrate to assertion package #477

Merged
merged 3 commits into from
Jan 3, 2025
Merged

Migrate to assertion package #477

merged 3 commits into from
Jan 3, 2025

Conversation

jordan-rash
Copy link
Contributor

This PR moves existing tests to use the assertion package.
Additionally, it moves a handful of test helper functions to the test package

… test package

Signed-off-by: Jordan Rash <jordan@synadia.com>
@jordan-rash jordan-rash requested a review from a team as a code owner January 2, 2025 16:27
Signed-off-by: Jordan Rash <jordan@synadia.com>
Signed-off-by: Jordan Rash <jordan@synadia.com>
Copy link

github-actions bot commented Jan 2, 2025

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/synadia-io/nex/api/nodecontrol 75.44% (ø)
github.com/synadia-io/nex/test 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/synadia-io/nex/test/helpers.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/synadia-io/nex/api/nodecontrol/client_test.go
  • github.com/synadia-io/nex/test/auction_workload_start_test.go
  • github.com/synadia-io/nex/test/copy_workload_test.go
  • github.com/synadia-io/nex/test/lameduck_test.go
  • github.com/synadia-io/nex/test/node_test.go
  • github.com/synadia-io/nex/test/workload_test.go

@bruth
Copy link
Contributor

bruth commented Jan 2, 2025

It looks like there are some tests in the source packages (e.g. api/nodecontrol) and some in test. Generally, it is more conventional to co-locate in the same package for where the source exists. There can be exceptions in the case of circular imports (which is a problem itself) or to prevent use of non-exported elements in the tests. Was there a specific motivation for splitting them up the way they are?

I like that the helpers have been extracted out into a package.

@jordan-rash
Copy link
Contributor Author

jordan-rash commented Jan 2, 2025

the test/ package is not using any function calls, I build all the binaries and interact as a user....thats all that is suppose to be in there. The unit tests that call the functions directly live next to the code.

@jordan-rash jordan-rash merged commit 82fac7b into main Jan 3, 2025
8 checks passed
@jordan-rash jordan-rash deleted the test/move_all_assert branch January 3, 2025 01:50
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