tickets
All repositories: gitoria
1.5 KB
#!/usr/bin/env python3# tests/realdata-compare.py (mission 010): compare two tests/realdata-baseline.mjs outputs (the reads; writes:# realdata-compare-writes.py). Masks only what is not the app's output:# "at":<ms> the session seed's request time (differs between two runs of the SAME code)# "site":"<file:l:c>" source coordinates of a View node (move when lines above it move)# ?v=<hash> hl:web's content hash of the runtime / stylesheet / component modules# Child@<line>:<col> a child component's mount key carries its source position too# python3 tests/realdata-compare.py <dirA> <dirB> → per-file verdict; exit 1 on a real differenceimport os, re, sysa, b = sys.argv[1], sys.argv[2]masks = [(re.compile(r'\\"at\\":\d+'), r'\"at\":T'), (re.compile(r'\\"site\\":\\"[^"\\]*\\"'), r'\"site\":S'), (re.compile(r'\?v=[0-9a-f]+'), '?v=H'), (re.compile(r'([A-Z]\w*)@\d+:\d+'), r'\1@L:C')]def norm(t):for r, s in masks: t = r.sub(s, t)return tfa, fb = sorted(f for f in os.listdir(a) if '-w-' not in f), sorted(f for f in os.listdir(b) if '-w-' not in f) # writes: realdata-compare-writes.pyif fa != fb: print('FILE LISTS DIFFER', set(fa) ^ set(fb)); sys.exit(1)raw = masked = 0; bad = []for f in fa:x, y = open(os.path.join(a, f)).read(), open(os.path.join(b, f)).read()if x == y: continueraw += 1if norm(x) != norm(y): bad.append(f)print(f'{len(fa)} files: {len(fa) - raw} byte-identical, {raw - len(bad)} identical after masking, {len(bad)} DIFFERENT')for f in bad[:30]: print(' DIFF', f)sys.exit(1 if bad else 0)
Branches
Latest commits
- bc3bdecerecords: day38b live, #94 purgedmre
- f6c5aa0dMerge main (records)mre
- e23d42acconnect gate: wait for hydration before clicking Disconnectmre
- a5d45d00records: D38 cause, GOmre
- 19eeb938records: D38 gates, two day38b failuresmre
- f8e42a85Re-vendor tickets to Hybriel set day38b (1e554d7)mre
- 51645016Merge purge-94 (#94, identity rule)mre
- 94d6ca2arecords: D38 startedmre
- 9df09aacmission 029: day38b re-vendor + deploymre
- d2834f65records: #94 backup planmre
- 4467d8cbrecords: #94 purge readymre
- aa2d124eREADME: the #94 purge gatemre
- e843ff7cOne-time purge of miserit-anthar#94 (#94, identity rule): idempotent step in lib/migrate.hl, fixture gate tests/purge94.mjsmre
- 506a4efdmission 028: #94, identity rulemre
- 78c7f48eRefine mpackdb holdmre
- 3d7d89c8Record mpackdb hold until day38mre
- f1bf7195#51 done; my subscription idmre
- 9870b945status: #51 proof greenmre
- e92173c6log: #51 live push proofmre
- 72d87041log: Hermes push livemre