RemiFabre commited on
Commit
61f57e3
·
1 Parent(s): 5e2b437

Redesign test coverage: matrix only, show all platforms

Browse files

- Remove test catalog detail (too verbose for the landing page)
- Show full 9-row matrix: Linux/macOS/Windows x None/Wireless/Lite
- Rename WebKit column to Safari with footnote explaining the engine
- Use distinct symbols: checkmark (passing), cross (failing), dash (not yet tested)
- Add legend and contribution CTA linking to TESTING.md

Files changed (1) hide show
  1. index.html +93 -179
index.html CHANGED
@@ -386,57 +386,10 @@
386
  margin-bottom: 1.75rem;
387
  }
388
 
389
- .tc-badges {
390
- display: flex;
391
- flex-wrap: wrap;
392
- gap: 0.5rem;
393
- margin-bottom: 1.5rem;
394
- }
395
-
396
- .tc-badge {
397
- display: inline-flex;
398
- align-items: center;
399
- padding: 0.25rem 0.75rem;
400
- font-size: 0.75rem;
401
- font-weight: 600;
402
- border-radius: 9999px;
403
- letter-spacing: 0.02em;
404
- }
405
-
406
- .tc-badge-pass {
407
- background-color: hsla(160, 84%, 39%, 0.15);
408
- color: hsl(160, 84%, 55%);
409
- border: 1px solid hsla(160, 84%, 39%, 0.3);
410
- }
411
-
412
- .tc-badge-fail {
413
- background-color: hsla(0, 84%, 60%, 0.15);
414
- color: hsl(0, 84%, 70%);
415
- border: 1px solid hsla(0, 84%, 60%, 0.3);
416
- }
417
-
418
- .tc-badge-neutral {
419
- background-color: hsla(220, 13%, 50%, 0.12);
420
- color: var(--muted-foreground);
421
- border: 1px solid var(--border);
422
- }
423
-
424
- .tc-columns {
425
- display: grid;
426
- grid-template-columns: 1fr;
427
- gap: 2rem;
428
- }
429
-
430
- @media (min-width: 768px) {
431
- .tc-columns {
432
- grid-template-columns: auto 1fr;
433
- }
434
- }
435
-
436
- /* Matrix table */
437
  .tc-table-wrap {
438
  overflow-x: auto;
439
  -webkit-overflow-scrolling: touch;
 
440
  }
441
 
442
  .tc-table {
@@ -490,8 +443,9 @@
490
  font-weight: 600;
491
  }
492
 
493
- .tc-empty {
494
- color: hsla(220, 13%, 50%, 0.35);
 
495
  }
496
 
497
  .tc-date {
@@ -501,74 +455,46 @@
501
  margin-top: 1px;
502
  }
503
 
504
- /* Test catalog */
505
- .tc-catalog {
506
  display: flex;
507
- flex-direction: column;
508
- gap: 1.5rem;
509
- }
510
-
511
- .tc-tier-title {
512
  font-size: 0.7rem;
513
- font-weight: 700;
514
- text-transform: uppercase;
515
- letter-spacing: 0.1em;
516
  color: var(--muted-foreground);
517
- padding-bottom: 0.4rem;
518
- border-bottom: 1px solid var(--border);
519
- margin-bottom: 0.25rem;
520
  }
521
 
522
- .tc-tier-total {
523
- display: inline-block;
524
- background-color: hsla(220, 13%, 50%, 0.12);
525
- padding: 0.05rem 0.4rem;
526
- border-radius: 4px;
527
- font-size: 0.65rem;
528
- margin-left: 0.25rem;
529
- vertical-align: middle;
530
  }
531
 
532
- .tc-items {
533
- display: flex;
534
- flex-direction: column;
535
- gap: 0.15rem;
 
536
  }
537
 
538
- .tc-item {
539
- display: flex;
540
- align-items: baseline;
541
- gap: 0.4rem;
542
- font-size: 0.75rem;
543
- padding: 0.15rem 0;
544
  }
545
 
546
- .tc-class {
547
- font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
548
- font-size: 0.7rem;
549
- font-weight: 600;
550
- flex-shrink: 0;
551
  }
552
 
553
- .tc-count {
554
  font-size: 0.65rem;
555
- font-weight: 700;
556
- color: var(--muted-foreground);
557
- background-color: hsla(220, 13%, 50%, 0.12);
558
- padding: 0 0.3rem;
559
- border-radius: 3px;
560
- flex-shrink: 0;
561
- }
562
-
563
- .tc-desc {
564
- color: var(--muted-foreground);
565
- font-size: 0.7rem;
566
  }
567
 
