tracker
All repositories: gitoria
1.7 KB
// tracker#46 gate: the person page's per-request code (components/person.hl, people.hl `filmographyOf`, `personInfoOf`) must not// fetch a title's whole record per credit (showsTable.fetch / showById / liveShowOf: 311 decoded records for Tom Hanks per// request, which fed the byte-triggered GC) nor scan a table (find / iterate). It reads the slim `creditRowLive` cache.// usage: node tests/person-lookup.mjs [tree] (default: the tree of this file)import { readFileSync } from 'node:fs';import { dirname, resolve } from 'node:path';import { fileURLToPath } from 'node:url';const root = resolve(process.argv[2] ?? resolve(dirname(fileURLToPath(import.meta.url)), '..'));const people = readFileSync(root + '/lib/people.hl', 'utf8');const comp = readFileSync(root + '/components/person.hl', 'utf8');const body = (src, name) => {const i = src.indexOf('static ' + name + ' = ');if (i < 0) throw new Error('no ' + name);const m = src.indexOf('\nstatic ', i + 10);return src.slice(i, m < 0 ? undefined : m);};const banned = /showsTable\.(fetch|find|iterate)|showById\(|liveShowOf\(|\.find\(|\.iterate\(/;let bad = 0;for (const [label, text] of [['people.hl filmographyOf', body(people, 'filmographyOf')], ['people.hl personInfoOf', body(people, 'personInfoOf')],['people.hl personBySlug', body(people, 'personBySlug')], ['components/person.hl', comp.split('\n').filter(l => !l.trim().startsWith('//')).join('\n')]]) {const m = text.match(banned);if (m) { bad++; console.log('FAIL ' + label + ': ' + m[0]); } else console.log('ok ' + label);}if (!/creditRowLive\(/.test(body(people, 'filmographyOf'))) { bad++; console.log('FAIL filmographyOf does not use creditRowLive'); }console.log(bad ? 'person-lookup: FAILED' : 'person-lookup: passed');process.exit(bad ? 1 : 0);
Branches
Latest commits
- 4b2f2995HM61 report: tracker#61 packed people ordermre
- 48faa84flog: #60 deploy startedmre
- 90734c6cMerge branch 'hm60-shortids'mre
- e0db0d1bHM60 report: tracker#60 packed short-ID ownersmre
- 3c79b576Pack short-ID ownership into byte buffersmre
- e822524bstatus wordingmre
- 1c7f0480log: HM60/HM61 startedmre
- 2841d215missions HM60 HM61mre
- 289c6ce4HM1 report: heap object breakdownmre
- 2e7d6257log: HM1 startedmre
- 2f790465mission HM1: heap object breakdownmre
- a18957falog: evening re-measure after CBmre
- aac9a98dlog: evening re-measure startmre
- 45163bd4log: person/tmdb error hypothesismre
- cb38de2blog: swap 503 causemre
- fd10c3d5log: CB livemre
- 7557c025log: CB deploy try 2mre
- 06a7534aMerge branch 'cb'mre
- 2f8030d6log: CB gates greenmre
- 498bf644log: CB gates startmre