feat: API exercise test validates response structure on all 3 backends#2422
feat: API exercise test validates response structure on all 3 backends#2422
Conversation
…ackends Upgraded API exercise test from status-code-only to JSON body validation on ~40 key endpoints. Catches schema mismatches like #2419 where wrong column names returned empty/broken responses despite HTTP 200. - New check_json() helper validates response body structure via Python - New check_v1() helper for Bearer-token V1 API endpoints - New test-api-exercise-all-backends.sh wrapper runs against SQLite, PostgreSQL, and MySQL in sequence - Integrated into system-tests.sh as "API Exercise (3 DBs)" test Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: API Exercise Test Response ValidationThis PR significantly enhances API testing by moving from status-code-only validation to comprehensive JSON response structure validation across all three database backends. Here's my detailed review: ✅ StrengthsExcellent Test Coverage Enhancement
Robust Implementation
Good Integration
|
- Wait for MySQL DB container health check instead of fixed delay - Add --remove-orphans to cleanup - Kill leftover containers on port 8081 before starting - Add sleep between backend teardowns Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: API Exercise Test Response ValidationThis PR significantly enhances API testing by moving from status-code-only validation to comprehensive JSON response structure validation across all three database backends. Here's my detailed review: Todo List:
✅ StrengthsExcellent Test Coverage Enhancement
Robust Implementation
Good Integration
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: API Exercise Test Response ValidationReviewing the enhanced API testing implementation that adds JSON response validation across all three database backends. Todo List:
✅ StrengthsExcellent Test Coverage Enhancement
Robust Implementation
Good Integration
|
docker compose ps requires service names, not container names. The MySQL app service is 'meshmonitor-mysql', not 'meshmonitor-mysql-app'. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job PR Review: API Exercise Test Response ValidationReviewing the enhanced API testing implementation that adds JSON response validation across all three database backends. Todo List:
✅ StrengthsExcellent Test Coverage Enhancement
Robust Implementation
Good Integration
Code Quality Positives
|
System Test ResultsAll 11 system tests passed, including the new API Exercise test on all 3 backends:
API Exercise per-backend:
|
Summary
Upgrades the API exercise test from status-code-only checks to JSON response body validation, and integrates it into the system test suite running against all three database backends.
This would have caught #2419 (backup history wrong column names) — the endpoint returned HTTP 200 but with broken/empty response data.
Changes
api-exercise-test.sh — Enhanced ~40 endpoints with
check_json()validation:connected,nodeCount, etc.)messages,hasMore,successkeyspacketsarray,total,byDevice,byTypetotal,nodes,running,events,countkeyslogs,totalkeyssuccess,dataresponse envelope on all endpointstest-api-exercise-all-backends.sh — New wrapper script:
system-tests.sh — Integrated as "API Exercise (3 DBs)" test suite
Test Results
Files
tests/api-exercise-test.shcheck_json(),check_v1()helpers, ~40 endpoints upgradedtests/test-api-exercise-all-backends.shtests/system-tests.sh🤖 Generated with Claude Code