568
  .tc-updated {
569
  font-size: 0.7rem;
570
  color: hsla(215, 16%, 60%, 0.6);
571
- margin-top: 1rem;
572
  }
573
  </style>
574
  </head>
@@ -652,119 +578,107 @@
652
  <section class="test-coverage" id="test-coverage-section" style="display:none">
653
  <div class="container">
654
  <h2>Test Coverage</h2>
655
- <p class="section-subtitle">Automated tests run across platforms and browsers before every release.</p>
656
- <div class="tc-badges" id="tc-badges"></div>
657
- <div class="tc-columns">
658
- <div class="tc-table-wrap" id="tc-matrix"></div>
659
- <div class="tc-catalog" id="tc-catalog"></div>
660
- </div>
 
 
661
  <p class="tc-updated" id="tc-updated"></p>
662
  </div>
663
  </section>
664
 
665
  <script>
666
  (function() {
667
- var jsonPath = 'marionette/static/test_coverage.json';
668
- fetch(jsonPath, { cache: 'no-store' })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
669
  .then(function(r) { return r.ok ? r.json() : Promise.reject(); })
670
  .then(render)
671
  .catch(function() {});
672
 
673
  function render(data) {
674
  var matrix = data.matrix || [];
675
- var catalog = data.test_catalog || [];
676
  if (!matrix.length) return;
677
 
678
  document.getElementById('test-coverage-section').style.display = '';
679
 
680
- // Badges
681
- var tierTotals = {};
682
- catalog.forEach(function(c) { tierTotals[c.tier] = (tierTotals[c.tier] || 0) + c.count; });
683
- var totalTests = Object.keys(tierTotals).reduce(function(s, k) { return s + tierTotals[k]; }, 0);
684
- var allPass = matrix.every(function(m) { return m.status === 'pass'; });
685
- var platforms = [];
686
- var seenP = {};
687
- matrix.forEach(function(m) {
688
- var k = m.os + '/' + m.robot;
689
- if (!seenP[k]) { seenP[k] = true; platforms.push(k); }
690
- });
691
-
692
- var bh = '';
693
- bh += '<span class="tc-badge ' + (allPass ? 'tc-badge-pass' : 'tc-badge-fail') + '">' + (allPass ? 'All passing' : 'Some failures') + '</span>';
694
- bh += '<span class="tc-badge tc-badge-neutral">' + totalTests + ' tests</span>';
695
- bh += '<span class="tc-badge tc-badge-neutral">' + platforms.length + ' platform' + (platforms.length !== 1 ? 's' : '') + '</span>';
696
- document.getElementById('tc-badges').innerHTML = bh;
697
-
698
- // Matrix table
699
- var suiteKeys = [];
700
- var seenS = {};
701
- matrix.forEach(function(m) {
702
- var k = m.suite + (m.browser ? '-' + m.browser : '');
703
- if (!seenS[k]) { seenS[k] = true; suiteKeys.push({ suite: m.suite, browser: m.browser, key: k }); }
704
- });
705
-
706
- function suiteLabel(s) {
707
- if (s.suite === 'unit') return 'Unit';
708
- if (s.suite === 'hardware') return 'HW';
709
- if (s.browser) return s.browser.charAt(0).toUpperCase() + s.browser.slice(1);
710
- return s.suite;
711
- }
712
-
713
  var lookup = {};
714
  matrix.forEach(function(m) {
715
  lookup[m.os + '|' + m.robot + '|' + m.suite + '|' + (m.browser || '')] = m;
716
  });
717
 
718
- var combos = [];
719
- var seenC = {};
720
- matrix.forEach(function(m) {
721
- var ck = m.os + '|' + m.robot;
722
- if (!seenC[ck]) { seenC[ck] = true; combos.push({ os: m.os, robot: m.robot }); }
 
 
723
  });
724
 
725
- var th = '<table class="tc-table"><thead><tr><th></th>';
726
- suiteKeys.forEach(function(s) { th += '<th>' + suiteLabel(s) + '</th>'; });
727
- th += '</tr></thead><tbody>';
 
 
728
 
729
- combos.forEach(function(c) {
730
- var rl = c.robot === 'None' ? 'no robot' : c.robot;
731
- th += '<tr><td class="tc-platform">' + c.os + ' <span class="tc-robot-label">' + rl + '</span></td>';
732
- suiteKeys.forEach(function(s) {
733
- var m = lookup[c.os + '|' + c.robot + '|' + s.suite + '|' + (s.browser || '')];
 
 
 
 
734
  if (m) {
735
  var ok = m.status === 'pass';
736
- th += '<td><span class="' + (ok ? 'tc-ok' : 'tc-fail') + '">' + (ok ? '\u2713' : '\u2717') + ' ' + m.passed + '/' + m.total + '</span><span class="tc-date">' + m.date + '</span></td>';
 
 
737
  } else {
738
- th += '<td class="tc-empty">\u2014</td>';
739
  }
740
  });
741
- th += '</tr>';
742
- });
743
- th += '</tbody></table>';
744
- document.getElementById('tc-matrix').innerHTML = th;
745
-
746
- // Catalog
747
- var tiers = {};
748
- catalog.forEach(function(c) { if (!tiers[c.tier]) tiers[c.tier] = []; tiers[c.tier].push(c); });
749
- var tierOrder = ['unit', 'e2e', 'hardware'];
750
- var tierLabels = { unit: 'Unit', e2e: 'E2E', hardware: 'Hardware' };
751
-
752
- var ch = '';
753
- tierOrder.forEach(function(tier) {
754
- var entries = tiers[tier];
755
- if (!entries) return;
756
- var total = entries.reduce(function(s, e) { return s + e.count; }, 0);
757
- ch += '<div><div class="tc-tier-title">' + (tierLabels[tier] || tier) + ' <span class="tc-tier-total">' + total + '</span></div><div class="tc-items">';
758
- entries.forEach(function(e) {
759
- ch += '<div class="tc-item"><span class="tc-class">' + e['class'] + '</span><span class="tc-count">' + e.count + '</span><span class="tc-desc">' + e.description + '</span></div>';
760
- });
761
- ch += '</div></div>';
762
  });
763
- document.getElementById('tc-catalog').innerHTML = ch;
 
 
 
 
 
 
 
 
764
 
765
  if (data.generated_at) {
766
  var d = new Date(data.generated_at);
767
- document.getElementById('tc-updated').textContent = 'Updated ' + d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' });
 
768
  }
769
  }
770
  })();
 
386
  margin-bottom: 1.75rem;
387
  }
388
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
389
  .tc-table-wrap {
390
  overflow-x: auto;
391
  -webkit-overflow-scrolling: touch;
392
+ margin-bottom: 1rem;
393
  }
394
 
395
  .tc-table {
 
443
  font-weight: 600;
444
  }
445
 
446
+ .tc-untested {
447
+ color: hsla(220, 13%, 50%, 0.4);
448
+ font-size: 0.7rem;
449
  }
450
 
451
  .tc-date {
 
455
  margin-top: 1px;
456
  }
457
 
458
+ .tc-legend {
 
459
  display: flex;
460
+ gap: 1.25rem;
 
 
 
 
461
  font-size: 0.7rem;
 
 
 
462
  color: var(--muted-foreground);
463
+ margin-bottom: 1rem;
 
 
464
  }
465
 
466
+ .tc-legend span {
467
+ display: inline-flex;
468
+ align-items: center;
469
+ gap: 0.3rem;
 
 
 
 
470
  }
471
 
472
+ .tc-cta {
473
+ font-size: 0.8rem;
474
+ color: var(--muted-foreground);
475
+ line-height: 1.5;
476
+ max-width: 44rem;
477
  }
478
 
479
+ .tc-cta a {
480
+ color: var(--primary);
481
+ text-decoration: none;
 
 
 
482
  }
483
 
484
+ .tc-cta a:hover {
485
+ text-decoration: underline;
 
 
 
486
  }
487
 
488
+ .tc-footnote {
489
  font-size: 0.65rem;
490
+ color: hsla(215, 16%, 60%, 0.5);
491
+ margin-top: 0.75rem;
 
 
 
 
 
 
 
 
 
492
  }
493
 
494
  .tc-updated {
495
  font-size: 0.7rem;
496
  color: hsla(215, 16%, 60%, 0.6);
497
+ margin-top: 0.5rem;
498
  }
499
  </style>
500
  </head>
 
578
  <section class="test-coverage" id="test-coverage-section" style="display:none">
579
  <div class="container">
580
  <h2>Test Coverage</h2>
581
+ <p class="section-subtitle" id="tc-subtitle"></p>
582
+ <div class="tc-table-wrap" id="tc-matrix"></div>
583
+ <div class="tc-legend" id="tc-legend"></div>
584
+ <p class="tc-cta">
585
+ Help us expand coverage! Run the test suite on your setup and submit a PR with the results.
586
+ See <a href="https://huggingface.co/spaces/RemiFabre/marionette/blob/main/marionette/TESTING.md" target="_blank" rel="noopener noreferrer">TESTING.md</a> for instructions.
587
+ </p>
588
+ <p class="tc-footnote">Safari tested via Playwright's WebKit engine. Chromium covers Chrome, Edge, Brave, and similar browsers.</p>
589
  <p class="tc-updated" id="tc-updated"></p>
590
  </div>
591
  </section>
592
 
593
  <script>
594
  (function() {
595
+ var ALL_PLATFORMS = [
596
+ { os: 'Linux', robot: 'None' },
597
+ { os: 'Linux', robot: 'Wireless' },
598
+ { os: 'Linux', robot: 'Lite' },
599
+ { os: 'macOS', robot: 'None' },
600
+ { os: 'macOS', robot: 'Wireless' },
601
+ { os: 'macOS', robot: 'Lite' },
602
+ { os: 'Windows', robot: 'None' },
603
+ { os: 'Windows', robot: 'Wireless' },
604
+ { os: 'Windows', robot: 'Lite' }
605
+ ];
606
+
607
+ var COLUMNS = [
608
+ { suite: 'unit', browser: null, label: 'Unit' },
609
+ { suite: 'e2e', browser: 'chromium', label: 'Chromium' },
610
+ { suite: 'e2e', browser: 'firefox', label: 'Firefox' },
611
+ { suite: 'e2e', browser: 'webkit', label: 'Safari' }
612
+ ];
613
+
614
+ var ROBOT_LABELS = { 'None': 'no robot', 'Wireless': 'Wireless', 'Lite': 'Lite' };
615
+
616
+ fetch('marionette/static/test_coverage.json', { cache: 'no-store' })
617
  .then(function(r) { return r.ok ? r.json() : Promise.reject(); })
618
  .then(render)
619
  .catch(function() {});
620
 
621
  function render(data) {
622
  var matrix = data.matrix || [];
 
623
  if (!matrix.length) return;
624
 
625
  document.getElementById('test-coverage-section').style.display = '';
626
 
627
+ // Build lookup from actual results
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
628
  var lookup = {};
629
  matrix.forEach(function(m) {
630
  lookup[m.os + '|' + m.robot + '|' + m.suite + '|' + (m.browser || '')] = m;
631
  });
632
 
633
+ // Count tested vs total platforms
634
+ var testedCount = 0;
635
+ ALL_PLATFORMS.forEach(function(p) {
636
+ var hasAny = COLUMNS.some(function(c) {
637
+ return !!lookup[p.os + '|' + p.robot + '|' + c.suite + '|' + (c.browser || '')];
638
+ });
639
+ if (hasAny) testedCount++;
640
  });
641
 
642
+ var catalog = data.test_catalog || [];
643
+ var totalTests = catalog.reduce(function(s, c) { return s + c.count; }, 0);
644
+
645
+ document.getElementById('tc-subtitle').textContent =
646
+ totalTests + ' automated tests \u2014 ' + testedCount + ' of ' + ALL_PLATFORMS.length + ' platform combinations verified so far.';
647
 
648
+ // Build table
649
+ var h = '<table class="tc-table"><thead><tr><th>Platform</th>';
650
+ COLUMNS.forEach(function(c) { h += '<th>' + c.label + '</th>'; });
651
+ h += '</tr></thead><tbody>';
652
+
653
+ ALL_PLATFORMS.forEach(function(p) {
654
+ h += '<tr><td class="tc-platform">' + p.os + ' <span class="tc-robot-label">' + ROBOT_LABELS[p.robot] + '</span></td>';
655
+ COLUMNS.forEach(function(c) {
656
+ var m = lookup[p.os + '|' + p.robot + '|' + c.suite + '|' + (c.browser || '')];
657
  if (m) {
658
  var ok = m.status === 'pass';
659
+ h += '<td><span class="' + (ok ? 'tc-ok' : 'tc-fail') + '">';
660
+ h += (ok ? '\u2713' : '\u2717') + ' ' + m.passed + '/' + m.total;
661
+ h += '</span><span class="tc-date">' + m.date + '</span></td>';
662
  } else {
663
+ h += '<td class="tc-untested">\u2014</td>';
664
  }
665
  });
666
+ h += '</tr>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
667
  });
668
+
669
+ h += '</tbody></table>';
670
+ document.getElementById('tc-matrix').innerHTML = h;
671
+
672
+ // Legend
673
+ document.getElementById('tc-legend').innerHTML =
674
+ '<span><span class="tc-ok">\u2713</span> Passing</span>' +
675
+ '<span><span class="tc-fail">\u2717</span> Failing</span>' +
676
+ '<span><span class="tc-untested">\u2014</span> Not yet tested</span>';
677
 
678
  if (data.generated_at) {
679
  var d = new Date(data.generated_at);
680
+ document.getElementById('tc-updated').textContent =
681
+ 'Last run: ' + d.toLocaleDateString(undefined, { month: 'short', day: 'numeric', year: 'numeric' });
682
  }
683
  }
684
  })();