-
Notifications
You must be signed in to change notification settings - Fork 67
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 unit testing #14
Add unit testing #14
Conversation
Creating digest from bytes can no longer throw an error in the latest digest package version. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Absolute symlinks were using the original path instead of the target path. Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
uidStr := strconv.Itoa(r.uid) | ||
gidStr := strconv.Itoa(r.uid) | ||
switch r.kind { | ||
case rfile: |
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.
So, it would be nice to get rid of these test types. I actually made them before the advent of the default package schema. I think this use case could be filled in with a declarative resource struct, coupled with a method that will select the correct wrapping type:
r, err := Declare(Resource{
Kind: RegularFile,
Path: "/foo",
})
And for inline declarations for making tests:
[]Resource{
MustDeclare(Resource{
Kind: RegularFile,
Path: "/foo",
}),
}
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.
Created issue #15 to track this
LGTM My comment is really to inform refactoring of test code. Accepting this as is. |
Update the unit testing to check the resources from the manifest.
Add support for Linux device info (needed for testing but support for device numbers may be dropped altogether in the future).
Fix bug with absolute symlinks getting wrong target in created Resource.