gitoria

tracker

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit4043945640439456Merge hm63-searchtext: tracker#63 packed search textmre40439456/tests/person-index.hl

1.8 KB

  1. // tracker#62: native lookups preserve map winners and creation conflict suffixes.
  2. import { personsTable, showsTable } from '../lib/shows.hl'
  3. import { personBySlug, personIdByTmdb, castPersonId, guestPersonId } from '../lib/people.hl'
  4. static check = (Boolean ok, String message) => { if (!ok) { hlError(message) } }
  5. static run = () => {
  6. for (p of [
  7. { id = 'index-first' oldId = 'index-first' name = 'Same Name' urlSegment = 'Same-Name' tmdbId = 87650001 }
  8. { id = 'index-last' oldId = 'index-last' name = 'Same Name' urlSegment = 'Same-Name' tmdbId = 87650001 }
  9. { id = 'index-suffix' oldId = 'index-suffix' name = 'Same Name' urlSegment = 'Same-Name-2' tmdbId = 87650002 }
  10. ]) { check(personsTable.put(p) != null, 'seed') }
  11. check(personBySlug('Same-Name').id == 'index-last', 'last slug winner')
  12. check(personIdByTmdb(87650001) == 'index-last', 'last TMDB winner')
  13. check(personIdByTmdb('87650001') == 'index-last', 'TMDB string coercion')
  14. check(personBySlug('missing') == null && personBySlug('') == null && personBySlug(null) == null, 'absent slug')
  15. check(personIdByTmdb(87659999) == null, 'absent TMDB')
  16. c = { tmdbId = 87650003 name = 'Same Name' character = 'Role' }
  17. id = castPersonId(&c, null)
  18. check(id != null && personBySlug('Same-Name-3').id == id, 'conflict suffix')
  19. check(castPersonId(&c, null) == id, 'repeat cast import')
  20. check(guestPersonId(87650003, null).created == false, 'known guest')
  21. s = { id = 'index-show' oldId = 'index-show' cast = [{ tmdbId = 87650004 actor = 'Same Name' character = 'Guest' }] }
  22. check(showsTable.put(s) != null, 'guest show')
  23. g = guestPersonId(87650004, 'index-show')
  24. check(g.created && personBySlug('Same-Name-4').id == g.id, 'new guest')
  25. check(guestPersonId(87650004, 'index-show').created == false, 'guest revisit')
  26. check(personIdByTmdb(87650004) == g.id, 'new guest TMDB lookup')
  27. personsTable.persist()
  28. console.log('person-index: passed')
  29. return true
  30. }
  31. run()

Branches

Latest commits

  • 40439456Merge hm63-searchtext: tracker#63 packed search textmre
  • b7e6b48ePack normalized search text behind numeric offsetsmre
  • b35f53e1log: DP62 stale runtime decisionmre
  • f9593602log: Apollo deploy rule correctionmre
  • 3c95f7f3log: DP62 and HM63 startedmre
  • 9c4397c9mission HM63mre
  • 8dfe42c8mission DP62mre
  • e347fef4Merge rv44: tracker#61 #62 on Hybriel day44mre
  • 8274bcf1log: RV44 done, deploy held for the usage windowmre
  • 1ef7a3b1RV44: report day44 gates and migration/restart proofsmre
  • a5f62f6cRV44: re-vendor Hybriel set day44 (source 222edef7, bin 4f0f263e)mre
  • 6159a248Merge branch 'hm62-personindex' into rv44mre
  • a8923d93log: RV44 startedmre
  • cf28cf77mission RV44mre
  • 585782dfLog: tracker#60 Chrome look, STATUS rewrittenmre
  • 147d0172conductor: caramboleyo is the user, not owner/creatorApollo
  • 21dd0cfblog: #60 live measurement, reviewmre
  • 7793cf94HM62b report: person indexes with fixed mpackdbmre
  • b4c8d3a9Document tracker#62 fixed-index migration and GC proofmre
  • 09d66ed5status: #60 livemre