Files
orion/app/modules/dev_tools/static/admin/js/testing-hub.js
Samir Boulahtit 35d1559162
Some checks failed
CI / ruff (push) Successful in 10s
CI / pytest (push) Failing after 47m30s
CI / validate (push) Successful in 24s
CI / dependency-scanning (push) Successful in 29s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped
feat(monitoring): add Redis exporter + Sentry docs to deployment guide
- Add redis-exporter container to docker-compose (oliver006/redis_exporter, 32MB)
- Add Redis scrape target to Prometheus config
- Add 4 Redis alert rules: RedisDown, HighMemory, HighConnections, RejectedConnections
- Document Step 19b (Sentry Error Tracking) in Hetzner deployment guide
- Document Step 19c (Redis Monitoring) in Hetzner deployment guide
- Update resource budget and port reference tables

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 23:30:18 +01:00

126 lines
4.0 KiB
JavaScript

// app/modules/dev_tools/static/admin/js/testing-hub.js
// ✅ Use centralized logger - ONE LINE!
// Create custom logger for testing hub
const testingLog = window.LogConfig.createLogger('TESTING-HUB');
/**
* Testing Hub Alpine.js Component
* Central hub for all test suites and QA tools
*/
function adminTestingHub() {
return {
// ✅ CRITICAL: Inherit base layout functionality
...data(),
// ✅ CRITICAL: Set page identifier
currentPage: 'testing',
// Test suites data
testSuites: [
{
id: 'auth-flow',
name: 'Authentication Flow',
description: 'Test login, logout, token expiration, redirects, and protected route access.',
url: '/admin/test/auth-flow',
icon: 'lock-closed',
color: 'blue',
testCount: 6,
features: [
'Login with valid/invalid credentials',
'Token expiration handling',
'Protected route access & redirects',
'localStorage state monitoring'
]
},
{
id: 'stores-users',
name: 'Data Migration & CRUD',
description: 'Test store and user creation, listing, editing, deletion, and data migration scenarios.',
url: '/admin/test/stores-users-migration',
icon: 'database',
color: 'orange',
testCount: 10,
features: [
'Store CRUD operations',
'User management & roles',
'Data migration validation',
'Form validation & error handling'
]
}
],
// Stats
stats: {
totalSuites: 2,
totalTests: 16,
coverage: 'Auth, CRUD',
avgDuration: '< 5 min'
},
// Loading state
loading: false,
// ✅ CRITICAL: Proper initialization with guard
async init() {
testingLog.info('=== TESTING HUB INITIALIZING ===');
// Prevent multiple initializations
if (window._testingHubInitialized) {
testingLog.warn('Testing hub already initialized, skipping...');
return;
}
window._testingHubInitialized = true;
// Calculate stats
this.calculateStats();
testingLog.info('=== TESTING HUB INITIALIZATION COMPLETE ===');
},
/**
* Calculate test statistics
*/
calculateStats() {
this.stats.totalSuites = this.testSuites.length;
this.stats.totalTests = this.testSuites.reduce((sum, suite) => sum + suite.testCount, 0);
testingLog.debug('Stats calculated:', this.stats);
},
/**
* Get color classes for test suite cards
*/
getColorClasses(color) {
const colorMap = {
blue: {
gradient: 'from-blue-500 to-blue-600',
button: 'bg-blue-600 hover:bg-blue-700'
},
orange: {
gradient: 'from-orange-500 to-orange-600',
button: 'bg-orange-600 hover:bg-orange-700'
},
green: {
gradient: 'from-green-500 to-green-600',
button: 'bg-green-600 hover:bg-green-700'
},
purple: {
gradient: 'from-purple-500 to-purple-600',
button: 'bg-purple-600 hover:bg-purple-700'
}
};
return colorMap[color] || colorMap.blue;
},
/**
* Navigate to test suite
*/
goToTest(url) {
testingLog.info('Navigating to test suite:', url);
window.location.href = url;
}
};
}
testingLog.info('Testing hub module loaded');