-
Notifications
You must be signed in to change notification settings - Fork 329
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
Add integration test utils necessary for implementing rest integration tests #310
Conversation
…ing bundles,starting containers etc.
Sleeping is necessary only when running all lifecycle tests, as otherwise container is still running when we try to delete, and delete test fails. But keeping sleep in kill function slows all other test where we do not try deleting immidiately afterwards. Thus moved the sleep in the kill test itself, so only happend when testing lifecycle functions.
Codecov Report
@@ Coverage Diff @@
## main #310 +/- ##
==========================================
+ Coverage 77.17% 77.19% +0.01%
==========================================
Files 43 43
Lines 6139 6139
==========================================
+ Hits 4738 4739 +1
+ Misses 1401 1400 -1 |
@utam0k Please take a look. |
// By experimenting, somewhere around 50 is enough for youki process | ||
// to get the kill signal and shut down | ||
// here we add a little buffer time as well | ||
const SLEEP_TIME: u64 = 75; |
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.
How about using std::time::Duration
insted ot u64
.
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.
A duration is created later from this u64, and then given to sleep because I thought we could not invoke functions for defining consts, but I checked ans we can use duration::from_millis
directly in constant definition. I will change that along with other required changes in additional commit 👍
Changed the type of |
@YJDoc2 How about searching for |
I personally feel it is better to accept the path as a argument than env var, as with env var, we will need make sure it is set, and when testing multiple runtime, the variable will need to be updated ,thinking from this integration test can be their own standalone program used to test multiple runtimes. Personally I feel taking the path as an argument is more self contained and preferable than an env var. |
The PATH variable refers to a commonly used environment variable. In other words, I thought it would be more convenient to run the program when just passing |
Oh, extremely sorry, I misunderstood your comment 😓 😓 |
Now it is not required to give complete path of the runtime, if it exists in $PATH previously needed to provide /usr/bin/run, now only runc resolves to it
My explanation was also inadequate. Please don't worry about it. |
@utam0k Now have added the path resolution using sudo youki_integration_test -r runc also works as expected. |
ref #282
Part 1 for closing the issue.
This changes hard-coded
youki
to more genericruntime
This also Sets up utils required for integration tests, which will be used for implementing rest of integration tests. Currently these function are not used, so are marked
#[allow(dead_code)]
so clippy doesn't flag them, this will be removed later.This also switched using local directory in youki folder for setting up workspace to using temporary folders, taken after cgroups/temp_dir. This will prevent possible clashes between tests, and possibly allow running tests in parallel in future.
This is a bit big PR 😅 , but many of changes are not in implementation, but to accommodate the temp_dir.