gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commite843ff7ce843ff7cOne-time purge of miserit-anthar#94 (#94, identity rule): idempotent step in lib/migrate.hl, fixture gate tests/purge94.mjsmree843ff7c/tests/realdata-compare-writes.py

1.6 KB

  1. #!/usr/bin/env python3
  2. # tests/realdata-compare-writes.py (mission 010): compare the WRITE part ('w-' files) of two realdata-baseline.mjs
  3. # runs. Besides realdata-compare.py's masks it masks
  4. # what a write makes new each run: mpackdb ids that the read part of the run never showed, epoch ms of today, Vienna
  5. # stamps "YYYY-MM-DD HH:MM" of today, the API token. Each new id is numbered in order of appearance, so the SAME
  6. # record must stand at the same places in both runs.
  7. import os, re, sys, time
  8. a, b = sys.argv[1], sys.argv[2]
  9. src = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'realdata-compare.py')).read()
  10. exec(src[src.index('masks = '):src.index('fa, fb')])
  11. known = set()
  12. for f in os.listdir(a):
  13. if '-w-' not in f: known |= set(re.findall(r'\b0m[0-9a-z]{10}\b', open(os.path.join(a, f)).read()))
  14. today = time.strftime('%Y-%m-%d')
  15. def wnorm(t, ids):
  16. t = norm(t)
  17. t = re.sub(r'tkt_[0-9a-f]{48}', 'TOKEN', t)
  18. t = re.sub(r'\b17\d{11}\b', 'MS', t)
  19. t = re.sub(today + r' \d\d:\d\d', 'STAMP', t)
  20. t = re.sub(r'\b0m[0-9a-z]{10}\b', lambda m: m.group(0) if m.group(0) in known else ids.setdefault(m.group(0), 'NEW%d' % len(ids)), t)
  21. return t
  22. fs = sorted(f for f in os.listdir(a) if '-w-' in f)
  23. assert fs == sorted(f for f in os.listdir(b) if '-w-' in f), 'file lists differ'
  24. ia, ib = {}, {}; bad = []
  25. for f in fs:
  26. x, y = wnorm(open(os.path.join(a, f)).read(), ia), wnorm(open(os.path.join(b, f)).read(), ib)
  27. if x != y: bad.append(f)
  28. print(f'{len(fs)} write files: {len(fs) - len(bad)} identical after masking, {len(bad)} DIFFERENT; new ids {len(ia)} / {len(ib)}')
  29. for f in bad[:20]: print(' DIFF', f)
  30. sys.exit(1 if bad else 0)

Branches

Latest commits

  • 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
  • 1d69bf7dTickets conductor: park until Hermes pushmre
  • 80d8cfd1Tickets conductor: #51 livemre
  • 61641dd9Complete subscriptions deployment evidencemre
  • c980856cRecord successful subscriptions deployment and live checksmre
  • 4b4710adMerge branch 's51-subscriptions'mre
  • a731ef7eTickets conductor: S51 reviewed, deploy stepmre
  • b487b05aRecord verified direct push protocol handoffmre
  • 74e34cc3Verify encrypted push secrets and direct push retry semanticsmre
  • a1ac5cd0Push subscription notices directly to signed HyperConductor chat endpointsmre
  • d662ad27Remove superseded waker service for direct chat push protocolmre
  • c0ac927aTickets conductor: S51 redo for push protocolmre
  • ff2e8701Finalize subscription build verification and handoff reportmre