gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit0bcc62940bcc6294Mission 011: e2e-197, brief, report, LOGmre0bcc6294/tests/same-output-modules.py

2.6 KB

  1. #!/usr/bin/env python3
  2. # (copied from gitoria .scratch/w082 for components mission 002; file filter = baseline.mjs names)
  3. # tests/same-output-modules.py <dirA> <dirB> (gitoria's modcmp.py): the browser modules of two baseline runs. A module = the component's own code + tables of the
  4. # statics it imports (each a real, client-callable function or a refusing server-only stub naming its file). A move of a
  5. # static to another file changes the tables and the source positions, not the behaviour. Checked here:
  6. # 1. the module without the import tables and with every source position masked is the same;
  7. # 2. every imported name the component's own code uses is the same kind (function / stub), a function with the same body.
  8. import os, re, sys
  9. a, b = sys.argv[1], sys.argv[2]
  10. POS = re.compile(r'[\w-]+\.hl:\d+:\d+')
  11. def parts(t):
  12. t = re.sub(r'\?v=[0-9a-f]+', '?v=H', t)
  13. kinds, own = {}, []
  14. lines = t.split('\n'); i = 0
  15. while i < len(lines):
  16. l = lines[i]
  17. m = re.match(r'\$_\d+\.(\w+)=(.*)$', l)
  18. if m:
  19. if m.group(2).startswith('()=>_55('): kinds.setdefault(m.group(1), ('stub', ''))
  20. else:
  21. body = [m.group(2)]
  22. while not lines[i].endswith('}));') and not (lines[i].endswith(';') and lines[i] is l and '=>{' not in l):
  23. i += 1; body.append(lines[i])
  24. kinds[m.group(1)] = ('fn', POS.sub('P', re.sub(r'\$_\d+', '$_N', '\n'.join(body))))
  25. i += 1; continue
  26. if re.match(r'const \$_\d+=\{\};$', l) or re.match(r'const \w+=\$_\d+\.\w+;$', l) or re.match(r'const \w+=\(\)=>_55\(2,', l):
  27. m2 = re.match(r'const (\w+)=\(\)=>_55\(2,', l)
  28. if m2: kinds[m2.group(1)] = ('plugin', '')
  29. i += 1; continue
  30. own.append(POS.sub('P', re.sub(r'\$_\d+', '$_N', l))); i += 1
  31. return kinds, '\n'.join(own)
  32. bad = 0
  33. for f in sorted(os.listdir(a)):
  34. if not (f.startswith('http__') and f.endswith('.hl')): continue # m002: the browser modules of baseline.mjs
  35. x, y = open(os.path.join(a, f)).read(), open(os.path.join(b, f)).read()
  36. if x == y: print(f, 'identical'); continue
  37. kx, ox = parts(x); ky, oy = parts(y)
  38. notes = []
  39. if ox != oy: notes.append('the component code differs')
  40. words = set(re.findall(r'\b\w+\b', ox))
  41. for n in sorted(words & (set(kx) | set(ky))):
  42. if kx.get(n) != ky.get(n): notes.append(f'{n}: {kx.get(n, ("absent",))[0]} → {ky.get(n, ("absent",))[0]}' + (' (body differs)' if kx.get(n, ('',))[0] == ky.get(n, ('',))[0] == 'fn' else ''))
  43. print(f, 'same code, same imported functions (only the tables / positions moved)' if not notes else 'DIFF: ' + '; '.join(notes))
  44. bad += len(notes)
  45. sys.exit(1 if bad else 0)

Branches

Latest commits

  • 0bcc6294Mission 011: e2e-197, brief, report, LOGmre
  • 137303c5MainMenu marks the current page from the route (hybriel#197, server-rendered); current prop/item.current stay as fallback; tracker demo drops current; gate: SSR marker; docsmre
  • 9325b403Re-vendor Hybriel to master 7f13a82f (hl:web batch 2: #190 #193 #197 #194 named regions); plugins whole, bin/hybriel static build (git-ignored)mre
  • b31dc74dusage: calendar (theme 76f99f6-era ContentFirst, user menu, ☰ menu) and tracker (theme 76f99f6, modal + pagination current, own current marker until hybriel#197) rowsmre
  • 8a3d5d40Mission 010: brief, report, LOG, STATUSmre
  • a56abf1fSync components to components.hybriel 3794c59 (MdEditor real-key fixes); showcase real-key check on the md-editor pagemre
  • 76f99f64E2E in lisbeth's Chrome for the menu's current page (mission 009): tests/e2e-menu-current.mjs, reportmre
  • 159b1d53MainMenu/Sidebar: current page marked beyond colour, count badge, item current flag; gate 300/0 (mission 009)mre
  • 0573eed3usage: notes + tickets on MdEditor (md-editor.js retired), gitoria on theme dbe3de7, tracker theme oldermre
  • 78478f6eSync showcase to components.hybriel 1442e58: pick-mode page, comments attach, md-editor rows/files off; gates 285/0mre
  • dbe3de79Display bugs from a real Chrome walk (mission 007): Settings page and in-shell doc reader instead of raw .md links, closed phone search hidden whatever a page says, /elements form rules scoped, three-pane danger contrast; display audit gate (132 -> 244 checks), walk + Settings e2e toolsmre
  • 1875a051Theme: 44 px tap targets mobile first (layoutTap), 16 px fields, desktop denser only in @media 60rem; 390 px tap audit + gate checks (mission 006)mre
  • 3d4f8e19Sync showcase to components.hybriel 9db927d: comments and files-upload pages, pagination onPage, md-editor readonly, gate 99 checksmre
  • 64d635acmission brief 005mre
  • 0d0fef25paths: projects moved into /media/STORAGE/projects/WorldAPI/mre
  • 2dbe0df5Re-vendor Hybriel to the shared static build 0f396652 (plugins; bin/ is git-ignored), compose cache volume + tmpfs /tmp, gate wait 120 s, report 004mre
  • 0adc551emission brief 004mre
  • 1376e905deploy.sh: wait up to DEPLOY_URL_WAIT (120 s) for 200 after the restart, as the other apps (cold compile, hybriel#148)mre
  • c0fdbf6cdocker-compose: init: true (hybriel#156, PID 1 ignored SIGTERM, every restart waited 10 s)mre
  • ecf70665usage: layouts on components a567b57mre