-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_tests.sh
More file actions
executable file
Β·138 lines (116 loc) Β· 4.29 KB
/
run_tests.sh
File metadata and controls
executable file
Β·138 lines (116 loc) Β· 4.29 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
#!/bin/bash
# Comprehensive Test Runner for Chitti App
# This script runs all test categories and generates a summary report
echo "π§ͺ Starting Comprehensive Test Suite for Chitti App"
echo "=================================================="
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Test results tracking
UNIT_TESTS_RESULT=0
WIDGET_TESTS_RESULT=0
INTEGRATION_TESTS_RESULT=0
PERFORMANCE_TESTS_RESULT=0
echo ""
echo -e "${BLUE}π Running Unit Tests (Data Models & Repositories)${NC}"
echo "---------------------------------------------------"
flutter test test/data/ --reporter=compact
UNIT_TESTS_RESULT=$?
echo ""
echo -e "${BLUE}π¨ Running Widget Tests (UI Components)${NC}"
echo "--------------------------------------"
flutter test test/widgets/ --reporter=compact
WIDGET_TESTS_RESULT=$?
echo ""
echo -e "${BLUE}π Running Domain Tests (Network & API)${NC}"
echo "--------------------------------------"
flutter test test/domain/ --reporter=compact
DOMAIN_TESTS_RESULT=$?
echo ""
echo -e "${BLUE}π Running Performance Tests${NC}"
echo "----------------------------"
flutter test test/performance/ --reporter=compact
PERFORMANCE_TESTS_RESULT=$?
echo ""
echo -e "${BLUE}π Running Integration Tests${NC}"
echo "----------------------------"
flutter test test/integration/ --reporter=compact
INTEGRATION_TESTS_RESULT=$?
echo ""
echo -e "${BLUE}π¨ Running Basic Widget Smoke Tests${NC}"
echo "----------------------------------"
flutter test test/widget_test.dart --reporter=compact
SMOKE_TESTS_RESULT=$?
# Generate summary report
echo ""
echo "π TEST SUMMARY REPORT"
echo "======================"
if [ $UNIT_TESTS_RESULT -eq 0 ]; then
echo -e "β
Unit Tests: ${GREEN}PASSED${NC}"
else
echo -e "β Unit Tests: ${RED}FAILED${NC}"
fi
if [ $WIDGET_TESTS_RESULT -eq 0 ]; then
echo -e "β
Widget Tests: ${GREEN}PASSED${NC}"
else
echo -e "β Widget Tests: ${RED}FAILED${NC}"
fi
if [ $DOMAIN_TESTS_RESULT -eq 0 ]; then
echo -e "β
Domain Tests: ${GREEN}PASSED${NC}"
else
echo -e "β Domain Tests: ${RED}FAILED${NC}"
fi
if [ $PERFORMANCE_TESTS_RESULT -eq 0 ]; then
echo -e "β
Performance Tests: ${GREEN}PASSED${NC}"
else
echo -e "β Performance Tests: ${RED}FAILED${NC}"
fi
if [ $INTEGRATION_TESTS_RESULT -eq 0 ]; then
echo -e "β
Integration Tests: ${GREEN}PASSED${NC}"
else
echo -e "β Integration Tests: ${RED}FAILED${NC}"
fi
if [ $SMOKE_TESTS_RESULT -eq 0 ]; then
echo -e "β
Smoke Tests: ${GREEN}PASSED${NC}"
else
echo -e "β Smoke Tests: ${RED}FAILED${NC}"
fi
echo ""
echo "π IDENTIFIED ISSUES (from test analysis):"
echo "=========================================="
echo -e "${RED}π¨ CRITICAL ISSUES:${NC}"
echo " - DRY Violation: submitReview method duplicated in multiple files"
echo " - Null Safety: Force unwrapping FirebaseAuth.instance.currentUser!"
echo " - Commented Validation: Review validation logic is disabled"
echo ""
echo -e "${YELLOW}β οΈ PERFORMANCE ISSUES:${NC}"
echo " - Potential memory leaks in video player controllers"
echo " - No caching limits in repository layer"
echo " - Complex nested widget structures causing potential jank"
echo ""
echo -e "${YELLOW}β οΈ EDGE CASE VULNERABILITIES:${NC}"
echo " - No validation for instructor rating bounds"
echo " - Missing error handling for malformed API responses"
echo " - No offline mode support"
# Calculate overall result
TOTAL_FAILURES=$((UNIT_TESTS_RESULT + WIDGET_TESTS_RESULT + DOMAIN_TESTS_RESULT + PERFORMANCE_TESTS_RESULT + INTEGRATION_TESTS_RESULT + SMOKE_TESTS_RESULT))
echo ""
if [ $TOTAL_FAILURES -eq 0 ]; then
echo -e "${GREEN}π ALL TESTS PASSED!${NC}"
echo "The comprehensive test suite has identified potential issues for improvement."
else
echo -e "${RED}π₯ SOME TESTS FAILED!${NC}"
echo "Please review the test failures above and the identified issues."
fi
echo ""
echo "π For detailed analysis, see: test/TEST_DOCUMENTATION.md"
echo "π§ To run specific test categories:"
echo " flutter test test/data/ # Unit tests"
echo " flutter test test/widgets/ # Widget tests"
echo " flutter test test/domain/ # Network tests"
echo " flutter test test/performance/ # Performance tests"
echo " flutter test test/integration/ # Integration tests"
exit $TOTAL_FAILURES