spin: `make test-kv` fails locally, but hard to understand why

This is what I get running make test-kv on main:

~/github/spin [main|⚑ 1] 
09:12 $ make test-kv
RUST_LOG=spin=trace cargo test --test spinup_tests --features e2e-tests --no-fail-fast -- spinup_tests::key_value_works --nocapture
    Finished test [unoptimized + debuginfo] target(s) in 0.36s
     Running tests/spinup_tests.rs (target/debug/deps/spinup_tests-7b263268d6339070)

running 1 test
thread 'spinup_tests::key_value_works' panicked at 'called `Result::unwrap()` on an `Err` value: assertion failed: `(left == right)`
  left: `200`,
 right: `500`', tests/testcases/mod.rs:53:34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test spinup_tests::key_value_works ... FAILED

failures:

failures:
    spinup_tests::key_value_works

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 20 filtered out; finished in 2.27s

error: test failed, to rerun pass `--test spinup_tests`
error: 1 target failed:
    `--test spinup_tests`
make: *** [Makefile:64: test-kv] Error 101

(Yes, I am working on KV at the moment and so my initial assumption was that I had broken it. But this happens on clean main without any of my changes.)

Presumably one of the ensures in the HTTP handler is failing, but it’s not clear to me how to diagnose the problem. It would be good to provide at least core diagnostics in failure cases.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 26 (18 by maintainers)

Most upvoted comments

It would be really nice if we could get the tests to run without requiring any state on the dev machine to be present. I’m not sure I understand the status quo 100%, but ultimately we want the tests to exercise the locally built spin, and the best way to ensure that is to use an absolute path to the right executable instead of trying to get that executable to be available in the PATH.