gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit1f2df72a1f2df72amission RV39mre1f2df72a/tests/realdata-018.mjs

2.1 KB

  1. // tests/realdata-018.mjs — tracker.worldapi.org#18, NOT the gate: titles the daily delta run refreshed, on a COPY of live storage/
  2. // (STATUS.md "ticket #18"). Per title in REAL_TITLES and width (390, 1280): full page load, the header as shown (title, tagline,
  3. // summary start), a screenshot to $REAL_OUT.
  4. // Env: REAL_PORT (8750), REAL_CHROME (8757-8759), REAL_OUT (/tmp/w067/real), REAL_TITLES ('Star-Wars-Andor,Breaking-Bad').
  5. import { writeFileSync, mkdirSync } from 'node:fs';
  6. import { launchBrowser } from './cdp.mjs';
  7. process.env.HL_CHROME ||= '/opt/google/chrome/chrome';
  8. const BASE = `http://127.0.0.1:${process.env.REAL_PORT || 8750}`, OUT = process.env.REAL_OUT || '/tmp/w067/real';
  9. mkdirSync(OUT, { recursive: true });
  10. const [CH_FROM, CH_TO] = (process.env.REAL_CHROME || '8757-8759').split('-').map(Number);
  11. const TITLES = (process.env.REAL_TITLES || 'Star-Wars-Andor,Breaking-Bad').split(',').filter(Boolean);
  12. const browser = await launchBrowser({ debugPortRange: [CH_FROM, CH_TO || CH_FROM] });
  13. const page = await browser.newPage();
  14. const ev = (e) => page.evaluate(e);
  15. const hydrated = () => page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 30000, label: 'hydrated' });
  16. for (const slug of TITLES) {
  17. for (const w of [390, 1280]) {
  18. const mobile = w < 600;
  19. await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: mobile ? 844 : 900, deviceScaleFactor: mobile ? 2 : 1, mobile });
  20. const t0 = Date.now();
  21. await page.goto(BASE + '/shows/' + slug); await hydrated();
  22. const load = Date.now() - t0;
  23. const head = await ev(`JSON.stringify({ h1: (document.querySelector('show-header h1') || {}).textContent || null, summary: ((document.querySelector('show-summary') || {}).textContent || '').slice(0, 120), scrollW: document.documentElement.scrollWidth })`);
  24. writeFileSync(`${OUT}/${slug}-${w}.png`, Buffer.from((await page.send('Page.captureScreenshot', { format: 'png' })).data, 'base64'));
  25. console.log(`${slug} @${w}: full load ${load} ms ${head}`);
  26. }
  27. }
  28. console.log('problems', JSON.stringify(page.problems()));
  29. await browser.close();

Branches

Latest commits

  • 1f2df72amission RV39mre
  • 6c1936f9log+status: GC planmre
  • 2846a840log: m569 result, GC hypothesismre
  • b24cd2d5log: Anton on hl:fetch, mission 569mre
  • 7d42cac1log+status: SL1 measured, fetch stalls remainmre
  • 8e5f2ceflog: SL1 deployedmre
  • 29f34212log: SL1 deploy startedmre
  • 529dd741Merge sl1-slices: slice details repair and person fill (SL1)mre
  • 8a83316blog: SL1 result, session drain slowermre
  • 35e93e8dSL1: slice the details repair and person fill: catalog lists changed in place, 40 ms fill steps, people created in steps, writes one table per tickmre
  • 72c9119flog+status: SL1 startedmre
  • d74620fcmission SL1: slice repair and person fillmre
  • 5d542d73log+status: ST1 resultmre
  • 3945eb81ST1: stall diagnosis reportmre
  • 404733aclog: ST1 startedmre
  • 3e3d5a55mission ST1: stall diagnosismre
  • 9c3180eblog+status: RV28d measured after deploymre
  • fdf10b1alog: RV28d deployed on day38bmre
  • 320005e9log: RV28d merged, deploy runningmre
  • a8fef27dRV28d: reportmre