gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit08e5525508e55255log: HM56 done, T36A startedmre08e55255/tests/jobs-dump.hl

2.8 KB

  1. // tests/jobs-dump.hl — CHECK of mission 044 (background jobs in slices): prints, one line each, (1) every job's queue (ids), (2) the merge
  2. // prepare's stats and, with TRACKER_DUMP_MERGE=1, the stores AFTER every merge step ran, (3) the collections queue, (4) every table's
  3. // rows as JSON. Run on the SAME store copy with this tree and with the old tree (tests/jobs-dump-old.hl in the old checkout: the same
  4. // output through the former `…Queue()` / `mergePrepare()` functions), `sort` both outputs, diff: equal = same jobs, same writes.
  5. // Order differs on purpose (slices = key order, the old scans = file order), hence the sort. Run while the app is STOPPED.
  6. // TRACKER_STORAGE=<store copy> TRACKER_DUMP_MERGE=1 ./bin/hybriel tests/jobs-dump.hl | sort > out-new.txt
  7. import { env } from 'hl:proc'
  8. import { showsTable, seasonsTable, episodesTable, personsTable } from '../lib/shows.hl'
  9. import { followsTable } from '../lib/follows.hl'
  10. import { watchesTable } from '../lib/watches.hl'
  11. import { collectStep, collected } from '../lib/slices.hl'
  12. import { adultBackfillScan, adultPred, kindBackfillScan, kindPred, tvmazeStatusScan, statusPred, artScan, artPred } from '../lib/backfill.hl'
  13. import { creditsScanStart, creditsPred } from '../lib/credits.hl'
  14. import { detailsRepairScan, repairClass } from '../lib/details.hl'
  15. import { mergePrepare, mergeStep, mergeStats, mergeLine, persistMerge } from '../lib/merge.hl'
  16. import { seedPrepare, seedQueue } from '../lib/collections.hl'
  17. printIds = (tag, ids) => {
  18. for (id of ids) { console.log(tag + ' ' + id) }
  19. console.log('count ' + tag + ' ' + ids.length)
  20. return true
  21. }
  22. drainScan = (c, pred) => {
  23. while (!collectStep(&c, pred)) {}
  24. return collected(&c)
  25. }
  26. printIds('adult', drainScan(adultBackfillScan(), adultPred))
  27. printIds('kind', drainScan(kindBackfillScan(), kindPred))
  28. printIds('status', drainScan(tvmazeStatusScan(), statusPred))
  29. printIds('art', drainScan(artScan(), artPred))
  30. printIds('credits', drainScan(creditsScanStart(), creditsPred))
  31. rq = drainScan(detailsRepairScan(), repairClass)
  32. printIds('repair', rq)
  33. // the repair queue is "the reduced ones first, then the rest": print the position class too
  34. while (!mergePrepare()) {}
  35. st = mergeStats()
  36. console.log('mergeprep groups=' + st.groups + ' records=' + st.records + ' strayTitles=' + st.strayTitles + ' doubleSeasons=' + st.doubleSeasons)
  37. while (!seedPrepare()) {}
  38. printIds('seed', seedQueue)
  39. if (env('TRACKER_DUMP_MERGE') == '1') {
  40. let guard = 0
  41. while (guard < 100000) { r = mergeStep() if (r.done) { break } guard = guard + 1 }
  42. persistMerge()
  43. console.log('merge ' + mergeLine())
  44. }
  45. dumpTable = (tag, table) => {
  46. for (r of table.find(null, null)) { console.log('row ' + tag + ' ' + JSON.stringify(r)) }
  47. return true
  48. }
  49. dumpTable('shows', showsTable)
  50. dumpTable('seasons', seasonsTable)
  51. dumpTable('episodes', episodesTable)
  52. dumpTable('persons', personsTable)
  53. dumpTable('follows', followsTable)
  54. dumpTable('watches', watchesTable)

Branches

Latest commits

  • 08e55255log: HM56 done, T36A startedmre
  • 5fd2ac75status: #36 GOmre
  • 0d253b45mission: T36Amre
  • 2aa22d23log: #36 GOmre
  • 833aee2flog: #50 closed, HM56 startedmre
  • ac58c1e5mission: HM56mre
  • 58979c0clog: HM54 held for decision, DP65 startedmre
  • bb2ebc67log: #64 live, #53 mergedmre
  • 27cde42fMerge hm53-dom: tracker#53 inputs bound to membersmre
  • 2156cc7flog: HM54 reviewmre
  • 9fb82efclog: HM54 gap, fill continuesmre
  • b632eb8dlog: HM53 done, HM54 startedmre
  • ccb1a263tracker#53: bind editor drafts and use key event focus targetmre
  • 3356fcfclog: #52 blocked, HM53 startedmre
  • 833dcfc9Merge hm52-search: report only, tracker#52 blocked by framework gapmre
  • 73010cc0HM52: report replace-navigation search draft regressionmre
  • 1742e92bstatus: DP64 and HM52 runningmre
  • 29ad5b58log: #64 merged, DP64 and HM52 startedmre
  • fafddbf9Merge hm64-catalog: tracker#64 catalog from packed entriesmre
  • b2e2206dlog: #63 livemre