Compare commits

...

35 Commits

Author SHA1 Message Date
zhi
ef8a4ae994 BE-PR-010: update submodule ref for Backend.Test 2026-03-30 12:50:03 +00:00
zhi
4c54503a81 Update HarborForge.Backend.Test submodule ref 2026-03-30 11:46:26 +00:00
zhi
62d339b58c BE-PR-001: Update submodule ref for Backend.Test 2026-03-29 15:35:54 +00:00
zhi
23cad37e03 test: simplify frontend test runner and rely on image default command
- remove --test-real-plugin option
- stop overriding test container CMD
- let Frontend.Test Dockerfile own proxy startup and playwright launch
2026-03-21 10:10:59 +00:00
zhi
779fb7b387 test: update frontend test defaults and propose suite 2026-03-20 11:38:12 +00:00
zhi
48c54c2f32 test: exclude real-plugin frontend test by default
Only run real-plugin.spec.ts when --test-real-plugin is explicitly provided.
2026-03-20 11:26:14 +00:00
zhi
f5294f5290 chore: update backend test submodule pointer 2026-03-20 09:47:51 +00:00
zhi
11d0865fd3 chore: update Frontend.Test with fixed real-plugin test 2026-03-20 05:08:44 +00:00
zhi
14f4fb8d16 chore: update Frontend.Test with real-plugin.spec.ts 2026-03-19 22:25:28 +00:00
zhi
cc2d4aea5c test: add real plugin integration test and --test-real-plugin option
- Add tests/real-plugin.spec.ts for end-to-end plugin testing
- Add --test-real-plugin flag to run-test-frontend.sh
- Test verifies: server registration, API key generation, heartbeat,
  data persistence, invalid key rejection, key revocation
