tracker
All repositories: gitoria
4.5 KB
// tests/realdata-068.mjs — tracker#20/#21 (mission 068), NOT the gate: on a COPY of live storage/ (STATUS.md has the procedure),// after the kind backfill. (1) SPOT CHECKS by name: what our search says each title is (Series / Show / Movie) and where it links.// (2) Signed in (cookie from .scratch/w068/real-sid) at 390 + 1280: every page kind's full load time (to hydrated), its typed// heading, no sideways scroll, a screenshot → $REAL_OUT. Env: REAL_PORT (8760), REAL_CHROME (8767), REAL_NAMES (comma list).import { writeFileSync, readFileSync, mkdirSync } from 'node:fs';import { launchBrowser } from './cdp.mjs';process.env.HL_CHROME ||= '/opt/google/chrome/chrome';const BASE = `http://127.0.0.1:${process.env.REAL_PORT || 8760}`, OUT = process.env.REAL_OUT || '/tmp/w068/real';const SID = readFileSync(process.env.REAL_SID_FILE || '.scratch/w068/real-sid', 'utf8').trim();mkdirSync(OUT, { recursive: true });// (1) spot checks: the search's row for the exact title (with its year), by the server's own renderconst names = (process.env.REAL_NAMES || 'Reacher,Saturday Night Live,The Tonight Show Starring Jimmy Fallon,Last Week Tonight with John Oliver,Foundation,Doctor Who,Jersey Shore,Chernobyl,Planet Earth,Hot Ones,The Late Show with Stephen Colbert,Severance').split(',');const spot = [];for (const n of names) {const h = await (await fetch(BASE + '/search/' + encodeURIComponent(n))).text();const rows = [...h.matchAll(/<search-row>[\s\S]*?class="search-title" href="([^"]*)">([^<]*)<\/a>[\s\S]*?<search-type class="([^"]*)">([^<]*)<\/search-type>/g)].map(m => ({ href: m[1], title: m[2], type: m[4] }));const hit = rows.filter(r => r.title.replace(/ \(\d{4}\)$/, '') === n);spot.push(n + ': ' + (hit.length ? hit.map(r => `${r.type} ${r.title} → ${r.href}`).join(' | ') : 'not in our data'));}console.log('SPOT CHECKS\n' + spot.join('\n'));// (2) pages, signed inconst browser = await launchBrowser({ debugPortRange: [Number(process.env.REAL_CHROME || 8767), Number(process.env.REAL_CHROME || 8767)] });const page = await browser.newPage();const ev = (e) => page.evaluate(e);const hydrated = () => page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1 && document.readyState === "complete"', { timeout: 60000, label: 'hydrated' });const shot = async (n) => writeFileSync(`${OUT}/${n}.png`, Buffer.from((await page.send('Page.captureScreenshot', { format: 'png' })).data, 'base64'));const load = async (path) => { const t = Date.now(); await page.goto(BASE + path, { timeout: 60000 }); await hydrated(); return Date.now() - t; };await page.send('Network.setCookie', { name: 'trackersid', value: SID, url: BASE });// a movie the creator follows, and the first cast member of Reacher, from the pages themselvesawait load('/my/movies');const movie = await ev(`(document.querySelector('a.myshow-title') || {}).getAttribute ? document.querySelector('a.myshow-title').getAttribute('href') : '/movies'`);await load('/series/Reacher');const person = await ev(`(document.querySelector('a.artist-link') || {}).getAttribute ? document.querySelector('a.artist-link').getAttribute('href') : '/'`);const PAGES = [['home', '/'], ['series-list', '/series'], ['shows-list', '/shows'], ['movies-list', '/movies'], ['series', '/series/Reacher'], ['show', '/shows/Saturday-Night-Live'],['movie', movie], ['genre', '/genres/Drama'], ['person', person], ['my-series', '/my/series'], ['my-shows', '/my/shows'], ['search', '/search/reacher']];const out = [];for (const [w, h, mobile] of [[390, 844, true], [1280, 900, false]]) {await page.send('Emulation.setDeviceMetricsOverride', { width: w, height: h, deviceScaleFactor: mobile ? 2 : 1, mobile });for (const [name, path] of PAGES) {const ms = await load(path);await page.waitFor(`Array.from(document.querySelectorAll('img')).filter(i => { const r = i.getBoundingClientRect(); return r.top < innerHeight && r.bottom > 0 }).every(i => i.complete)`, { timeout: 10000, label: 'images' }).catch(() => {});const info = await ev(`JSON.stringify({ h1: (document.querySelector('h1') || {}).innerText ? document.querySelector('h1').innerText.replace(/\\s+/g, ' ') : '', word: document.querySelector('h1 type-word') ? getComputedStyle(document.querySelector('h1 type-word')).color : '', sideways: document.documentElement.scrollWidth > ${w}, rows: document.querySelectorAll('my-show-row, a.tile, search-row, a.film-row').length })`);await shot(`${name}-${w}`);out.push(`${w} ${path} ${ms} ms ${info}`);}}console.log('PAGES\n' + out.join('\n'));console.log('problems', JSON.stringify(page.problems ? page.problems() : []));await browser.close();
Branches
Latest commits
- 593dab6fmission 043: report, LOGmre
- 1a5a4818boot scans back to iterate (slices measured slower: titles 114 s, episodes 141 s, persons failed); lambda per rowmre
- 03d29893boot scans read primary-key slices (lib/slices.hl from mission 044): iterate is eager too; people view log line back; allShows/allEpisodes stay for toolsmre
- 0d6293ebmission 043: mission filemre
- 55bbd619boot: one streamed pass per table (lib/bootscan.hl) instead of find(null,null) per module; follows/watches/franchises scans streammre
- 1d465d3ere-vendor plugins to Hybriel master f9614007 (mpackdb #202 copy fix, libmpackdb sha 6fb3b9d6)mre
- 6648ba44mission 042: real-browser E2E on ce6f2e0a re-vendor 69/0 at 390 + 1280mre
- 3ed3a0efmission 042: gates old/new equal (browser #41 route-table regex accepts unescaped hl:web output), real-data TTFB, E2E blocked by lisbeth lockmre
- d5b61e90LOG 042mre
- 4acdbaccmission 042: memory comparison old vs ce6f2e0a (stopped: warm VmHWM higher), reportmre
- d0f620d6mission 042: re-vendor Hybriel ce6f2e0a (plugins incl. mpackdb; bin runtime built from the same archive, git-ignored), compact=false keptmre
- 5bd14e12mission 040: theme 76f99f6 gates + E2E green; 44 px fixes (skeleton row, type-word, genre-link/pill); README, reportmre
- 77cfa45cmission 040: partial report (theme/modal/pagination re-copied, tilelist onPage, 44 px taps; gates new + E2E pending)mre
- 4b14822fe2e-theme: menu marker by colourmre
- 09780f4emission 040 WIP: theme, modal, pagination, tokens re-copied from layouts 76f99f6; tilelist uses onPage; tap sizes 44 px for tracker's own small buttons; tests/e2e-theme.mjsmre
- fb80bb8chotfix: open the 5 show stores without compaction (compact = false) — compact-on-open left another handle on stale offsets, every read gave a bare Number (hybriel mpackdb refresh after a shrink); live down 2026-10-20 05:11mre
- e00d3bf7paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
- a8c7f234tracker#36 (mission 039): tools/tmdb-check.hl survives a dropped connection (on Error, asked again, failed lines) and resumes with --from N; tests/tmdbcheck.mjs 6/6 against a fake TMDBmre
- 9c230516mission brief w39mre
- 3609121dmission 038 docs + report (quota stop): README/kinds.md for #43 #42 #36, STATUS, LOG; HEAD browser gate 374/8 in the in-app daily run block (hour-boundary suspected, rerun pending), other gates green; #36 real run needs TMDB_READ_TOKENmre