diff --git a/HarborForge.Backend.Test b/HarborForge.Backend.Test index 5f6a3df..ed21b73 160000 --- a/HarborForge.Backend.Test +++ b/HarborForge.Backend.Test @@ -1 +1 @@ -Subproject commit 5f6a3dffe423e18cd9b2762aa67afafa1f313d5f +Subproject commit ed21b73a431e89a6172a1e22a6705d326cdfd3d8 diff --git a/run-test-frontend.sh b/run-test-frontend.sh index dcc06ee..256402d 100755 --- a/run-test-frontend.sh +++ b/run-test-frontend.sh @@ -1,15 +1,16 @@ #!/bin/bash # Run frontend test with optional port exposure -# Usage: ./run-test-frontend.sh [--expose-port {on|off}] -# Default: off -# -# --expose-port on: Keep services running after test (manual cleanup required) -# --expose-port off: Auto cleanup after test (default) +# Usage: ./run-test-frontend.sh [--expose-port {on|off}] [--test-real-plugin] +# Default: +# --expose-port off: Auto cleanup after test +# --test-real-plugin: Run only real-plugin.spec.ts (requires vps.t1 plugin) set -e EXPOSE_PORT="off" +TEST_REAL_PLUGIN="off" COMPOSE_FILE="docker-compose-frontend.yml" +TEST_PATTERN="" # Load environment variables from .env.TEST if exists if [ -f ".env.TEST" ]; then @@ -30,9 +31,13 @@ while [[ $# -gt 0 ]]; do EXPOSE_PORT="${1#*=}" shift ;; + --test-real-plugin) + TEST_REAL_PLUGIN="on" + shift + ;; *) echo "Unknown option: $1" - echo "Usage: $0 [--expose-port {on|off}]" + echo "Usage: $0 [--expose-port {on|off}] [--test-real-plugin]" exit 1 ;; esac @@ -44,6 +49,14 @@ if [[ "$EXPOSE_PORT" != "on" && "$EXPOSE_PORT" != "off" ]]; then exit 1 fi +# Set test pattern for real plugin test +if [[ "$TEST_REAL_PLUGIN" == "on" ]]; then + TEST_PATTERN="real-plugin.spec.ts" + echo "๐Ÿ”Œ Real Plugin Test Mode: ON" + echo " Will run: tests/real-plugin.spec.ts" + echo " Requires vps.t1 to have OpenClaw plugin installed" +fi + # Select compose file based on expose-port if [[ "$EXPOSE_PORT" == "on" ]]; then COMPOSE_FILE="docker-compose-frontend-expose.yml" @@ -114,7 +127,13 @@ echo "โœ… Services ready!" # Run test echo "๐Ÿงช Running test..." -docker compose -f "$COMPOSE_FILE" run --rm -e WORKERS=1 test +if [[ -n "$TEST_PATTERN" ]]; then + # Run specific test for real plugin + docker compose -f "$COMPOSE_FILE" run --rm -e WORKERS=1 test npx playwright test tests/real-plugin.spec.ts --reporter=list +else + # Run all tests + docker compose -f "$COMPOSE_FILE" run --rm -e WORKERS=1 test +fi TEST_EXIT_CODE=$? # Cleanup decision based on expose-port