Make sure debug assertions work in tests
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 = 3I 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.
Source: spinframework/spin