Skip to content
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

Provide a tool for testing content of zip/tar files #644

Closed
aiuto opened this issue Dec 1, 2022 · 0 comments · Fixed by #669
Closed

Provide a tool for testing content of zip/tar files #644

aiuto opened this issue Dec 1, 2022 · 0 comments · Fixed by #669
Assignees
Labels
feature-request P1 An issue that must be resolved. Must have an assignee

Comments

@aiuto
Copy link
Collaborator

aiuto commented Dec 1, 2022

The intent is that consumers of the rules should have a tool that facilitates writing non-brittle tests to validate they set things up the right way. I have seen many cases of people writing test that do things like bit compares to golden files. These breaks too often. Off the cuff concept model.

validate_archive_test(
    name = "my_test",
    target = ":foo.zip",   # or tar.  The rule should take either. Maybe .deb, rpm too.
    # must contain everything here, in any order, and can contain more
    contains = [
         "usr/local/sbin/abld",
         "usr/local/sbin/web_server",
         ".*/foo/bar.*.exe",     # yes, these are regexes.
    ],
    does_not_contain_regex = [   # none of these regexes must match any file
          ".*/MANIFEST",
     ],
     has_entries = ">=3",
     require_entries_sorted = True,   # But what does sorted mean?  What locale?
)

This may be a matter of improving our current test utilities and externalizing them.

@aiuto aiuto self-assigned this Feb 8, 2023
@aiuto aiuto added the P1 An issue that must be resolved. Must have an assignee label Feb 8, 2023
aiuto added a commit to aiuto/rules_pkg that referenced this issue Feb 10, 2023
We could do more, but this should be good enough to start.

Fixes bazelbuild#644
aiuto added a commit to aiuto/rules_pkg that referenced this issue Feb 11, 2023
We could do more, but this should be good enough to start.

Fixes bazelbuild#644
aiuto added a commit that referenced this issue Feb 15, 2023
We could do more, but this should be good enough to start.

Fixes #644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request P1 An issue that must be resolved. Must have an assignee
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant