-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-runner.sh
More file actions
executable file
·75 lines (60 loc) · 2.04 KB
/
test-runner.sh
File metadata and controls
executable file
·75 lines (60 loc) · 2.04 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# Test runner script for viewyard
# Runs all test suites with proper reporting
set -e
echo "🧪 Running Viewyard Test Suite"
echo "=============================="
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Function to run a test suite
run_test_suite() {
local suite_name="$1"
local test_command="$2"
echo -e "\n${YELLOW}Running $suite_name...${NC}"
if eval "$test_command"; then
echo -e "${GREEN}✅ $suite_name passed${NC}"
return 0
else
echo -e "${RED}❌ $suite_name failed${NC}"
return 1
fi
}
# Track overall success
overall_success=0
# Run property-based tests
run_test_suite "Property-based tests" "cargo test --test property_tests" || overall_success=1
# Run unit tests
run_test_suite "Unit tests" "cargo test --test unit_tests" || overall_success=1
# Run integration tests (may have some expected failures)
run_test_suite "Integration tests" "cargo test --test integration_tests" || echo -e "${YELLOW}⚠️ Some integration tests failed (expected)${NC}"
# Run persona-based tests
run_test_suite "Persona-based tests" "cargo test --test persona_tests" || overall_success=1
# Run simple integration tests
run_test_suite "Simple integration tests" "cargo test --test simple_integration" || overall_success=1
# Run quality checks
echo -e "\n${YELLOW}Running quality checks...${NC}"
if cargo fmt --check; then
echo -e "${GREEN}✅ Code formatting is correct${NC}"
else
echo -e "${RED}❌ Code formatting issues found${NC}"
overall_success=1
fi
if cargo clippy -- -D warnings; then
echo -e "${GREEN}✅ No clippy warnings${NC}"
else
echo -e "${RED}❌ Clippy warnings found${NC}"
overall_success=1
fi
# Summary
echo -e "\n=============================="
if [ $overall_success -eq 0 ]; then
echo -e "${GREEN}🎉 All critical tests passed!${NC}"
echo "Ready for CI/CD pipeline"
else
echo -e "${RED}💥 Some tests failed${NC}"
echo "Please fix issues before committing"
fi
exit $overall_success