Skip to content

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

@aiuto

Description

@aiuto

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.

Metadata

Metadata

Assignees

Labels

P1An issue that must be resolved. Must have an assigneefeature-request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions