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
- aa4e192cTickets conductor: brief 027 push protocol changemre
- c5d28fb5Tickets conductor: S51 startedmre
- fd6ca1e6Tickets conductor: brief 027 waker design, push-test projectmre
- e448e656Tickets conductor: STATUS #51mre
- 1c10857bTickets conductor: P51 eval, brief 027mre
- e725969dTickets conductor: #51 directionmre
- 1b5c63ddTickets conductor: P51 startedmre
- 9f13fbdaTickets conductor: brief 026 prioritymre
- acc477d9Tickets conductor: brief 026 + Vinzenz recommendationsmre
- 9233a734Tickets conductor: brief 026 completemre
- 5da589fdTickets conductor: brief 026 + Gitoria's answermre
- a3cd5329Tickets conductor: tickets#51 opened, brief 026 draftmre
- 6f6e5797Tickets conductor: STATUS wordingmre
- 957de51fTickets conductor: T36 live, #36 review, #50 donemre
- bc2fde32Merge branch 'main' into t36-stylemre
- b7ca093atests: wait for the new row and normalize editor marker spacesmre
- 41da3525Tickets conductor: flake cause, T36 deploy stepmre
- 64c477e6Tickets conductor: deploy waits for Arachnemre
- 467d7286Tickets conductor: T36 done, deploy questionmre
- fed5ca81ticket_list: remove repeated selected-state coloursmre