gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit0adc551e0adc551emission brief 004mre0adc551e/tests/same-output-compare.py

1.3 KB

  1. #!/usr/bin/env python3
  2. # tests/same-output-compare.py (components mission 002): compare two tests/same-output.mjs runs. Masks only what changes per run / per code hash: ?v= hashes, source positions
  3. # (file.hl:L:C), the seed time, upload names (time-random), the hl-shell cache name. python3 compare.py A B [-v]
  4. import os, re, sys, difflib
  5. a, b = sys.argv[1], sys.argv[2]; v = '-v' in sys.argv
  6. def mask(t):
  7. t = re.sub(r'\?v=[0-9a-f]+', '?v=H', t)
  8. t = re.sub(r'(\w[\w./-]*\.hl):\d+:\d+', r'\1:L:C', t)
  9. t = re.sub(r'@\d+:\d+', '@L:C', t)
  10. t = re.sub(r'hl-shell-[0-9a-f]+', 'hl-shell-H', t)
  11. t = re.sub(r'/md-editor/files/\d+-[0-9a-f]+', '/md-editor/files/T-R', t)
  12. t = re.sub(r'\b1[78]\d{11}\b', 'TIME', t)
  13. t = re.sub(r'("version"|"build"|"seed"|"now")\s*:\s*"?[\w.-]+"?', r'\1:X', t)
  14. return t
  15. fa, fb = sorted(os.listdir(a)), sorted(os.listdir(b))
  16. same = diff = 0
  17. for f in sorted(set(fa) | set(fb)):
  18. if f not in fa or f not in fb: print('ONLY IN', 'A' if f in fa else 'B', f); diff += 1; continue
  19. x, y = mask(open(os.path.join(a, f), errors='replace').read()), mask(open(os.path.join(b, f), errors='replace').read())
  20. if x == y: same += 1; continue
  21. diff += 1; print('DIFF', f)
  22. if v:
  23. for l in list(difflib.unified_diff(re.split(r'(?<=[;,}>\n])', x), re.split(r'(?<=[;,}>\n])', y), lineterm='', n=0))[2:40]: print(' ', l[:300])
  24. print(f'same {same}, different {diff}')

Branches

Latest commits

  • 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
  • 315731efcomponents re-synced to components.hybriel a567b57 (md-editor tables)mre
  • b59e2ee9docs/usage.md + tools/usage.sh: which app carries which component/theme/tokens copy, and whether it matches the sourcemre
  • 0222f67ctheme: two corner radii only (radiusSmall 5px, radiusLarge 10px); check-theme flags any other radius; gate 76/0mre
  • 877b63acdesign rules: two radii only (5px small, 10px large)mre
  • 635234dfcomponents re-synced to components.hybriel 5a98d77 (#15 black/white base look); gate 73/0, check-theme 0, screenshots unchangedmre
  • 876b2064docs: workaround note for hybriel#130 (slot marker mid-line)mre
  • 85b56541layouts mission 002 3/3: same-output tests, letcount, shots ports, docs, reportmre
  • 0f325d3blayouts mission 002 2/3: code rules — styles.hl -> components/styles.hl, the one never-reassigned let dropped; gate 73/0, same outputmre
  • a3e74c8alayouts mission 002 1/3: components re-copied byte-verbatim from components.hybriel 3f93d71 by tools/sync-components.sh (+ --check, components/SOURCE); gate 73/0, check-theme 0mre
  • 80ce6ba9report 001 (mission 075)mre
  • 5c6e338flayouts.worldapi.org in Hybriel: WorldAPI theme (tokens, borderless elements, themed components.hybriel components), shells (header, main/user menu, sidebar overlay, content-first, list-first, three-pane), showcase, check-theme helper; gate 73/0 (mission 075)mre