remove deb package blob used for testing#113
Conversation
To make the content transparent and facilitate changing the package, this commit creates the deb used for testing programmatically instead of embedding it as a base64-encoded blob directly.
rebornplusplus
left a comment
There was a problem hiding this comment.
The passing tests are assuring me that the necessary files are intact since we check modes and hashes in the tests.
Left a nit comment about the name below. Otherwise, looks overall good to me.
internal/testutil/pkgdata.go
Outdated
| abj2Z7KoYMBXz9dwNNP2Aw13FguKkogezW5cqy4lCg== | ||
| ` | ||
| func init() { | ||
| PackageData["base-files"] = MustMakeDeb(baseFilesPackageEntries) |
There was a problem hiding this comment.
I wonder if we should keep calling it base-files since it contains file not found in traditional base-files packages. For example, the /usr/bin/hello script. And also lacks a few files (and dirs) from the usual base-files packages.
Since we are refactoring, how about renaming the entry to something like test-package?
There was a problem hiding this comment.
There has been a change of plan, we are no longer going to change base-files but the tests instead. Gustavo had a good point about the previous version of the PR not being the best solution, either we use a real package or we create tests data specifically.
rebornplusplus
left a comment
There was a problem hiding this comment.
Looks good to me, thanks! I just left a nitpick comment.
niemeyer
left a comment
There was a problem hiding this comment.
Thanks, that's looking nice. Just superficial comments.
To make the content transparent and facilitate testing by creating the minimal working package, this PR changes the tests to avoid relying on base files, instead creating the package for the tests explicitly. The new package contains only the relevant testing data.