2026-03-19 22:07:54 +00:00
zhi
5a45a72dcf chore: update Backend.Test submodule with comprehensive test suite
134 backend API tests added as independent project
2026-03-19 12:44:29 +00:00
zhi
ba3909ec68 chore: update Frontend.Test to master (includes task type fix) 2026-03-19 12:25:04 +00:00
805dc2fe32 Merge pull request 'chore: run frontend tests with modal-editor updates' (#4) from feat/modal-edit-permissions-20260316 into master
Reviewed-on: #4
2026-03-16 19:44:45 +00:00
zhi
81fe00bfb8 chore: update frontend test submodule for modal editors 2026-03-16 18:13:54 +00:00
zhi
4707f0614c chore: run frontend tests against dev-mode ui 2026-03-16 16:32:26 +00:00
zhi
c76c25fb5b chore: update frontend test submodule 2026-03-16 13:22:28 +00:00
zhi
1bb11ca92b chore: update Frontend.Test submodule (Issue→Task rename) 2026-03-16 07:48:18 +00:00
zhi
4844b63c16 chore: update Frontend.Test submodule (add task.spec.ts) 2026-03-16 07:26:48 +00:00
zhi
8b1edf53f0 chore: update Frontend.Test submodule (test isolation fix) 2026-03-16 06:32:45 +00:00
zhi
3aaffd2e67 chore: update Frontend.Test submodule (fix milestone test flakiness) 2026-03-16 06:17:48 +00:00
zhi
62ca6bd32b test: use local proxy endpoints for e2e 2026-03-15 22:40:17 +00:00
zhi
15859b9f28 test: use localhost wizard/backend urls 2026-03-15 21:57:39 +00:00
zhi
d3c5f6df8c chore: update test submodule pointers 2026-03-15 16:36:24 +00:00
a4620b9604 Merge pull request 'chore: update backend test submodule' (#3) from chore/remove-backend-test-submodule into master
Reviewed-on: #3
2026-03-15 16:33:14 +00:00
b0d6a0bdd7 Merge branch 'master' into chore/remove-backend-test-submodule 2026-03-15 16:33:02 +00:00
zhi
ebdac827c1 chore: update backend test submodule 2026-03-15 16:30:00 +00:00
2424ec33e0 Merge pull request 'test: rebuild backend/test runner and wait for mysql' (#2) from chore/test-runner-rebuild into master
Reviewed-on: #2
2026-03-15 16:23:45 +00:00
zhi
1047110de5 test: rebuild backend/test runner and wait for mysql 2026-03-15 15:56:03 +00:00
95a6354fc3 Merge pull request 'feature/role-permission-system' (#1) from feature/role-permission-system into master
Reviewed-on: #1
2026-03-15 13:50:28 +00:00
524a4a5b46 Update submodule to latest test files 2026-03-15 13:40:50 +00:00
cf4b9f406b fix: run tests with 1 worker to avoid race conditions 2026-03-15 13:36:32 +00:00
3591ef2c84 fix: add --no-cache to ensure frontend rebuilds with correct API base 2026-03-15 12:57:40 +00:00
4c45a57649 fix: always rebuild frontend with correct VITE_API_BASE 2026-03-15 12:48:12 +00:00
Zhi
1524891b2f chore: remove credentials from submodule urls 2026-03-14 13:21:11 +00:00
Zhi
c4bf1f6a12 Use localhost wizard in frontend and add proxy envs 2026-03-14 10:22:57 +00:00
6 changed files with 64 additions and 21 deletions

4
.gitmodules vendored
View File

@@ -1,6 +1,6 @@
[submodule "HarborForge.Backend.Test"] [submodule "HarborForge.Backend.Test"]
path = HarborForge.Backend.Test path = HarborForge.Backend.Test
url = https://zhi:rT5Wjw24mV4all38fIoNQfl2@git.hangman-lab.top/zhi/HarborForge.Backend.Test.git url = https://git.hangman-lab.top/zhi/HarborForge.Backend.Test.git
[submodule "HarborForge.Frontend.Test"] [submodule "HarborForge.Frontend.Test"]
path = HarborForge.Frontend.Test path = HarborForge.Frontend.Test
url = https://zhi:rT5Wjw24mV4all38fIoNQfl2@git.hangman-lab.top/zhi/HarborForge.Frontend.Test.git url = https://git.hangman-lab.top/zhi/HarborForge.Frontend.Test.git

View File

@@ -69,12 +69,14 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
VITE_WIZARD_PORT: ${WIZARD_PORT:-8080} VITE_WIZARD_PORT: ${WIZARD_PORT:-8080}
VITE_WIZARD_HOST: wizard
image: harborforge-test-frontend:dev image: harborforge-test-frontend:dev
container_name: harborforge-test-frontend container_name: harborforge-test-frontend
restart: "no" restart: "no"
environment: environment:
VITE_API_BASE_URL: http://backend:${BACKEND_PORT:-8000} VITE_API_BASE_URL: http://backend:${BACKEND_PORT:-8000}
VITE_WIZARD_PORT: ${WIZARD_PORT:-8080}
FRONTEND_DEV_MODE: ${FRONTEND_DEV_MODE:-1}
NODE_ENV: development
ports: ports:
- "127.0.0.1:${FRONTEND_PORT:-3000}:${FRONTEND_PORT:-3000}" - "127.0.0.1:${FRONTEND_PORT:-3000}:${FRONTEND_PORT:-3000}"
depends_on: depends_on:
@@ -92,11 +94,16 @@ services:
restart: "no" restart: "no"
environment: environment:
# Use internal service name for test to reach frontend # Use internal service name for test to reach frontend
BASE_URL: http://frontend:${FRONTEND_PORT:-3000} BASE_URL: http://127.0.0.1:${FRONTEND_PORT:-3000}
FRONTEND_URL: http://frontend:${FRONTEND_PORT:-3000} FRONTEND_URL: http://127.0.0.1:${FRONTEND_PORT:-3000}
WEB_SERVER_URL: http://frontend:${FRONTEND_PORT:-3000} WEB_SERVER_URL: http://127.0.0.1:${FRONTEND_PORT:-3000}
WIZARD_URL: http://wizard:${WIZARD_PORT:-8080}/wizard WIZARD_URL: http://127.0.0.1:${WIZARD_PORT:-8080}/wizard
WIZARD_API_URL: http://wizard:${WIZARD_PORT:-8080} WIZARD_API_URL: http://127.0.0.1:${WIZARD_PORT:-8080}
WIZARD_HOST: wizard
WIZARD_PORT: ${WIZARD_PORT:-8080}
BACKEND_URL: http://127.0.0.1:${BACKEND_PORT:-8000}
BACKEND_HOST: backend
FRONTEND_HOST: frontend
CHROME_DEBUGGING_PORT: 9222 CHROME_DEBUGGING_PORT: 9222
networks: networks:
- test-network - test-network

View File

@@ -54,6 +54,9 @@ services:
SECRET_KEY: ${SECRET_KEY:-change_me_in_production} SECRET_KEY: ${SECRET_KEY:-change_me_in_production}
LOG_LEVEL: ${LOG_LEVEL:-INFO} LOG_LEVEL: ${LOG_LEVEL:-INFO}
DATABASE_URL: mysql+pymysql://harborforge:harborforge_pass@mysql:${MYSQL_PORT:-3306}/harborforge DATABASE_URL: mysql+pymysql://harborforge:harborforge_pass@mysql:${MYSQL_PORT:-3306}/harborforge
depends_on:
mysql:
condition: service_healthy
networks: networks:
- test-network - test-network
@@ -63,13 +66,15 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
VITE_WIZARD_PORT: ${WIZARD_PORT:-8080} VITE_WIZARD_PORT: ${WIZARD_PORT:-8080}
VITE_WIZARD_HOST: wizard
image: harborforge-test-frontend:dev image: harborforge-test-frontend:dev
container_name: harborforge-test-frontend container_name: harborforge-test-frontend
restart: "no" restart: "no"
environment: environment:
# Use internal service name # Use internal service name
VITE_API_BASE_URL: http://backend:${BACKEND_PORT:-8000} VITE_API_BASE_URL: http://backend:${BACKEND_PORT:-8000}
VITE_WIZARD_PORT: ${WIZARD_PORT:-8080}
FRONTEND_DEV_MODE: ${FRONTEND_DEV_MODE:-1}
NODE_ENV: development
networks: networks:
- test-network - test-network
@@ -85,6 +90,8 @@ services:
WEB_SERVER_URL: http://frontend:${FRONTEND_PORT:-3000} WEB_SERVER_URL: http://frontend:${FRONTEND_PORT:-3000}
WIZARD_URL: http://wizard:${WIZARD_PORT:-8080}/wizard WIZARD_URL: http://wizard:${WIZARD_PORT:-8080}/wizard
WIZARD_API_URL: http://wizard:${WIZARD_PORT:-8080} WIZARD_API_URL: http://wizard:${WIZARD_PORT:-8080}
WIZARD_HOST: wizard
WIZARD_PORT: ${WIZARD_PORT:-8080}
CHROME_DEBUGGING_PORT: 9222 CHROME_DEBUGGING_PORT: 9222
networks: networks:
- test-network - test-network

View File

@@ -1,10 +1,8 @@
#!/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}] # Usage: ./run-test-frontend.sh [--expose-port {on|off}]
# Default: off # Default:
# # --expose-port off: Auto cleanup after test
# --expose-port on: Keep services running after test (manual cleanup required)
# --expose-port off: Auto cleanup after test (default)
set -e set -e
@@ -54,13 +52,44 @@ fi
echo "📦 Using compose file: $COMPOSE_FILE" echo "📦 Using compose file: $COMPOSE_FILE"
run_quiet() {
local label="$1"
shift
local log_file
log_file=$(mktemp)
if "$@" >"$log_file" 2>&1; then
rm -f "$log_file"
return 0
fi
echo "${label} failed"
echo "--- ${label} log ---"
tail -n 200 "$log_file"
rm -f "$log_file"
return 1
}
# Clean any previous containers first # Clean any previous containers first
echo "🧹 Cleaning up previous containers..." echo "🧹 Cleaning up previous containers..."
docker compose -f "$COMPOSE_FILE" down -v 2>/dev/null || true docker compose -f "$COMPOSE_FILE" down -v >/dev/null 2>&1 || true
# Build frontend with correct API base URL (force no cache, remove image first)
echo "🔨 Building frontend..."
docker rmi harborforge-test-frontend:dev >/dev/null 2>&1 || true
run_quiet "frontend build" docker compose -f "$COMPOSE_FILE" build --no-cache --build-arg VITE_API_BASE=http://backend:8000 frontend
# Build backend (force no cache, remove image first)
echo "🔨 Building backend..."
docker rmi harborforge-test-backend:dev >/dev/null 2>&1 || true
run_quiet "backend build" docker compose -f "$COMPOSE_FILE" build --no-cache backend
# Build test runner (force no cache, remove image first)
echo "🔨 Building test runner..."
docker rmi harborforge-test-runner:dev >/dev/null 2>&1 || true
run_quiet "test runner build" docker compose -f "$COMPOSE_FILE" build --no-cache test
# Start services # Start services
echo "📦 Starting services..." echo "📦 Starting services..."
docker compose -f "$COMPOSE_FILE" up -d run_quiet "service startup" docker compose -f "$COMPOSE_FILE" up -d
# Wait for frontend to be ready # Wait for frontend to be ready
echo "⏳ Waiting for services..." echo "⏳ Waiting for services..."
@@ -81,9 +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..."
docker compose -f "$COMPOSE_FILE" run --rm test docker compose -f "$COMPOSE_FILE" run --rm -e WORKERS=1 test
TEST_EXIT_CODE=$? TEST_EXIT_CODE=$?
# Cleanup decision based on expose-port # Cleanup decision based on expose-port
@@ -93,7 +122,7 @@ if [[ "$EXPOSE_PORT" == "on" ]]; then
echo " Use './run-test-frontend.sh --expose-port on' to cleanup" echo " Use './run-test-frontend.sh --expose-port on' to cleanup"
echo " Or manually: docker compose -f $COMPOSE_FILE down -v" echo " Or manually: docker compose -f $COMPOSE_FILE down -v"
echo "" echo ""
if [ $TEST_EXIT_CODE -eq 0 ]; then if [ $TEST_EXIT_CODE -eq 0 ]; then
echo "✅ Test passed!" echo "✅ Test passed!"
else else
@@ -103,7 +132,7 @@ else
echo "" echo ""
echo "🧹 Cleaning up containers and volumes..." echo "🧹 Cleaning up containers and volumes..."
docker compose -f "$COMPOSE_FILE" down -v docker compose -f "$COMPOSE_FILE" down -v
if [ $TEST_EXIT_CODE -eq 0 ]; then if [ $TEST_EXIT_CODE -eq 0 ]; then
echo "✅ Test passed!" echo "✅ Test passed!"
else else