Depends on D4249
Added the rust files for tests where they're supposed to be placed. For now, hardcoded throwing unimplemented but it's supposed to be replaced with tests' logic.
Differential D4250
[services] Tests - Add dummy tests • karol on Jun 13 2022, 6:51 AM. Authored by Tags None Referenced Files
Details
Depends on D4249 Added the rust files for tests where they're supposed to be placed. For now, hardcoded throwing unimplemented but it's supposed to be replaced with tests' logic. none for now
Diff Detail
Event TimelineComment Actions CI failed on an unrelated stage - key server
Comment Actions Returning Result comes in handy because we may use the ? operator. This is goingto be used in every test as we need to connect to the service and connecting functions use ? as well. So, technically, we could remove the return type and lazily add it when the test bodies are added but I don't think this is harmless or expensive.
They do not need to return value, notice that we return () which is void. That's wrapped into result only because we want to handle errors nicely with the ? operator. If an error occurs, the test fails. I'd not change a thing here but I see you two agree on this one so if you still think we should change this, then let me know and I will change but please note that I'm most probably going to add these return types in the diffs that add the tests' bodies. Comment Actions According to https://doc.rust-lang.org/book/ch11-01-writing-tests.html#using-resultt-e-in-tests it is fine to return a result, but I feel that a tests should return a result only when necessary. These empty tests don't need to return it, so we shouldn't do that. |