This commit is contained in:
24 files changed
+658
-650
No files matched your search
+3
-3
@@ -61,13 +61,13 @@ LOG_LEVEL=info LOG_HTTP=false test/run-test-server.sh bin/chess-server
|
||||
### Manual Testing Examples
|
||||
```bash
|
||||
# Login as alice
|
||||
curl -X POST http://localhost:8080/auth/login \
|
||||
curl -X POST http://localhost:8080/api/auth/login \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"username":"alice","password":"AlicePass123"}'
|
||||
-d '{"identifier":"alice","password":"AlicePass123"}'
|
||||
|
||||
# Create authenticated game
|
||||
TOKEN="<jwt-from-login>"
|
||||
curl -X POST http://localhost:8080/games \
|
||||
curl -X POST http://localhost:8080/api/games \
|
||||
-H "Authorization: Bearer $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"white":{"type":1},"black":{"type":2,"level":10}}'
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@
|
||||
# Requires: curl, jq
|
||||
|
||||
BASE_URL="http://localhost:8080"
|
||||
API_URL="${BASE_URL}/api/v1"
|
||||
API_URL="${BASE_URL}/api"
|
||||
|
||||
# Configurable delay between API calls (in milliseconds)
|
||||
API_DELAY=${API_DELAY:-50} # 50ms for dev mode testing
|
||||
@@ -130,7 +130,7 @@ fi
|
||||
# Start tests
|
||||
print_header "Chess API Robustness Test Suite"
|
||||
echo "Server: $BASE_URL"
|
||||
echo "API Version: v1"
|
||||
echo "API: $API_URL"
|
||||
echo -e "${MAGENTA} IMPORTANT: Server must be started with -dev flag for tests to pass!${NC}"
|
||||
echo -e "${MAGENTA} Start the server first: test/run-test-server.sh${NC}"
|
||||
echo -e "${MAGENTA} Or directly after build: bin/chess-server -dev${NC}"
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
# Start with: test/run-test-server.sh
|
||||
|
||||
BASE_URL="http://localhost:8080"
|
||||
API_URL="${BASE_URL}/api/v1"
|
||||
API_URL="${BASE_URL}/api"
|
||||
CHESS_SERVER_EXEC=${1:-"bin/chess-server"}
|
||||
# Same disposable database as the running test server (see run-test-server.sh).
|
||||
# Use a libpq-compatible DSN: it is passed to both chess-server and psql.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
BASE_URL="${BASE_URL:-http://localhost:8080}"
|
||||
API_URL="${BASE_URL}/api/v1"
|
||||
API_URL="${BASE_URL}/api"
|
||||
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'; CYAN='\033[0;36m'; NC='\033[0m'
|
||||
PASS=0; FAIL=0
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
set -e
|
||||
|
||||
# Configuration
|
||||
API_URL="${API_URL:-http://localhost:8080/api/v1}" # Updated to include /api/v1
|
||||
API_URL="${API_URL:-http://localhost:8080/api}"
|
||||
VERBOSE="${VERBOSE:-false}"
|
||||
|
||||
# Colors for output
|
||||
|
||||
Reference in new issue
Block a user