-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
·59 lines (52 loc) · 1.46 KB
/
run_tests.sh
File metadata and controls
executable file
·59 lines (52 loc) · 1.46 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
52
53
54
55
56
57
58
59
#!/bin/bash
# SentientGate: Unit Test Runner
# This script runs tests for all microservices except ApiGateway.
# Colors for better output
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
echo "🚀 Starting SentientGate Unit Test Suite..."
# Function to run gradle tests
run_gradle_test() {
local dir=$1
echo -e "Testing ${GREEN}${dir}${NC} (Gradle)..."
if [ -d "$dir" ]; then
cd "$dir"
chmod +x gradlew
./gradlew test
if [ $? -eq 0 ]; then
echo -e "${GREEN}✅ $dir tests passed!${NC}"
else
echo -e "${RED}❌ $dir tests failed!${NC}"
fi
cd ..
else
echo -e "${RED}⚠️ Directory $dir not found!${NC}"
fi
echo "----------------------------------------"
}
# Function to run maven tests
run_maven_test() {
local dir=$1
echo -e "Testing ${GREEN}${dir}${NC} (Maven)..."
if [ -d "$dir" ]; then
cd "$dir"
chmod +x mvnw
./mvnw test
if [ $? -eq 0 ]; then
echo -e "${GREEN}✅ $dir tests passed!${NC}"
else
echo -e "${RED}❌ $dir tests failed!${NC}"
fi
cd ..
else
echo -e "${RED}⚠️ Directory $dir not found!${NC}"
fi
echo "----------------------------------------"
}
# Run tests for each service
run_gradle_test "MCPService"
run_gradle_test "LogingService"
run_gradle_test "DummyService"
run_maven_test "AIService"
echo "🎉 All tests completed!"