Skip to content

fix: guide code blocks tests under Miri#593

Open
m4tx wants to merge 2 commits into
masterfrom
fix-miri
Open

fix: guide code blocks tests under Miri#593
m4tx wants to merge 2 commits into
masterfrom
fix-miri

Conversation

@m4tx

@m4tx m4tx commented Jun 21, 2026

Copy link
Copy Markdown
Member

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

  • Bug fix
  • New feature
  • Documentation
  • Refactor / cleanup
  • Performance improvement
  • Other (describe above)

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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);
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

🐰 Bencher Report

Branchfix-miri
Testbedgithub-ubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark 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%)
🐰 View full continuous benchmarking report in Bencher

@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
rust 90.24% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m4tx m4tx marked this pull request as ready for review June 22, 2026 08:15
@m4tx m4tx requested review from ElijahAhianyo and seqre June 22, 2026 08:15
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.

2 participants