fix(package-manager): re-import reporter and lockfile types in tests#370
Conversation
#364's `use super::*;` removal stripped the test module's view of `LogEvent`, `Reporter`, `Stage`, `StageLog`, and `Lockfile`, but the test bodies still reference them — so `cargo nextest run -p pacquet-package-manager` failed to compile on `main`. Promote the inline `use pacquet_lockfile::Lockfile` from `frozen_lockfile_flag_overrides_config_lockfile_false` to the module- level `use` block, and add the missing reporter symbols alongside the existing `SilentReporter` import. The two `Lockfile`-using tests now share one import.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughTest module imports in the package manager's install.rs are reorganized. The Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
There was a problem hiding this comment.
Pull request overview
Fixes pacquet-package-manager test compilation after the use super::*; removal by explicitly importing the reporter and lockfile types that the install.rs test module still references.
Changes:
- Add missing
pacquet_reportersymbols (LogEvent,Reporter,Stage,StageLog) to the test module imports. - Promote
pacquet_lockfile::Lockfileto the test module-level imports and remove the now-redundant inline import in the affected test.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #370 +/- ##
=======================================
Coverage 88.55% 88.55%
=======================================
Files 65 65
Lines 5769 5769
=======================================
Hits 5109 5109
Misses 660 660 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Micro-Benchmark ResultsLinux |
Integrated-Benchmark Report (Linux)Scenario: Frozen Lockfile
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.8975224960599997,
"stddev": 0.08368479917495718,
"median": 2.8844843014599997,
"user": 2.4661938999999995,
"system": 3.50077644,
"min": 2.79591527496,
"max": 3.0361692689599997,
"times": [
3.0361692689599997,
2.90175817596,
2.94865159396,
2.86721042696,
2.99585243296,
2.95234384796,
2.80508775096,
2.86031590296,
2.81192028496,
2.79591527496
]
},
{
"command": "pacquet@main",
"mean": 2.77744772256,
"stddev": 0.08601401017263496,
"median": 2.79486991646,
"user": 2.4461465,
"system": 3.39236644,
"min": 2.65641680596,
"max": 2.89708060096,
"times": [
2.89708060096,
2.80681742896,
2.87051869996,
2.80471367296,
2.68941716696,
2.65641680596,
2.85975557996,
2.67497117596,
2.78502615996,
2.72975993396
]
},
{
"command": "pnpm",
"mean": 6.52710920756,
"stddev": 0.056653388752369985,
"median": 6.50935006746,
"user": 8.974433399999999,
"system": 4.43548774,
"min": 6.46085803196,
"max": 6.64151394596,
"times": [
6.49831452596,
6.59927055596,
6.64151394596,
6.48545969596,
6.56310272996,
6.51682487996,
6.48704757496,
6.50875408096,
6.50994605396,
6.46085803196
]
}
]
}Scenario: Frozen Lockfile (Hot Cache)
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.70669045418,
"stddev": 0.02859501867953192,
"median": 0.69667696398,
"user": 0.23914899999999997,
"system": 1.3653311200000002,
"min": 0.68233409898,
"max": 0.7776882509799999,
"times": [
0.7776882509799999,
0.68852727898,
0.72760248498,
0.7123153329799999,
0.68422351498,
0.69370445798,
0.70833354598,
0.69252610598,
0.68233409898,
0.69964946998
]
},
{
"command": "pacquet@main",
"mean": 0.76820266508,
"stddev": 0.09531978191692816,
"median": 0.72363024098,
"user": 0.2468383,
"system": 1.35228792,
"min": 0.6894952169799999,
"max": 0.99530150698,
"times": [
0.82442188798,
0.70058360998,
0.83037788498,
0.99530150698,
0.72787812198,
0.69536563598,
0.71497480398,
0.6894952169799999,
0.71938235998,
0.78424562198
]
},
{
"command": "pnpm",
"mean": 2.60897643748,
"stddev": 0.10687135866816494,
"median": 2.5702235934799997,
"user": 3.126021599999999,
"system": 2.18086542,
"min": 2.49462101398,
"max": 2.81437041698,
"times": [
2.81437041698,
2.59919780898,
2.59036610298,
2.75397859498,
2.53562937098,
2.52527319598,
2.54180417298,
2.49462101398,
2.68444261298,
2.55008108398
]
}
]
} |
Summary
#364's
use super::*;removal incrates/package-manager/src/install.rsstripped the test module's view ofLogEvent,Reporter,Stage,StageLog, andLockfile, but the test bodies still reference them. As a resultcargo nextest run -p pacquet-package-manager(andcargo check --tests) fails to compile on currentmain.Promotes the inline
use pacquet_lockfile::Lockfilefromfrozen_lockfile_flag_overrides_config_lockfile_falseto the module-leveluseblock (it's now needed by two tests), and adds the missing reporter symbols alongside the existingSilentReporterimport.Test plan
cargo check --workspace --tests— clean before this PR fails on theinstall.rstest module.cargo nextest run -p pacquet-package-manager install_emits_stage_events_bracketing_the_run— passes (was a build error onmain).just ready— all checks pass.Summary by CodeRabbit