gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitbc3bdecebc3bdecerecords: day38b live, #94 purgedmrebc3bdece/tests/realdata-compare.py

1.5 KB

  1. #!/usr/bin/env python3
  2. # tests/realdata-compare.py (mission 010): compare two tests/realdata-baseline.mjs outputs (the reads; writes:
  3. # realdata-compare-writes.py). Masks only what is not the app's output:
  4. # "at":<ms> the session seed's request time (differs between two runs of the SAME code)
  5. # "site":"<file:l:c>" source coordinates of a View node (move when lines above it move)
  6. # ?v=<hash> hl:web's content hash of the runtime / stylesheet / component modules
  7. # Child@<line>:<col> a child component's mount key carries its source position too
  8. # python3 tests/realdata-compare.py <dirA> <dirB> → per-file verdict; exit 1 on a real difference
  9. import os, re, sys
  10. a, b = sys.argv[1], sys.argv[2]
  11. 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')]
  12. def norm(t):
  13. for r, s in masks: t = r.sub(s, t)
  14. return t
  15. fa, 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.py
  16. if fa != fb: print('FILE LISTS DIFFER', set(fa) ^ set(fb)); sys.exit(1)
  17. raw = masked = 0; bad = []
  18. for f in fa:
  19. x, y = open(os.path.join(a, f)).read(), open(os.path.join(b, f)).read()
  20. if x == y: continue
  21. raw += 1
  22. if norm(x) != norm(y): bad.append(f)
  23. print(f'{len(fa)} files: {len(fa) - raw} byte-identical, {raw - len(bad)} identical after masking, {len(bad)} DIFFERENT')
  24. for f in bad[:30]: print(' DIFF', f)
  25. 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