tickets
All repositories: gitoria
1.6 KB
#!/usr/bin/env python3# tests/realdata-compare-writes.py (mission 010): compare the WRITE part ('w-' files) of two realdata-baseline.mjs# runs. Besides realdata-compare.py's masks it masks# what a write makes new each run: mpackdb ids that the read part of the run never showed, epoch ms of today, Vienna# stamps "YYYY-MM-DD HH:MM" of today, the API token. Each new id is numbered in order of appearance, so the SAME# record must stand at the same places in both runs.import os, re, sys, timea, b = sys.argv[1], sys.argv[2]src = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'realdata-compare.py')).read()exec(src[src.index('masks = '):src.index('fa, fb')])known = set()for f in os.listdir(a):if '-w-' not in f: known |= set(re.findall(r'\b0m[0-9a-z]{10}\b', open(os.path.join(a, f)).read()))today = time.strftime('%Y-%m-%d')def wnorm(t, ids):t = norm(t)t = re.sub(r'tkt_[0-9a-f]{48}', 'TOKEN', t)t = re.sub(r'\b17\d{11}\b', 'MS', t)t = re.sub(today + r' \d\d:\d\d', 'STAMP', t)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)return tfs = sorted(f for f in os.listdir(a) if '-w-' in f)assert fs == sorted(f for f in os.listdir(b) if '-w-' in f), 'file lists differ'ia, ib = {}, {}; bad = []for f in fs:x, y = wnorm(open(os.path.join(a, f)).read(), ia), wnorm(open(os.path.join(b, f)).read(), ib)if x != y: bad.append(f)print(f'{len(fs)} write files: {len(fs) - len(bad)} identical after masking, {len(bad)} DIFFERENT; new ids {len(ia)} / {len(ib)}')for f in bad[:20]: print(' DIFF', f)sys.exit(1 if bad else 0)
Branches
Latest commits
- 7c8e6d83Limit edited state note fix to Markdown renderingmre
- 36984386Preserve state transitions when their notes are editedmre
- d75cb946Log E30 startmre
- 0bf3fefaMission 030: edited state note labelmre
- 691565c6Log neutral-ticket rule checkmre
- 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