-
Notifications
You must be signed in to change notification settings - Fork 119
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
test: unit tests for podmanengine.go file in container package #997
Conversation
Thanks for making a pull request! 😃 |
func (e *podmanEngine) InspectImage(image string) ([]types.ImageInspect, error) { | ||
inspectcmd := exec.Command("podman", "inspect", image) | ||
logrus.Debugf("Inspecting image %s", image) | ||
output, err := inspectcmd.CombinedOutput() | ||
if err != nil { | ||
logrus.Debugf("Unable to inspect image %s : %s, %s", image, err, output) | ||
return t, err | ||
return nil, err | ||
} | ||
t = types.ImageInspect{} | ||
var t []types.ImageInspect |
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.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #997 +/- ##
==========================================
+ Coverage 17.63% 18.15% +0.51%
==========================================
Files 52 52
Lines 4820 4820
==========================================
+ Hits 850 875 +25
+ Misses 3758 3727 -31
- Partials 212 218 +6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
It has to match this interface
|
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.
Inspect functionality in podman returns an array of json, which can only be unmarshalled into a slice of structs.
It has to match this interface
InspectImage(image string) (dockertypes.ImageInspect, error) |
Signed-off-by: tarun8718 <tarunkumar8718@gmail.com>
Signed-off-by: tarun8718 <tarunkumar8718@gmail.com>
Please use |
@ashokponkumar some tests (like run cmd in a container) requires functionalities like touch/sleep infinity; Such tests can't be run on hello-world as it doesn't have the support. In such case which image do I use? |
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.
LGTM
This PR consists of unit tests for podmanengine.go file in the container package.
Below are the tests and their test execution status: