-
Notifications
You must be signed in to change notification settings - Fork 13
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
Move test environment creation into utils. #297
base: main
Are you sure you want to change the base?
Move test environment creation into utils. #297
Conversation
Frontend, middleend and backend used the same procedures to prepare test environment. In this patch, this test environment creation is moved into utils.go file which can be used by other packages. Signed-off-by: Artsiom Koltun <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #297 +/- ##
==========================================
- Coverage 71.53% 69.46% -2.08%
==========================================
Files 14 14
Lines 1711 1762 +51
==========================================
Hits 1224 1224
- Misses 441 492 +51
Partials 46 46
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we still need createTestEnvironment()
? can we just call server.CreateTestEnvironment
instead directly ? if we already unifying the calls ?
We need to modify some internal structures for tests like set a subsystem/controller/volume etc. That's why we need to expose pkg Server at the moment. We can try to cast the server to the original one, but we need to modify the behavior in many tests and I am trying to keep PRs/commits small. If you are not insisting, I will try to come up with a proposal in a next PR |
I'm just asking, trying to understand. not saying good/bad, just clarification |
In addition, we cannot create pkg Servers from utils, due to circular dependency, For example, frontend test requires utils to create a test environment, and utils requires frontend to create Server... |
good point, keep forgetting it |
@glimchb - it seems all points are addressed, please merge |
Frontend, middleend and backend used the same procedures to prepare test environment. In this patch, this test environment creation is moved into server/utils.go file which can be used by other packages.