From a20dbd2f9f0b51ea08529a3ab4b220b4a89b1535 Mon Sep 17 00:00:00 2001 From: 4NK Dev Date: Thu, 25 Sep 2025 15:03:42 +0000 Subject: [PATCH] auto_clea --- tests | 1 + tests/health_check.sh | 23 ----------------------- tests/ws_connect.rs | 22 ---------------------- 3 files changed, 1 insertion(+), 45 deletions(-) create mode 120000 tests delete mode 100755 tests/health_check.sh delete mode 100644 tests/ws_connect.rs diff --git a/tests b/tests new file mode 120000 index 0000000..d2bb17b --- /dev/null +++ b/tests @@ -0,0 +1 @@ +/home/debian/4NK_env/tests/sdk_relay \ No newline at end of file diff --git a/tests/health_check.sh b/tests/health_check.sh deleted file mode 100755 index ca53779..0000000 --- a/tests/health_check.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -URL="http://localhost:8091/health" -echo "[tests] Vérification /health: $URL" - -http_code=$(curl -s -o /tmp/health_body.txt -w "%{http_code}" "$URL") -body=$(cat /tmp/health_body.txt) - -echo "HTTP $http_code" -echo "Body: $body" - -if [[ "$http_code" != "200" ]]; then - echo "Échec: code HTTP inattendu" >&2 - exit 1 -fi - -if [[ "$body" != '{"status":"ok"}' ]]; then - echo "Échec: corps inattendu" >&2 - exit 1 -fi - -echo "Succès: endpoint /health opérationnel" diff --git a/tests/ws_connect.rs b/tests/ws_connect.rs deleted file mode 100644 index a27c85f..0000000 --- a/tests/ws_connect.rs +++ /dev/null @@ -1,22 +0,0 @@ -use std::time::Duration; - -use tokio::time::timeout; -use tokio_tungstenite::connect_async; - -#[tokio::test(flavor = "multi_thread")] -async fn ws_connects_on_localhost_8090() { - if std::env::var("RUN_WS_TEST").ok().as_deref() != Some("1") { - // Test conditionnel: désactivé par défaut pour éviter les échecs en l'absence de serveur WS local - return; - } - let url = std::env::var("SDK_RELAY_WS_URL").unwrap_or_else(|_| "ws://0.0.0.0:8090".to_string()); - let connect_fut = connect_async(url); - let res = timeout(Duration::from_secs(3), connect_fut).await; - match res { - Ok(Ok((_stream, _resp))) => { - // Succès si la poignée de main WS passe - } - Ok(Err(e)) => panic!("Échec connexion WebSocket: {e}"), - Err(_) => panic!("Timeout connexion WebSocket"), - } -}