gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitc7cdef62c7cdef62Log: Apollo STOP, workers pausedmrec7cdef62/tests/person-lookup.mjs

1.7 KB

  1. // tracker#46 gate: the person page's per-request code (components/person.hl, people.hl `filmographyOf`, `personInfoOf`) must not
  2. // fetch a title's whole record per credit (showsTable.fetch / showById / liveShowOf: 311 decoded records for Tom Hanks per
  3. // request, which fed the byte-triggered GC) nor scan a table (find / iterate). It reads the slim `creditRowLive` cache.
  4. // usage: node tests/person-lookup.mjs [tree] (default: the tree of this file)
  5. import { readFileSync } from 'node:fs';
  6. import { dirname, resolve } from 'node:path';
  7. import { fileURLToPath } from 'node:url';
  8. const root = resolve(process.argv[2] ?? resolve(dirname(fileURLToPath(import.meta.url)), '..'));
  9. const people = readFileSync(root + '/lib/people.hl', 'utf8');
  10. const comp = readFileSync(root + '/components/person.hl', 'utf8');
  11. const body = (src, name) => {
  12. const i = src.indexOf('static ' + name + ' = ');
  13. if (i < 0) throw new Error('no ' + name);
  14. const m = src.indexOf('\nstatic ', i + 10);
  15. return src.slice(i, m < 0 ? undefined : m);
  16. };
  17. const banned = /showsTable\.(fetch|find|iterate)|showById\(|liveShowOf\(|\.find\(|\.iterate\(/;
  18. let bad = 0;
  19. for (const [label, text] of [['people.hl filmographyOf', body(people, 'filmographyOf')], ['people.hl personInfoOf', body(people, 'personInfoOf')],
  20. ['people.hl personBySlug', body(people, 'personBySlug')], ['components/person.hl', comp.split('\n').filter(l => !l.trim().startsWith('//')).join('\n')]]) {
  21. const m = text.match(banned);
  22. if (m) { bad++; console.log('FAIL ' + label + ': ' + m[0]); } else console.log('ok ' + label);
  23. }
  24. if (!/creditRowLive\(/.test(body(people, 'filmographyOf'))) { bad++; console.log('FAIL filmographyOf does not use creditRowLive'); }
  25. console.log(bad ? 'person-lookup: FAILED' : 'person-lookup: passed');
  26. process.exit(bad ? 1 : 0);

Branches

Latest commits

  • c7cdef62Log: Apollo STOP, workers pausedmre
  • d0c083fbLog: usage stopmre
  • c6d464e5Log: Apollo GO backlog, AP56 and BS1 startedmre
  • 1eb6f1a1Missions AP56, BS1mre
  • 4871f8adLog: AP52 live on day52, browser gate greenmre
  • d9bf2988Merge ap52: day52, tracker#58 server argument, #51 modal close rule, #56 keyed season rowsmre
  • c4a60ef2Log: RT52 retest passed, AP52 startedmre
  • 83760a55Browser gate: search results belong to the address form of the typed text (tracker#52 navigate replace)mre
  • 6e951d91AP52: show-page rows are keyed records; closing a season is one upsert and removes (tracker#56, hybriel#331)mre
  • 3bb4ccddAP52: modal close button refers to its nested rule with Style.buttonModalX (tracker#51, hybriel#333)mre
  • ba16933fAP52: login callback and title route are static handlers taking the server as third argument (tracker#58, hybriel#332)mre
  • 85153900AP52: re-vendor Hybriel set day52 (source 77cfca31, bin 0a8ed496)mre
  • 7c051eddLog: hybriel#338 answermre
  • d049b8b8Log: HM50 live, #52 donemre
  • 6d05fa37Log: HM50 Part A mergedmre
  • 1c7dab74HM50: the shell reads the framework's online state, netProbe removed (tracker#55)mre
  • e8b91697HM50: search address follows the text via navigate(path, replace = true) (tracker#52)mre
  • 6fe1896cHM50: re-vendor Hybriel set day50 (source 0ae38232, bin d3ef9d16)mre
  • 2f391aa9Log: HM50 startedmre
  • 4b59c03dHM50 mission: doc pathmre