You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: exercise batch 2 packages through public APIs - #985
This is an automated mechanical PR for arty_io_host, arty_macros, arty_macros_impl, arty_tokio, and bytesbuf.
Move 194 unit tests to integration tests through existing public APIs. Keep private-path tests with rationale. Do not add public APIs.
arty_io_host: Move 2 error cases to provider callbacks. Keep 2 cases for a private concurrency hook and telemetry wrappers.
arty_macros: Leave unchanged. The package has no unit tests.
arty_macros_impl: Move 24 expansion and error cases. Keep 2 cases that inject private Cargo dependency metadata.
arty_tokio: Leave unchanged. Its 12 unit tests need private startup state or private error types. Existing integration tests cover public behavior.
bytesbuf: Move 168 cases into buffers, views, conversions, and memory_providers targets. Keep 37 private layout, iterator, state, and helper cases.
Motivation
Tests through public APIs depend on observable behavior rather than internal structure. Internal refactoring therefore needs fewer test changes.
Evidence
The audit accounts for every original unit test. Migrated tests retain their inputs and assertion meaning, with equivalent public-API inputs where private setup was required. Six macro cases now compare complete expected output instead of fragments, prefixes, or the absence of an error. Relevant error cases include the original input. Worker literals and malformed inputs exercise both macros. These weaker checks also existed before migration.
The source diff changes test code, test-only helpers, and imports under test configuration. It does not change runtime logic or the public API.
The grouped targets use nested module declarations instead of repetitive path attributes. Test names include prefixes such as buffers::buf:: and conversions::from_bytes::. Buffer and view targets share the existing private block fixture through explicit paths. A private test_memory module also reuses the allocation fixture through public Block and Memory APIs. The coordinator received these paths and every pushed head.
The core targets no longer require test-util, so their tests also run without the library's std feature. Standard I/O cases require std. The memory_providers target retains its test-util requirement. Compatibility chunks are initialized before every advance_mut call.
Both Linux coverage jobs at 079b1e73 reported seven uncovered lines in the shared block fixture. The moved metadata tests already exercise those paths. The coverage filter conservatively retains helper counters when source ownership is uncertain. A file-level #![cfg(test)] now makes the fixture's existing test-only scope explicit. Every caller already compiled it only in tests. No assertions, coverage thresholds, ignores, or stress-test selection changed.
The publishing pipeline at 1e649cf4 exposed eight unwrap_used diagnostics in helpers in the host integration target. A file-level #![cfg(test)] now expresses that target's existing test-only scope. This lets Clippy apply the repository's existing test policy. All unwraps, assertions, helpers, and test names remain unchanged. No lint allows were added.
The exact targeted Clippy command reproduced all eight errors before this change and passed afterward on Windows. The package compilation passed. Both original integration cases ran and passed, with zero ignored or filtered cases:
The publishing log at 9d32f29b no longer reports those host errors. It reports three distinct unwrap_used errors in bytesbuf integration helpers. The narrow local reproduction also exposed a Windows-only panic lint in the migrated memory-status helper. Three file-level #![cfg(test)] guards now express the helpers' existing test-only scope. The repair preserves every unwrap, panic, assertion, test name, host-memory guard, and Miri condition. It adds no lint allows or exclusions.
The same targeted Clippy command failed before the repair and passed afterward on Windows. Package compilation also passed:
The core targets passed 116 tests without the library's std feature: 46 buffer, 58 view, and 12 conversion cases. cargo tree reported only bytes-compat for the library's enabled features.
After the final helper-scope repair, all four targets passed 165 tests with all features: 56 buffer, 63 view, 13 conversion, and 33 memory-provider cases. The counts match the earlier compatibility and telemetry run.
Three existing large-allocation tests were compiled but not run locally. CI for the latest head remains pending. The local coverage tool lacks the CI recipe's run command, so the coverage repair still needs CI confirmation. No full local test suite, coverage run, mutation run, or broad feature matrix was run.
Merge Danger
Risk is limited to test setup, placement, feature selection, test-only scope, and stricter macro assertions. Core tests now run without test-util. Compatibility, standard I/O, and telemetry cases keep the gates required by their APIs. The large-allocation cases retain their inputs and host-memory guards. Test selectors must account for the added module prefixes. The known Clippy failure in arty_executor predates this PR and remains outside this batch. CI must cover the remaining configurations before merge.
Move reachable unit tests in arty_io_host, arty_macros_impl, and bytesbuf to integration targets. Keep private-path tests with rationale. Audit arty_macros and arty_tokio without changing them.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The migrated tests drop coverage for supported no-std configurations, and three advance_mut calls violate the safety contract by marking unwritten bytes as initialized.
This PR moves tests for arty_io_host, arty_macros_impl, and bytesbuf to integration targets that use existing public APIs. It reduces dependence on private implementation details without adding public APIs or changing runtime logic.
Use nested module discovery for buffer, view, conversion, and memory-provider targets. Share test fixtures without expanding public APIs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Initialize compatibility chunks before advancing them and use public memory contracts in core integration fixtures.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Active findings identify uninitialized bytes marked as initialized, feature-gating regressions that remove supported test coverage, and 5 GB tests left enabled under Miri.
Under Miri, the memory guard is disabled, but this test still allocates 5,000,000,000 bytes; Anvil selects integration tests with all features (justfiles/anvil/checks/miri.just:46–58). Add a reasoned test-level Miri ignore, keeping the native boundary test and small conversion tests enabled, as prescribed by docs/runtime-analysis.md:29–46. Apply the same change to crates/bytesbuf/tests/conversions/from_bytes.rs:33, which initializes the same number of bytes.
Preserve all migrated cases and compare full expected tokens. Exercise both macros for worker literals and malformed inputs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The transparent-provider test still allocates 5 GB under Miri because only its memory guard is gated, requiring a test-level Miri exclusion while preserving native large-allocation coverage.
✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (2be413c) to head (921ac49). ⚠️ Report is 2 commits behind head on main.
Declare the fixture's existing test-only scope in the file so released-surface coverage filtering can classify it across module paths.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The shared fixture’s cfg change alters coverage source classification, while CI coverage confirmation and remaining feature configurations are pending and require human verification before approval.
Keep helper unwraps inside their existing test-only scope so Clippy applies the repository's test policy. Preserve both discovered cases and all assertions.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Changes to test-target feature selection and coverage ownership still need latest-head CI evidence validating the coverage-filter repair and remaining coverage, mutation, and runtime-analysis configurations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is an automated mechanical PR for
arty_io_host,arty_macros,arty_macros_impl,arty_tokio, andbytesbuf.Move 194 unit tests to integration tests through existing public APIs. Keep private-path tests with rationale. Do not add public APIs.
arty_io_host: Move 2 error cases to provider callbacks. Keep 2 cases for a private concurrency hook and telemetry wrappers.arty_macros: Leave unchanged. The package has no unit tests.arty_macros_impl: Move 24 expansion and error cases. Keep 2 cases that inject private Cargo dependency metadata.arty_tokio: Leave unchanged. Its 12 unit tests need private startup state or private error types. Existing integration tests cover public behavior.bytesbuf: Move 168 cases intobuffers,views,conversions, andmemory_providerstargets. Keep 37 private layout, iterator, state, and helper cases.Motivation
Tests through public APIs depend on observable behavior rather than internal structure. Internal refactoring therefore needs fewer test changes.
Evidence
The audit accounts for every original unit test. Migrated tests retain their inputs and assertion meaning, with equivalent public-API inputs where private setup was required. Six macro cases now compare complete expected output instead of fragments, prefixes, or the absence of an error. Relevant error cases include the original input. Worker literals and malformed inputs exercise both macros. These weaker checks also existed before migration.
The source diff changes test code, test-only helpers, and imports under test configuration. It does not change runtime logic or the public API.
The grouped targets use nested module declarations instead of repetitive path attributes. Test names include prefixes such as
buffers::buf::andconversions::from_bytes::. Buffer and view targets share the existing private block fixture through explicit paths. A privatetest_memorymodule also reuses the allocation fixture through publicBlockandMemoryAPIs. The coordinator received these paths and every pushed head.The core targets no longer require
test-util, so their tests also run without the library'sstdfeature. Standard I/O cases requirestd. Thememory_providerstarget retains itstest-utilrequirement. Compatibility chunks are initialized before everyadvance_mutcall.Both Linux coverage jobs at
079b1e73reported seven uncovered lines in the shared block fixture. The moved metadata tests already exercise those paths. The coverage filter conservatively retains helper counters when source ownership is uncertain. A file-level#![cfg(test)]now makes the fixture's existing test-only scope explicit. Every caller already compiled it only in tests. No assertions, coverage thresholds, ignores, or stress-test selection changed.The publishing pipeline at
1e649cf4exposed eightunwrap_useddiagnostics in helpers in the host integration target. A file-level#![cfg(test)]now expresses that target's existing test-only scope. This lets Clippy apply the repository's existing test policy. All unwraps, assertions, helpers, and test names remain unchanged. No lint allows were added.The exact targeted Clippy command reproduced all eight errors before this change and passed afterward on Windows. The package compilation passed. Both original integration cases ran and passed, with zero ignored or filtered cases:
The publishing log at
9d32f29bno longer reports those host errors. It reports three distinctunwrap_usederrors inbytesbufintegration helpers. The narrow local reproduction also exposed a Windows-onlypaniclint in the migrated memory-status helper. Three file-level#![cfg(test)]guards now express the helpers' existing test-only scope. The repair preserves every unwrap, panic, assertion, test name, host-memory guard, and Miri condition. It adds no lint allows or exclusions.The same targeted Clippy command failed before the repair and passed afterward on Windows. Package compilation also passed:
Formatting passed with the pinned nightly. The macro changes passed the affected-package compilation and all 24 expansion cases:
The block fixture change passed compilation and all 156 tests in its unit, buffer, and view targets: 37, 56, and 63 cases.
The earlier affected-package compilation passed:
The core targets passed 116 tests without the library's
stdfeature: 46 buffer, 58 view, and 12 conversion cases.cargo treereported onlybytes-compatfor the library's enabled features.After the final helper-scope repair, all four targets passed 165 tests with all features: 56 buffer, 63 view, 13 conversion, and 33 memory-provider cases. The counts match the earlier compatibility and telemetry run.
Three existing large-allocation tests were compiled but not run locally. CI for the latest head remains pending. The local coverage tool lacks the CI recipe's
runcommand, so the coverage repair still needs CI confirmation. No full local test suite, coverage run, mutation run, or broad feature matrix was run.Merge Danger
Risk is limited to test setup, placement, feature selection, test-only scope, and stricter macro assertions. Core tests now run without
test-util. Compatibility, standard I/O, and telemetry cases keep the gates required by their APIs. The large-allocation cases retain their inputs and host-memory guards. Test selectors must account for the added module prefixes. The known Clippy failure inarty_executorpredates this PR and remains outside this batch. CI must cover the remaining configurations before merge.