Skip to content

Add archive regression tests for multi-source zips - #890

Open
augmentcode[bot] wants to merge 3 commits into
mainfrom
bot/archive-zip-tests
Open

augmentcode[bot] wants to merge 3 commits into
mainfrom
bot/archive-zip-tests

Conversation

@augmentcode

@augmentcode augmentcode Bot commented Jun 23, 2026

Copy link
Copy Markdown

Problem

  • Archive round-trip coverage doesn't exercise zips with multiple .vy sources or same-basename modules in different packages.

Solution

  • Add two CLI archive tests covering multi-source zip compilation and conflicting module names during archive round-trips.

Testing

  • python -m py_compile vyper/tests/unit/cli/vyper_compile/test_compile_files.py

Misc

  • Cosmos session metadata is missing github_username, so delegated bot attribution/branch fallback was used for this PR.

Pull Request opened by Augment Code | View session

@augmentcode

augmentcode Bot commented Jun 23, 2026

Copy link
Copy Markdown
Author

PR Author Agent⚡

👋 I've got this PR.

I'll handle review feedback, CI failures, and merge conflicts, and ping you the moment it's ready for review. Drop a comment anytime.

Marking it ready and picking reviewers are your call — I'll leave both alone.

@augmentcode

augmentcode Bot commented Jun 30, 2026

Copy link
Copy Markdown
Author

PR Author Agent⚡

This PR appears to be inactive. The agent will stop monitoring until a new comment is posted.

@michaelos443
michaelos443 self-requested a review July 9, 2026 10:34

@michaelos443 michaelos443 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please improve the naming for the added tests and make the assertions more comprehensive.

@augmentcode

augmentcode Bot commented Jul 9, 2026

Copy link
Copy Markdown
Author

PR Author Agent⚡

Pushed a follow-up commit that renames the two new tests to match the scenarios they cover and strengthens the assertions by checking the archived source paths plus MANIFEST/compilation_targets / MANIFEST/integrity before comparing the round-trip integrity, bytecode, and layout outputs.

Validation here is still limited to python -m py_compile and git diff --check; direct execution is blocked in this workspace because Crypto and pytest are unavailable.

@augmentcode

augmentcode Bot commented Jul 16, 2026

Copy link
Copy Markdown
Author

PR Author Agent⚡

This PR appears to be inactive. The agent will stop monitoring until a new comment is posted.

@michaelos443
michaelos443 marked this pull request as ready for review July 16, 2026 14:27
@augmentcode

augmentcode Bot commented Jul 16, 2026

Copy link
Copy Markdown
Author
🤖 Augment PR Summary

Summary: Adds regression coverage for Vyper archive (zip) round-trips involving multiple source files and name collisions.

Changes:

  • Introduces a shared _assert_archive_roundtrip helper to compile a contract to an archive, validate key manifest entries, and compare outputs between direct vs archived compilation.
  • Adds a test for archives produced from a project with multiple imported .vy sources.
  • Adds a test for archives produced from two different packages containing same-basename modules (e.g., pkg1/lib.vy and pkg2/lib.vy).

Technical Notes: The tests also assert archived source paths are present and that MANIFEST/integrity matches the compiler output integrity hash.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

with zipfile.ZipFile(archive_path) as archive_zip:
archived_paths = set(archive_zip.namelist())
assert expected_paths.issubset(archived_paths)
assert archive_zip.read("MANIFEST/compilation_targets").decode("utf-8").splitlines() == [

@augmentcode augmentcode Bot Jul 16, 2026 •

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

MANIFEST/compilation_targets is written using OutputBundle.compilation_target_path (via safe_relpath + _anonymize), so it will typically contain a relative POSIX path like main.vy, not str(contract_file) (an absolute tmp path from make_file). As written, this assertion looks like it will fail (and may be cross-platform brittle).

Severity: high

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

PR Author Agent⚡

Good catch — I updated the helper to assert the archive manifest target against the expected archive-relative path (main.vy) instead of the temporary filesystem path from make_file, and pushed that fix in 1d2d671.

Validation here is still limited to python -m py_compile and git diff --check in this workspace.

@augmentcode

augmentcode Bot commented Jul 22, 2026

Copy link
Copy Markdown
Author

PR Author Agent⚡

This PR appears to be inactive. The agent will stop monitoring until a new comment is posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant