gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit6c1936f96c1936f9log+status: GC planmre6c1936f9/tests/realdata-m026.mjs

4.9 KB

  1. // tests/realdata-m026.mjs — mission 026 (tracker#31, duplicate titles), NOT the gate: what the creator sees on a COPY of live storage
  2. // (tests/realdata-m026.sh start …), signed in as az5b2 (cookie from $REAL_SID_FILE). Prints one JSON line per check and writes
  3. // screenshots (390 + 1280) to $REAL_SHOTS: /my/series (Reacher's last watched episode, Archive 81's row), Reacher's page (season 3
  4. // checked or not), /my/unwatched (Reacher S03 rows), Archive 81's page, the search "archive 81", a talk show with many seasons
  5. // (The View) and its full load time. Env: REAL_PORT, REAL_CHROME, REAL_SID_FILE, REAL_SHOTS, REAL_LABEL (file name prefix).
  6. import { writeFileSync, readFileSync, mkdirSync } from 'node:fs';
  7. import { join } from 'node:path';
  8. import { launchBrowser } from './cdp.mjs';
  9. process.env.HL_CHROME ||= '/opt/google/chrome/chrome';
  10. const PORT = Number(process.env.REAL_PORT || 8730), BASE = `http://127.0.0.1:${PORT}`;
  11. const SID = readFileSync(process.env.REAL_SID_FILE, 'utf8').trim(), SHOTS = process.env.REAL_SHOTS, LABEL = process.env.REAL_LABEL || 'x';
  12. if (SHOTS) mkdirSync(SHOTS, { recursive: true });
  13. const browser = await launchBrowser({ debugPortRange: [Number(process.env.REAL_CHROME || 8729), Number(process.env.REAL_CHROME || 8729)] });
  14. const page = await browser.newPage();
  15. await page.send('Network.setCookie', { name: 'trackersid', value: SID, url: BASE });
  16. const ev = (e) => page.evaluate(e);
  17. const hydrated = () => page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 120000, label: 'hydrated' });
  18. const open = async (path) => { const t = Date.now(); await page.goto(BASE + path, { timeout: 120000 }); await hydrated(); return Date.now() - t; };
  19. const shot = async (name, full) => {
  20. if (!SHOTS) return;
  21. for (const [w, h, m] of [[390, 844, true], [1280, 900, false]]) {
  22. await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: h, deviceScaleFactor: 1, mobile: m });
  23. await new Promise(r => setTimeout(r, 300));
  24. const opts = { format: 'png' };
  25. if (full) { const hh = await ev('document.documentElement.scrollHeight'); opts.clip = { x: 0, y: 0, width: w, height: Math.min(hh, 6000), scale: 1 }; opts.captureBeyondViewport = true; }
  26. writeFileSync(join(SHOTS, `${LABEL}-${name}-${w}.png`), Buffer.from((await page.send('Page.captureScreenshot', opts)).data, 'base64'));
  27. }
  28. await page.send('Emulation.clearDeviceMetricsOverride', {});
  29. };
  30. const out = {};
  31. try {
  32. await open('/my/series');
  33. out.mySeries = JSON.parse(await ev(`JSON.stringify(Array.from(document.querySelectorAll('my-show-row')).filter(r => /Reacher|Archive 81|Flight Attendant|Raised by Wolves/.test(r.textContent)).map(r => [r.querySelector('a.myshow-title').textContent, r.querySelector('a.myshow-title').getAttribute('href'), (r.querySelector('my-show-episode') || {}).textContent || '']))`));
  34. out.mySeriesRows = await ev(`document.querySelectorAll('my-show-row').length`);
  35. await shot('my-series');
  36. const seasons = () => ev(`JSON.stringify(Array.from(document.querySelectorAll('season-row')).map(r => r.querySelector('season-label').textContent + ': ' + r.querySelector('season-count').textContent + ' ' + ((r.querySelector('button.checkicon') || {}).getAttribute ? r.querySelector('button.checkicon').getAttribute('class') : '')))`);
  37. await open('/series/Reacher');
  38. out.reacher = JSON.parse(await seasons());
  39. await shot('reacher', true);
  40. await open('/my/unwatched');
  41. out.unwatchedReacher = JSON.parse(await ev(`JSON.stringify(Array.from(document.querySelectorAll('unwatched-row')).filter(r => /Reacher/.test(r.textContent)).map(r => r.querySelector('unwatched-episode').textContent))`));
  42. out.unwatchedRows = await ev(`document.querySelectorAll('unwatched-row').length`);
  43. await shot('my-unwatched');
  44. out.archiveLoad = await open('/series/Archive-81');
  45. out.archive = { h1: await ev(`(document.querySelector('show-header h1 type-name') || {}).textContent`), seasons: JSON.parse(await seasons()), path: await ev('location.pathname') };
  46. await shot('archive-81', true);
  47. await open('/search/archive%2081');
  48. out.search = JSON.parse(await ev(`JSON.stringify(Array.from(document.querySelectorAll('a.search-title')).map(a => a.textContent + ' ' + a.getAttribute('href')))`));
  49. await shot('search-archive');
  50. for (const p of ['/shows/The-View', '/shows/EastEnders', '/series/EastEnders']) {
  51. const r = await fetch(BASE + p, { redirect: 'manual' });
  52. if (r.status === 200) { out.talkPath = p; break; }
  53. if (r.status === 301) { out.talkPath = r.headers.get('location').replace(BASE, ''); break; }
  54. }
  55. if (out.talkPath) {
  56. out.talkLoads = [];
  57. for (let i = 0; i < 3; i++) out.talkLoads.push(await open(out.talkPath));
  58. out.talkSeasons = await ev(`document.querySelectorAll('season-row').length`);
  59. await shot('talk');
  60. }
  61. } catch (e) { out.error = String(e.stack || e); }
  62. console.log(JSON.stringify(out, null, 1));
  63. await browser.close();
  64. process.exit(out.error ? 1 : 0);

Branches

Latest commits

  • 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
  • 2bae8373RV28d: re-vendor Hybriel set day38b (source 1e554d75, bin 5ff2a46d)mre