Conversation
Currently, the guide code blocks tests fail under Miri as they invoke the Rust compiler, which Miri doesn't support. We've missed this because passing the Miri tests are not required for merging PRs. This commit fixes this by ignoring Rust and Askama tests under Miri.
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts the documentation code-block test harness so it can run under Miri by skipping doctest cases that would spawn subprocesses (unsupported by Miri). This aligns cot-test’s guide-validation tests with Miri’s capabilities while preserving coverage in normal cargo test runs.
Changes:
- Marks Rust and Askama-template code-block trials as ignored when compiled under
cfg!(miri). - Adds a small classification (
needs_subprocess) to gate the ignore behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+91
to
+94
| // Rust and Askama tests invoke `cargo check`, which spawns a subprocess via | ||
| // `pidfd_spawnp` - an operation Miri doesn't support. | ||
| let needs_subprocess = | ||
| matches!(lang, TestLanguage::Rust | TestLanguage::AskamaTemplate); |
|
| Branch | fix-miri |
| Testbed | github-ubuntu-latest |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result microseconds (µs) (Result Δ%) | Upper Boundary microseconds (µs) (Limit %) |
|---|---|---|---|
| empty_router/empty_router | 📈 view plot 🚷 view threshold | 6,624.40 µs(+7.33%)Baseline: 6,172.21 µs | 7,802.61 µs (84.90%) |
| json_api/json_api | 📈 view plot 🚷 view threshold | 1,119.40 µs(+3.78%)Baseline: 1,078.61 µs | 1,327.83 µs (84.30%) |
| nested_routers/nested_routers | 📈 view plot 🚷 view threshold | 1,062.50 µs(+6.32%)Baseline: 999.36 µs | 1,208.67 µs (87.91%) |
| single_root_route/single_root_route | 📈 view plot 🚷 view threshold | 998.68 µs(+3.79%)Baseline: 962.19 µs | 1,171.93 µs (85.22%) |
| single_root_route_burst/single_root_route_burst | 📈 view plot 🚷 view threshold | 16,250.00 µs(-7.61%)Baseline: 17,587.77 µs | 21,093.19 µs (77.04%) |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
12 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently, the guide code blocks tests fail under Miri as they invoke the Rust compiler, which Miri doesn't support. We've missed this because passing the Miri tests are not required for merging PRs. This commit fixes this by ignoring Rust and Askama tests under Miri.
Type of change