gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commitd9fce111d9fce111browser gate #26: exact frame count incl. SL1 people step (hybriel#308)mred9fce111/tests/seed-status.hl

4.4 KB

  1. // tests/seed-status.hl — GATE FIXTURE for tracker#35 (mission 030): written by tests/browser.mjs into the gate's storage while the
  2. // app is STOPPED (one process per storage, hybriel#21). Four complete series (synced: `tmdbSync`) with TMDB's status and a TVmaze
  3. // id but no TVmaze status yet — the status backfill (backfill.hl tvmazeStatusTitle) asks the fake TVmaze for each:
  4. // Running Gate Series TMDB 'Returning Series', TVmaze 5501 'Running' → pill "Returning" (green; mission 033: episodes 10
  5. // days ago and in 10 days — outside the ±7 days —
  6. // and a SPECIAL (season 0) in 2 days: no "Airing")
  7. // Airing Gate Series TMDB 'Returning Series', TVmaze 5503 'Running' → "Airing" (an episode in 3 days)
  8. // Aired Gate Series TMDB 'Returning Series', TVmaze 5505 'Running' → "Airing" (an episode 7 days ago: the edge)
  9. // Canceled Gate Series TMDB 'Canceled', TVmaze 5502 'Ended' → pill "Canceled" (red: TVmaze has no canceled)
  10. // Gone Maze Series TMDB 'Ended', TVmaze 5504 → 404 → `tvmazeStatusCheck`, pill "Ended" (muted)
  11. // Pending Gate Series TMDB 'In Production', no TVmaze id → never asked, pill "In Production" (yellow)
  12. // Variety Gate Series TMDB type 'Scripted' (a series), TVmaze 5506 'Running', type 'Variety' → #43 (mission 037): a SHOW
  13. // once TVmaze's type is stored — moves from /series to /shows (like Saturday Night Live UK)
  14. import { MPackDB } from 'hl:mpackdb'
  15. import { env } from 'hl:proc'
  16. import { now, timestamp } from 'hl:time'
  17. storageDir = env('TRACKER_STORAGE')
  18. if (storageDir == null || !storageDir.startsWith('/')) { hlError('set TRACKER_STORAGE, absolute') }
  19. showsTable = new MPackDB(file = storageDir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])
  20. seasonsTable = new MPackDB(file = storageDir + '/seasons.db', primaryKey = '@id', indexes = ['!oldId'])
  21. episodesTable = new MPackDB(file = storageDir + '/episodes.db', primaryKey = '@id', indexes = ['!oldId'])
  22. day = (n) => { return timestamp(now() + n * 86400000).slice(0, 10) }
  23. // a season with an episode per date (mission 033: Returning vs Airing); returns its id
  24. season = (showId, no, dates) => {
  25. sid = showId + 's' + no
  26. eps = []
  27. let k = 0
  28. while (k < dates.length) {
  29. let eid = sid + 'e' + k
  30. episodesTable.put({ id = eid episodeNumber = k + 1 seasonNumber = no title = 'Episode ' + (k + 1) summary = null release = dates[k] show = showId season = sid oldId = eid })
  31. eps.push(eid)
  32. k = k + 1
  33. }
  34. seasonsTable.put({ id = sid seasonNumber = no title = null release = null summary = null show = showId episodes = eps oldId = sid })
  35. return sid
  36. }
  37. series = (id, tmdbId, name, slug, status, tvmzId) => {
  38. return { adult = false id = id title = name summary = 'A #35 fixture.' tmdbSummary = null tmdbId = tmdbId
  39. language = 'en' type = 'series' kind = 'series' release = '2015-01-01' year = 2015 image = null urlSegment = slug
  40. episodesCount = 0 homepage = null imdbId = null seasonsCount = 0 status = status tagline = null
  41. tvdbId = null tvmzId = tvmzId genres = [] cast = [] seasons = [] oldId = 'st-' + tmdbId creditsAt = 1 detailsAt = 1 tmdbSync = 1 }
  42. }
  43. r1 = series('st00000000000sr1', 1501, 'Running Gate Series', 'running-gate-series', 'Returning Series', 5501)
  44. r1.seasons = [season(r1.id, 1, [day(-10), day(10)]), season(r1.id, 0, [day(2)])]
  45. showsTable.put(r1)
  46. a1 = series('st00000000000sr5', 1505, 'Airing Gate Series', 'airing-gate-series', 'Returning Series', 5503)
  47. a1.seasons = [season(a1.id, 1, [day(-30), day(3)])]
  48. showsTable.put(a1)
  49. a2 = series('st00000000000sr6', 1506, 'Aired Gate Series', 'aired-gate-series', 'Returning Series', 5505)
  50. a2.seasons = [season(a2.id, 1, [day(-7)])]
  51. showsTable.put(a2)
  52. showsTable.put(series('st00000000000sr2', 1502, 'Canceled Gate Series', 'canceled-gate-series', 'Canceled', 5502))
  53. showsTable.put(series('st00000000000sr4', 1504, 'Gone Maze Series', 'gone-maze-series', 'Ended', 5504))
  54. showsTable.put(series('st00000000000sr3', 1503, 'Pending Gate Series', 'pending-gate-series', 'In Production', null))
  55. v1 = series('st00000000000sr7', 1507, 'Variety Gate Series', 'variety-gate-series', 'Returning Series', 5506)
  56. v1.tmdbType = 'Scripted'
  57. showsTable.put(v1)
  58. seasonsTable.persist()
  59. episodesTable.persist()
  60. showsTable.persist()
  61. console.log('seed status: 7 series (TVmaze 5501, 5502, 5503, 5504, 5505, none, 5506)')

Branches

Latest commits

  • d9fce111browser gate #26: exact frame count incl. SL1 people step (hybriel#308)mre
  • 50249b0bRV39: reportmre
  • 10ed9581compose: HL_GC_STATS=1mre
  • 955da19bRV39: re-vendor Hybriel set day39 (source 51e921d7, bin 6b481aa7)mre
  • 64b8d1dclog: RV39 startedmre
  • 1f2df72amission RV39mre
  • 6c1936f9log+status: GC planmre
  • 2846a840log: m569 result, GC hypothesismre
  • b24cd2d5log: Anton on hl:fetch, mission 569mre
  • 7d42cac1log+status: SL1 measured, fetch stalls remainmre
  • 8e5f2ceflog: SL1 deployedmre
  • 29f34212log: SL1 deploy startedmre
  • 529dd741Merge sl1-slices: slice details repair and person fill (SL1)mre
  • 8a83316blog: SL1 result, session drain slowermre
  • 35e93e8dSL1: slice the details repair and person fill: catalog lists changed in place, 40 ms fill steps, people created in steps, writes one table per tickmre
  • 72c9119flog+status: SL1 startedmre
  • d74620fcmission SL1: slice repair and person fillmre
  • 5d542d73log+status: ST1 resultmre
  • 3945eb81ST1: stall diagnosis reportmre
  • 404733aclog: ST1 startedmre