From 1e810c5091a3ef2c98ceb48e680970d1726544a0 Mon Sep 17 00:00:00 2001 From: Pengfei Wang Date: Thu, 7 May 2026 11:52:12 +0800 Subject: [PATCH] chore: enhance tests --- Scripts/local_integration_bootstrap.sh | 6 ++++-- .../LocalStackHarnessTests.swift | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Scripts/local_integration_bootstrap.sh b/Scripts/local_integration_bootstrap.sh index bcd824c..96070d5 100755 --- a/Scripts/local_integration_bootstrap.sh +++ b/Scripts/local_integration_bootstrap.sh @@ -27,8 +27,10 @@ BOOTSTRAP_UNBOUND_DEVICE_DISPLAY_NAME="${DGW_LOCAL_BOOTSTRAP_UNBOUND_DEVICE_DISP BOOTSTRAP_UNBOUND_DEVICE_DESCRIPTION="${DGW_LOCAL_BOOTSTRAP_UNBOUND_DEVICE_DESCRIPTION:-Swift local unbound gateway init device}" BOOTSTRAP_SUITE_DISPLAY_NAME="${DGW_LOCAL_BOOTSTRAP_SUITE_DISPLAY_NAME:-swift-local-suite-${BOOTSTRAP_RUN_SUFFIX}}" BOOTSTRAP_SUITE_DESCRIPTION="${DGW_LOCAL_BOOTSTRAP_SUITE_DESCRIPTION:-Swift local gateway init suite}" -BOOTSTRAP_API_KEY_ID="${DGW_LOCAL_BOOTSTRAP_API_KEY_ID:-swift-local-key-${BOOTSTRAP_RUN_SUFFIX}}" -BOOTSTRAP_API_KEY_PREFIX="${DGW_LOCAL_BOOTSTRAP_API_KEY_PREFIX:-swift-local-${BOOTSTRAP_RUN_SUFFIX}}" +BOOTSTRAP_API_KEY_SUFFIX="${BOOTSTRAP_RUN_SUFFIX//[^[:alnum:]-]/-}" +BOOTSTRAP_API_KEY_SUFFIX="${BOOTSTRAP_API_KEY_SUFFIX:0:26}" +BOOTSTRAP_API_KEY_ID="${DGW_LOCAL_BOOTSTRAP_API_KEY_ID:-swift-key-${BOOTSTRAP_API_KEY_SUFFIX}}" +BOOTSTRAP_API_KEY_PREFIX="${DGW_LOCAL_BOOTSTRAP_API_KEY_PREFIX:-swift-local-${BOOTSTRAP_API_KEY_SUFFIX}}" BOOTSTRAP_API_KEY_STATUS="${DGW_LOCAL_BOOTSTRAP_API_KEY_STATUS:-1}" BOOTSTRAP_CSRF_ORIGIN="${DGW_LOCAL_BOOTSTRAP_CSRF_ORIGIN:-$GATEWAY_HTTP_BASE}" CURL_CONNECT_TIMEOUT_SECONDS="${DGW_LOCAL_BOOTSTRAP_CONNECT_TIMEOUT_SECONDS:-3}" diff --git a/Tests/DataGatewayClientIntegrationTests/LocalStackHarnessTests.swift b/Tests/DataGatewayClientIntegrationTests/LocalStackHarnessTests.swift index 732d13b..4c16eb6 100644 --- a/Tests/DataGatewayClientIntegrationTests/LocalStackHarnessTests.swift +++ b/Tests/DataGatewayClientIntegrationTests/LocalStackHarnessTests.swift @@ -141,6 +141,8 @@ struct LocalStackHarnessTests { #expect(script.contains("DGW_LOCAL_BOOTSTRAP_ADMIN_PASSWORD")) #expect(script.contains("DGW_LOCAL_BOOTSTRAP_MAX_TIME_SECONDS")) #expect(script.contains("DGW_LOCAL_BOOTSTRAP_CONNECT_TIMEOUT_SECONDS")) + #expect(script.contains(#"BOOTSTRAP_API_KEY_SUFFIX="${BOOTSTRAP_API_KEY_SUFFIX:0:26}""#)) + #expect(script.contains("swift-key-${BOOTSTRAP_API_KEY_SUFFIX}")) #expect(script.contains("DGW_LOCAL_CREDENTIAL_BASE64")) #expect(script.contains("DGW_LOCAL_DEVICE_ID")) #expect(script.contains("DGW_LOCAL_UNBOUND_DEVICE_ID"))