spinframework / spinframework/spin

Make sure debug assertions work in tests

Open
#3,632 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
6.5k
Forks
310
Avg merge
1d 20h
Merged PRs (30d)
24

Description

We currently run a lot of tests with --release for performance reasons (wasmtime cranelift compile times): https://github.com/spinframework/spin/blob/291316ddd376e14ae0850967e83d8a94962f93c5/Makefile#L57-L76

One major downside of this is that it disables debug assertions, which we definitely would rather have enabled for testing.

@alexcrichton has suggested that we can probably mitigate the performance issues by selectively enabling optimizations just for cranelift, e.g.:

[profile.test.package.cranelift-codegen]
opt-level = 3

I would probably do the same for [profile.dev] as well, for the same reasons.

Another option would be to continue testing with --release and selectively enable debug-assertions when testing, but there are other reasons to avoid --release such as - ironically - making compilation of the tests themselves faster.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the test commands in Makefile lines 57-76 and the Cargo profile settings described in the issue. Compare selectively optimizing Cranelift in test and development profiles with enabling debug assertions under release testing. Done means tests retain debug assertions while avoiding the reported Cranelift compilation cost.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, testing
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.