Skip to content

remove deb package blob used for testing - #113

Merged
niemeyer merged 15 commits into
canonical:mainfrom
letFunny:remove-deb-blob
Mar 7, 2024
Merged

niemeyer merged 15 commits into
canonical:mainfrom
letFunny:remove-deb-blob

Conversation

@letFunny

@letFunny letFunny commented Jan 8, 2024 •

Copy link
Copy Markdown
Collaborator

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.

  • Have you signed the CLA?

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 rebornplusplus left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread internal/testutil/pkgdata.go Outdated
abj2Z7KoYMBXz9dwNNP2Aw13FguKkogezW5cqy4lCg==
`
func init() {
PackageData["base-files"] = MustMakeDeb(baseFilesPackageEntries)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@letFunny
letFunny marked this pull request as draft January 9, 2024 15:21
@letFunny letFunny changed the title remove deb package blob used for testing revamp extract_test to avoid relying on base-files Jan 11, 2024
@letFunny
letFunny marked this pull request as ready for review January 19, 2024 10:45
@letFunny
letFunny requested a review from niemeyer January 30, 2024 10:46
@letFunny letFunny changed the title revamp extract_test to avoid relying on base-files remove deb package blob used for testing Jan 31, 2024

@rebornplusplus rebornplusplus left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks! I just left a nitpick comment.

Comment thread internal/testutil/pkgdata.go Resolved
@letFunny letFunny added the Priority Look at me first label Feb 7, 2024

@niemeyer niemeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's looking nice. Just superficial comments.

Comment thread internal/deb/extract_test.go Resolved
Comment thread internal/deb/extract_test.go Resolved
Comment thread internal/slicer/slicer_test.go Resolved
Comment thread internal/slicer/slicer_test.go Resolved
Comment thread internal/slicer/slicer_test.go Resolved
Comment thread internal/slicer/slicer_test.go Resolved
Comment thread internal/slicer/slicer_test.go Resolved
Comment thread internal/slicer/slicer_test.go Resolved
Comment thread internal/slicer/slicer_test.go Resolved
Comment thread internal/testutil/pkgdata.go Resolved
@letFunny
letFunny requested a review from niemeyer February 26, 2024 11:58

@niemeyer niemeyer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@niemeyer
niemeyer merged commit fdb2e54 into canonical:main Mar 7, 2024
@letFunny
letFunny deleted the remove-deb-blob branch October 17, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority Look at me first

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants