Conversation
Signed-off-by: Pavel Safronov <pv.safronov@gmail.com>
| .args(vec![ | ||
| "sh".to_string(), | ||
| "-c".to_string(), | ||
| format!("echo '{message}' >> {host_output_file}"), |
There was a problem hiding this comment.
well, for different tests we want to write different messages. Like "prestart hook called" or whatever. Maybe the name of the function is not very obvious and I should call it something build_write_message_to_file_hook
There was a problem hiding this comment.
Since it's only used in related hooks tests, how about creating a tests/hooks directory and moving the utils there?
There was a problem hiding this comment.
the problem is that tests/hooks already exists. And there is a test already defined there https://github.com/youki-dev/youki/blob/main/tests/contest/contest/src/tests/hooks/invoke.rs
I agree that it probably makes sense to put these functions somewhere separately, but not sure where. Does something like tests/contest/contest/src/tests/hook_utils look good?
There was a problem hiding this comment.
Maybe you could just put it in the hooks dir along with the existing ones? Is there any reason you want to keep it separate from invoke.rs?
Description
There is some duplication in the e2e tests for hooks. This PR moves similar functions to the helpers library so we can reuse them across the tests.
Type of Change
Testing
Related Issues
#3406
#3408
Additional Context
Was raised here #3406 and here #3408
The functions in the tests in those PRs will be also deduplicated once they're landed and this PR is rebased on main.