Compare commits
7 Commits
11d0865fd3
...
dev-2026-0
| Author | SHA1 | Date | |
|---|---|---|---|
| ef8a4ae994 | |||
| 4c54503a81 | |||
| 62d339b58c | |||
| 23cad37e03 | |||
| 779fb7b387 | |||
| 48c54c2f32 | |||
| f5294f5290 |
Submodule HarborForge.Backend.Test updated: ed21b73a43...b505fa7b35
Submodule HarborForge.Frontend.Test updated: e41676fa5e...df05820a95
@@ -1,16 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Run frontend test with optional port exposure
|
# Run frontend test with optional port exposure
|
||||||
# Usage: ./run-test-frontend.sh [--expose-port {on|off}] [--test-real-plugin]
|
# Usage: ./run-test-frontend.sh [--expose-port {on|off}]
|
||||||
# Default:
|
# Default:
|
||||||
# --expose-port off: Auto cleanup after test
|
# --expose-port off: Auto cleanup after test
|
||||||
# --test-real-plugin: Run only real-plugin.spec.ts (requires vps.t1 plugin)
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
EXPOSE_PORT="off"
|
EXPOSE_PORT="off"
|
||||||
TEST_REAL_PLUGIN="off"
|
|
||||||
COMPOSE_FILE="docker-compose-frontend.yml"
|
COMPOSE_FILE="docker-compose-frontend.yml"
|
||||||
TEST_PATTERN=""
|
|
||||||
|
|
||||||
# Load environment variables from .env.TEST if exists
|
# Load environment variables from .env.TEST if exists
|
||||||
if [ -f ".env.TEST" ]; then
|
if [ -f ".env.TEST" ]; then
|
||||||
@@ -31,13 +28,9 @@ while [[ $# -gt 0 ]]; do
|
|||||||
EXPOSE_PORT="${1#*=}"
|
EXPOSE_PORT="${1#*=}"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--test-real-plugin)
|
|
||||||
TEST_REAL_PLUGIN="on"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "Unknown option: $1"
|
echo "Unknown option: $1"
|
||||||
echo "Usage: $0 [--expose-port {on|off}] [--test-real-plugin]"
|
echo "Usage: $0 [--expose-port {on|off}]"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -49,14 +42,6 @@ if [[ "$EXPOSE_PORT" != "on" && "$EXPOSE_PORT" != "off" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
# Select compose file based on expose-port
|
||||||
if [[ "$EXPOSE_PORT" == "on" ]]; then
|
if [[ "$EXPOSE_PORT" == "on" ]]; then
|
||||||
COMPOSE_FILE="docker-compose-frontend-expose.yml"
|
COMPOSE_FILE="docker-compose-frontend-expose.yml"
|
||||||
@@ -125,15 +110,9 @@ fi
|
|||||||
|
|
||||||
echo "✅ Services ready!"
|
echo "✅ Services ready!"
|
||||||
|
|
||||||
# Run test
|
# Run test using the image default CMD so proxy startup stays inside Frontend.Test Dockerfile
|
||||||
echo "🧪 Running test..."
|
echo "🧪 Running test..."
|
||||||
if [[ -n "$TEST_PATTERN" ]]; then
|
docker compose -f "$COMPOSE_FILE" run --rm -e WORKERS=1 test
|
||||||
# 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=$?
|
TEST_EXIT_CODE=$?
|
||||||
|
|
||||||
# Cleanup decision based on expose-port
|
# Cleanup decision based on expose-port
|
||||||
|
|||||||
Reference in New Issue
Block a user