Move test environment creation into utils.#297
Move test environment creation into utils.#297artek-koltun wants to merge 1 commit intoopiproject:mainfrom
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 <artsiom.koltun@intel.com>
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. |
glimchb
left a comment
There was a problem hiding this comment.
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.