zingolabs / zingolib_original

ZingoLib
MIT License
1 stars 1 forks source link

cargo test --workspace fails in my local dev environment #30

Closed zancas closed 2 years ago

zancas commented 2 years ago

I see this commit locally: b13c2a22b0ab730308e90437ea53dd902029d6b1

zancas commented 2 years ago

This failure is due to keygen.sh not running before the test_server HTTPS tests. The relevant tests need to ensure the existence of the cert-key prior to running.

AloeareV commented 2 years ago

I've found a few different options for this.. Among them, https://github.com/la10736/rstest and https://github.com/mindsbackyard/galvanic-test

rstest looks the most minimal of the options I've looked at, so far.

AloeareV commented 2 years ago

I think it might be better to have our own test.sh script, rather than needing to instrument all tests, especially as an erroneously un-instrumented test might do something wild (e.g. cause a race condition, which could very rarely and unpredictably cause test failures).

AloeareV commented 2 years ago

Another (more involved) option is to use our own test harness.

AloeareV commented 2 years ago

... Or I could just put it inside of create_test_server(). Duh.

AloeareV commented 2 years ago

Implementation question: Do we want to rerun keygen every time we run the tests? Or just if there's no key? I'm inclined to say every time. Maybe even use a tempfile.

zancas commented 2 years ago

I say throw it in create_test_server and throw the file in the test-specific temp-dir. I'm a huge fan of ALL test state being in a test-specific, easily found location.