›run the test suite
◆Run cargo test
error: connection refused (postgres at localhost:5432)
test result: FAILED. 143 passed; 5 failed; 0 ignored
›use just test, not cargo test. it starts the test database first.
◆Run just test
Starting postgres on :5433 ... ready
test result: ok. 148 passed; 0 failed; 0 ignored
All 148 tests pass with just test.
›add a retry with backoff to the webhook sender
◆Memory topics/testing.md
·Run the suite with just test. It starts the test database and then runs cargo
test; plain cargo test fails the integration tests.
◆Edit src/webhooks.rs
43
44
45
46
47
48
for attempt in 0..MAX_ATTEMPTS {
if self.post(event).await.is_ok() {
return Ok(());
}
sleep(backoff(attempt)).await;
}
◆Run just test
Starting postgres on :5433 ... ready
test result: ok. 151 passed; 0 failed; 0 ignored
Added the retry in src/webhooks.rs. 151 tests pass with just test.