Skip to content

test: cover legacy package staging recovery - #614

Merged
zackees merged 1 commit into
mainfrom
test/package-staging-recovery
Jun 16, 2026
Merged

zackees merged 1 commit into
mainfrom
test/package-staging-recovery

Conversation

@zackees

@zackees zackees commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • add an offline PackageBase::staged_install regression test for legacy _staging recovery
  • serve a tiny zip over loopback, seed stale interrupted-install contents, and verify retry validation/final install only see fresh archive contents
  • assert the install sentinel is written after the clean staging dir is committed
  • sync Cargo.lock workspace package versions to the 2.2.30 release manifests so locked Cargo runs are consistent

Refs #603

Tests

  • cargo test -p fbuild-packages staged_install_removes_stale_legacy_staging_dir_before_retry
  • cargo test --locked -p fbuild-packages staged_install_removes_stale_legacy_staging_dir_before_retry
  • cargo fmt --all --check
  • git diff --check

Summary by CodeRabbit

  • Tests
    • Enhanced test coverage for package staging and installation retry behavior with helpers for serving ZIP archives over HTTP. Added validation of artifact cleanup, fresh content extraction, staging directory management, and disk-cache completion sentinel file creation.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e269ea11-dd2e-4878-886b-4b3358f75a75

📥 Commits

Reviewing files that changed from the base of the PR and between 111ded3 and 410eaaa.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • crates/fbuild-packages/src/lib.rs

📝 Walkthrough

Walkthrough

Extends the toolchain_gcc_ar_tests module in crates/fbuild-packages/src/lib.rs with two helper functions—one that builds a ZIP archive in memory and one that serves it over an ephemeral local HTTP server—and adds an async Tokio test that validates PackageBase::staged_install retry behavior against a pre-existing stale _staging directory.

Changes

staged_install Retry Behavior Test

Layer / File(s) Summary
In-test ZIP builder and HTTP server
crates/fbuild-packages/src/lib.rs
Adds make_zip_bytes to produce a ZIP archive in memory and serve_zip_over_http to bind a Tokio TCP listener, respond to one GET request with those bytes, and return the bound URL.
Async staged_install stale-directory test
crates/fbuild-packages/src/lib.rs
Adds a tokio::test that pre-populates a stale _staging directory, calls PackageBase::staged_install against the served ZIP URL, and asserts that the stale artifact is absent, fresh contents are extracted, the staging directory is renamed away, and the install-complete sentinel file exists.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A stale old staging dir sat in the way,
But staged_install came and swept it away!
A ZIP spun up in memory's haze,
Served over HTTP in ephemeral days.
The sentinel file now marks the land—
Fresh installs extracted, just as planned! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'test: cover legacy package staging recovery' directly and specifically describes the main change—adding a regression test for package staging recovery.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/package-staging-recovery

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zackees
zackees merged commit d1108e5 into main Jun 16, 2026
90 checks passed
@zackees
zackees deleted the test/package-staging-recovery branch June 16, 2026 10:09
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant