diff options
| author | Dawid Rycerz <dawid@rycerz.xyz> | 2026-02-15 21:27:00 +0100 |
|---|---|---|
| committer | Dawid Rycerz <dawid@rycerz.xyz> | 2026-02-15 21:27:00 +0100 |
| commit | ce0dbf6b249956700c6a1705bf4ad85a09d53e8c (patch) | |
| tree | d7c3236807cfbf75d7f3a355eb5df5a5e2cc4ad7 /tests/integration/sighup.rs | |
| parent | 064a1d01c5c14f5ecc032fa9b8346a4a88b893f6 (diff) | |
Switch, cleanup, and status CLI commands. Persistent build state via
state.json. Post-deploy hooks on success and failure with
WITRYNA_BUILD_STATUS. Dependency diet (axum→tiny_http, clap→argh,
tracing→log). Drop built-in rate limiting. Nix flake with NixOS module.
Arch Linux PKGBUILD. Centralized version management.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'tests/integration/sighup.rs')
| -rw-r--r-- | tests/integration/sighup.rs | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/tests/integration/sighup.rs b/tests/integration/sighup.rs index 23c0dfd..0474f1d 100644 --- a/tests/integration/sighup.rs +++ b/tests/integration/sighup.rs @@ -116,8 +116,20 @@ repo_url = "https://example.com/new.git" branch = "main" webhook_token = "new-token" "#, - server.state.config.read().await.base_dir.display(), - server.state.config.read().await.log_dir.display(), + server + .state + .config + .read() + .expect("config lock poisoned") + .base_dir + .display(), + server + .state + .config + .read() + .expect("config lock poisoned") + .log_dir + .display(), ); tokio::fs::write(config_path, &new_toml).await.unwrap(); @@ -134,16 +146,20 @@ webhook_token = "new-token" assert_eq!(resp.status().as_u16(), 200); // Verify the reloadable field (sites) was updated - let config = server.state.config.read().await; - assert_eq!(config.sites.len(), 2, "sites should have been reloaded"); - assert!( - config.find_site("new-site").is_some(), - "new-site should exist after reload" - ); + let (sites_len, has_new_site, listen_addr) = { + let config = server.state.config.read().expect("config lock poisoned"); + ( + config.sites.len(), + config.find_site("new-site").is_some(), + config.listen_address.clone(), + ) + }; + assert_eq!(sites_len, 2, "sites should have been reloaded"); + assert!(has_new_site, "new-site should exist after reload"); // Verify non-reloadable field was preserved (not overwritten with "127.0.0.1:19999") assert_ne!( - config.listen_address, "127.0.0.1:19999", + listen_addr, "127.0.0.1:19999", "listen_address should be preserved from original config" ); } |
