-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_server.sh
More file actions
executable file
·51 lines (39 loc) · 1.38 KB
/
test_server.sh
File metadata and controls
executable file
·51 lines (39 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Test script for StormDB v2 Web Server
set -e
echo "Starting StormDB v2 Web Server Integration Test..."
# Build the application
echo "Building StormDB..."
cd /Users/charly.batista/proj/pgstorm/stormdb/v2
go build -o ./build/stormdb ./cmd/stormdb
# Start the server in background
echo "Starting server..."
./build/stormdb &
SERVER_PID=$!
# Give server time to start
sleep 2
# Test health endpoint
echo "Testing health endpoint..."
HEALTH_RESPONSE=$(curl -s http://localhost:8080/health)
echo "Health response: $HEALTH_RESPONSE"
# Test status endpoint
echo "Testing status endpoint..."
STATUS_RESPONSE=$(curl -s http://localhost:8080/status)
echo "Status response: $STATUS_RESPONSE"
# Test plugins endpoint
echo "Testing plugins endpoint..."
PLUGINS_RESPONSE=$(curl -s http://localhost:8080/plugins)
echo "Plugins response: $PLUGINS_RESPONSE"
# Test scheduler status endpoint
echo "Testing scheduler status endpoint..."
SCHEDULER_RESPONSE=$(curl -s http://localhost:8080/scheduler/status)
echo "Scheduler response: $SCHEDULER_RESPONSE"
# Test invalid endpoint (should return 404)
echo "Testing invalid endpoint..."
INVALID_RESPONSE=$(curl -s -w "%{http_code}" http://localhost:8080/invalid)
echo "Invalid endpoint response code: $INVALID_RESPONSE"
# Cleanup
echo "Stopping server..."
kill $SERVER_PID
wait $SERVER_PID 2>/dev/null || true
echo "Integration test completed successfully!"