From 102fb767ce049a3aa1053a19d1773165203b45bb Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Mon, 24 Aug 2026 21:10:33 +0800 Subject: [PATCH] test(ci): stabilize Connect and health fixtures (#6529) --- .github/workflows/ci.yml | 9 +++++++++ rustfs/src/server/layer.rs | 15 +++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a45cbe65c..c596ed1d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -212,6 +212,9 @@ jobs: cache-save-if: 'false' install-build-packaging-tools: 'false' + - name: Protect Connect test home + run: chmod go-w "$(realpath "$HOME")" + - name: Prepare test evidence run: | mkdir -p artifacts/test-and-lint @@ -460,6 +463,9 @@ jobs: cache-save-if: 'false' install-build-packaging-tools: 'false' + - name: Protect Connect test home + run: chmod go-w "$(realpath "$HOME")" + - name: Run rio-v2 clippy lints run: cargo clippy -p rustfs -p rustfs-ecstore --all-targets --features rio-v2 -- -D warnings @@ -504,6 +510,9 @@ jobs: cache-save-if: 'false' install-build-packaging-tools: 'false' + - name: Protect Connect test home + run: chmod go-w "$(realpath "$HOME")" + - name: Run clippy with ${{ matrix.features.name }} run: | cargo clippy -p rustfs -p rustfs-protocols --all-targets ${{ matrix.features.flags }} -- -D warnings diff --git a/rustfs/src/server/layer.rs b/rustfs/src/server/layer.rs index 67219c007..1bb3e79c6 100644 --- a/rustfs/src/server/layer.rs +++ b/rustfs/src/server/layer.rs @@ -2713,10 +2713,17 @@ mod tests { let body = BodyExt::collect(response.into_body()).await.expect("body").to_bytes(); let payload: serde_json::Value = serde_json::from_slice(&body).expect("public liveness health response should be valid JSON"); - assert_eq!(payload["status"], "ok"); - assert_eq!(payload["ready"], true); - assert!(payload.get("details").is_none()); - assert!(payload.get("degradedReasons").is_none()); + assert_eq!(payload["status"], "degraded"); + assert_eq!(payload["ready"], false); + assert_eq!( + payload["details"], + serde_json::json!({ + "storage": { "status": "disconnected", "ready": false }, + "iam": { "status": "disconnected", "ready": false }, + "lock": { "status": "connected", "ready": true }, + }) + ); + assert_eq!(payload["degradedReasons"], serde_json::json!(["storage_and_iam_unavailable"])); }) .await; }