-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathwjtc-processor.js
More file actions
114 lines (88 loc) · 3.23 KB
/
wjtc-processor.js
File metadata and controls
114 lines (88 loc) · 3.23 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
#!/usr/bin/env node
/**
* WJTC Report Processor (Simple Version)
* Processes test reports and updates dashboard
*/
const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');
class WJTCProcessor {
constructor() {
this.reportsDir = './wjtc-reports';
this.dashboardFile = './WJTC-DASHBOARD.md';
if (!fs.existsSync(this.reportsDir)) {
fs.mkdirSync(this.reportsDir, { recursive: true });
}
}
processReport(reportPath) {
console.log('🏎️ WJTC Report Processor v1.0.0');
console.log('━'.repeat(50));
try {
// Load report
const reportContent = fs.readFileSync(reportPath, 'utf8');
const report = yaml.load(reportContent);
// Display summary
console.log(`Platform: ${report.report_metadata.platform}`);
console.log(`Test Date: ${report.report_metadata.test_date}`);
console.log(`Commands: ${report.test_scope.commands_tested}/${report.test_scope.total_commands}`);
console.log(`Success Rate: ${report.test_scope.success_count}/${report.test_scope.commands_tested}`);
console.log(`Coverage: ${report.test_scope.coverage_percentage}%`);
if (report.display_quality) {
console.log(`Display Quality: ${report.display_quality.overall_score}/10`);
}
// Update dashboard
this.updateDashboard(report);
// Check certification
if (report.certification?.certified) {
console.log('━'.repeat(50));
console.log(`🏅 CERTIFIED ${report.certification.certification_level.toUpperCase()}!`);
}
console.log('━'.repeat(50));
console.log('✅ Report processed successfully!');
} catch (error) {
console.error('❌ Error:', error.message);
}
}
updateDashboard(report) {
const dashboard = `# 🏆 WJTC Dashboard - Live Testing Results
*Last Updated: ${new Date().toISOString()}*
## 📊 Latest Test: ${report.report_metadata.platform.toUpperCase()}
### Test Results
- **Date:** ${report.report_metadata.test_date}
- **Coverage:** ${report.test_scope.coverage_percentage}%
- **Success:** ${report.test_scope.success_count}/${report.test_scope.commands_tested}
- **Display Quality:** ${report.display_quality?.overall_score || 'N/A'}/10
### Command Categories
${Object.entries(report.category_results || {})
.map(([cat, data]) => `- **${cat}:** ${data.status} ✅`)
.join('\n')}
### Issues Found
${(report.issues || [])
.map(issue => `- [${issue.severity}] ${issue.command}: ${issue.description}`)
.join('\n') || 'None!'}
### Summary
${report.summary?.verdict || ''}
### Key Findings
${(report.summary?.key_findings || [])
.map(finding => `- ${finding}`)
.join('\n')}
${report.certification?.certified ?
`## 🏅 Certification Status\n\n**CERTIFIED ${report.certification.certification_level.toUpperCase()}** ✅`
: ''}
---
*Generated by WJTC Report Processor*
`;
fs.writeFileSync(this.dashboardFile, dashboard);
console.log('✅ Dashboard updated: WJTC-DASHBOARD.md');
}
}
// Run processor
if (require.main === module) {
const args = process.argv.slice(2);
if (args.length === 0) {
console.log('Usage: node wjtc-processor.js <report-file>');
process.exit(1);
}
const processor = new WJTCProcessor();
processor.processReport(args[0]);
}