1+ #! /bin/bash
2+
3+ # Final comprehensive API coverage report for both V3 and V4 APIs
4+ # This script generates a complete summary of API test coverage
5+
6+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
7+ PROJECT_ROOT=" $( cd " ${SCRIPT_DIR} /.." && pwd) "
8+
9+ echo " ========================================"
10+ echo " EASYCLA API COVERAGE FINAL REPORT"
11+ echo " ========================================"
12+ echo " "
13+ echo " Project root: $PROJECT_ROOT "
14+ echo " Generated on: $( date) "
15+ echo " "
16+
17+ # Change to project root for proper execution
18+ cd " $PROJECT_ROOT "
19+
20+ echo " === V3 API Coverage Analysis ==="
21+ ./utils/v3/check_api_coverage_v3.sh
22+ v3_result=$?
23+ echo " "
24+
25+ echo " === V4 API Coverage Analysis ==="
26+ ./utils/v4/check_api_coverage_v4.sh
27+ v4_result=$?
28+ echo " "
29+
30+ echo " === Cypress Test Files Coverage ==="
31+ echo " V3 Cypress test files:"
32+ ls -1 tests/functional/cypress/e2e/v3/* .cy.ts | sed ' s|.*/||' | sort
33+ echo " "
34+ echo " V4 Cypress test files:"
35+ ls -1 tests/functional/cypress/e2e/v4/* .cy.ts | sed ' s|.*/||' | sort
36+ echo " "
37+
38+ echo " === Script Counts ==="
39+ v3_scripts=$( find utils/v3 -name " *.sh" -not -path " */shared/*" | wc -l)
40+ v4_scripts=$( find utils/v4 -name " *.sh" -not -path " */shared/*" | wc -l)
41+ echo " V3 API scripts: $v3_scripts "
42+ echo " V4 API scripts: $v4_scripts "
43+ echo " Total scripts: $(( v3 _scripts + v4 _scripts)) "
44+ echo " "
45+
46+ echo " === Directory Structure ==="
47+ echo " V3 API directories:"
48+ find utils/v3 -type d -not -path " */shared" | grep -v " ^utils/v3$" | sort
49+ echo " "
50+ echo " V4 API directories:"
51+ find utils/v4 -type d -not -path " */shared" | grep -v " ^utils/v4$" | sort
52+ echo " "
53+
54+ echo " === Testing Quick Syntax Check ==="
55+ v3_syntax_errors=$( find utils/v3 -name " *.sh" -not -path " */shared/*" -exec bash -n {} \; 2>&1 | wc -l)
56+ v4_syntax_errors=$( find utils/v4 -name " *.sh" -not -path " */shared/*" -exec bash -n {} \; 2>&1 | wc -l)
57+
58+ echo " V3 scripts syntax errors: $v3_syntax_errors "
59+ echo " V4 scripts syntax errors: $v4_syntax_errors "
60+ echo " "
61+
62+ echo " === API URL Configuration ==="
63+ echo " V3 shared config: utils/v3/shared/handle_api_url.sh"
64+ echo " V4 shared config: utils/v4/shared/handle_api_url.sh"
65+ echo " "
66+
67+ echo " === Test Script Verification ==="
68+ echo " Testing a few key scripts..."
69+
70+ echo -n " V3 health endpoint: "
71+ if ./utils/v3/health/get_health.sh 2>&1 | grep -q ' "Branch"' ; then
72+ echo " ✓ Working"
73+ else
74+ echo " ✗ Failed"
75+ fi
76+
77+ echo -n " V4 health endpoint: "
78+ if ./utils/v4/health/get_health.sh 2>&1 | grep -q ' "Branch"' ; then
79+ echo " ✓ Working"
80+ else
81+ echo " ✗ Failed"
82+ fi
83+
84+ echo -n " V3 version endpoint: "
85+ if ./utils/v3/version/get_version.sh 2>&1 | grep -q ' "branch"' ; then
86+ echo " ✓ Working"
87+ else
88+ echo " ✗ Failed"
89+ fi
90+
91+ echo -n " V4 version endpoint: "
92+ if ./utils/v4/version/get_version.sh 2>&1 | grep -q ' "branch"' ; then
93+ echo " ✓ Working"
94+ else
95+ echo " ✗ Failed"
96+ fi
97+
98+ echo " "
99+
100+ echo " === Summary ==="
101+ if [ $v3_result -eq 0 ] && [ $v4_result -eq 0 ] && [ $v3_syntax_errors -eq 0 ] && [ $v4_syntax_errors -eq 0 ]; then
102+ echo " 🎉 ALL TESTS PASSED! 🎉"
103+ echo " "
104+ echo " ✓ V3 APIs: 100% coverage"
105+ echo " ✓ V4 APIs: 100% coverage"
106+ echo " ✓ All scripts have valid syntax"
107+ echo " ✓ API URL handling implemented for both local and remote modes"
108+ echo " ✓ Comprehensive test coverage with Cypress tests"
109+ echo " "
110+ echo " The project now has complete API test coverage with shell scripts"
111+ echo " for all V3 and V4 endpoints, organized by swagger tags."
112+ echo " "
113+ echo " Usage examples:"
114+ echo " Local mode: ./utils/v3/health/get_health.sh"
115+ echo " Remote mode: REMOTE=1 ./utils/v3/health/get_health.sh"
116+ echo " With auth: TOKEN=\"\$ (cat ./token.secret)\" XACL=\"\$ (cat ./x-acl.secret)\" ./utils/v3/users/get_user.sh user_id"
117+ exit 0
118+ else
119+ echo " ❌ SOME ISSUES FOUND"
120+ echo " "
121+ echo " V3 coverage: $( [ $v3_result -eq 0 ] && echo ' ✓ PASS' || echo ' ✗ FAIL' ) "
122+ echo " V4 coverage: $( [ $v4_result -eq 0 ] && echo ' ✓ PASS' || echo ' ✗ FAIL' ) "
123+ echo " V3 syntax: $( [ $v3_syntax_errors -eq 0 ] && echo ' ✓ PASS' || echo " ✗ FAIL ($v3_syntax_errors errors)" ) "
124+ echo " V4 syntax: $( [ $v4_syntax_errors -eq 0 ] && echo ' ✓ PASS' || echo " ✗ FAIL ($v4_syntax_errors errors)" ) "
125+ exit 1
126+ fi
0 commit comments