gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitcd3641a1cd3641a1|||PR records: day72 deploy live, tickets closedmrecd3641a1/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

  • cd3641a1|||PR records: day72 deploy live, tickets closedmre
  • 7d44d852Merge branch 'records-t37' into mainTickets
  • 926f7061|||PR records: merges, D36 deploymre
  • bf58534eMerge branch 'l33-final' into mainTickets
  • 759a9ac3|||PR thin login (tickets#46, #45): merge main, route entry cleanupmre
  • 239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre
  • 5822cb3aMerge branch 'o34-clean' into mainTickets
  • 0870653c|||PR offline note from __hlOnline, no polling (tickets#41)mre
  • 14cf96b4Merge branch 'records-t36' into mainTickets
  • 07749fa1|||PR records: day72 + #40 mergedmre
  • ecd7e226|||PR Consolidate login and move handler logic into topic libraries (partial)mre
  • 6dea1c60Merge branch 'r35-day72' into mainTickets
  • 7bcfdc22|||PR drop worker edits to conductor recordsmre
  • 2617b6ee|||PR dialogs: host flag cleared on close, dialog gate (tickets#40)mre
  • 6e701371|||PR record partial day72 dialog validationmre
  • b9fb9a91|||PR bind ticket dialog visibility to member flagsmre
  • 0788e65f|||PR re-vendor Hybriel day72mre
  • e2a6bdcfMerge branch 'records-t35' into mainTickets
  • d8d54df1|||PR records: R35 day72 + #40mre
  • 8a7f475aMerge branch 'records-t33' into mainTickets