Skip to content

ci: run the Rust unit tests natively and under Miri - #128

Open
greenclaw wants to merge 2 commits into
awolverp:mainfrom
greenclaw:test/miri
Open

greenclaw wants to merge 2 commits into
awolverp:mainfrom
greenclaw:test/miri

Conversation

@greenclaw

Copy link
Copy Markdown
Contributor

Closes #126.

  • LazyHeap and LinkedList get unit tests (11 new): the heap invariant, lazy sort keys and pending pushes; links, the free-list cap and edge cases; plus a random-operations test against a std model for each.
  • New Rust Test workflow with two jobs: cargo test on stable and cargo +nightly miri test. Miri covers hashbrown, LinkedList and LazyHeap, since they don't call into libpython.

All 18 tests pass natively and under Miri. Fork run: https://github.com/greenclaw/cachebox/actions/runs/41207192640. The jobs take about 20–30 s and 1.5 min and run in parallel with Python Test.

Miri runs on nightly, so a nightly regression could turn the job red without a change on our side. If that becomes annoying, continue-on-error: true on the job keeps it visible without blocking.

Cover the heap invariant, lazy sort keys and pending pushes in LazyHeap, and
links, the free list cap and edge cases in LinkedList. Each type also gets a
random-operations test against a simple std model. None of this code calls
into libpython, so all of it runs under Miri.
cargo test on stable, and cargo miri test on nightly to check the unsafe code
in hashbrown, LinkedList and LazyHeap for undefined behaviour and leaks.

This branch has not been deployed

No deployments
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.

Proposal: Miri-checked tests for the unsafe data structures

1 participant