dao_test.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package dao
  2. import (
  3. "flag"
  4. "os"
  5. "testing"
  6. "go-common/app/service/main/thumbup/conf"
  7. )
  8. var d *Dao
  9. func TestMain(m *testing.M) {
  10. if os.Getenv("DEPLOY_ENV") != "" {
  11. flag.Set("app_id", "main.web-svr.thumbup-service")
  12. flag.Set("conf_token", "VhnSEtd0oymsNQaDUYuEknoWu2mVOOVK")
  13. flag.Set("tree_id", "7720")
  14. flag.Set("conf_version", "docker-1")
  15. flag.Set("deploy_env", "uat")
  16. flag.Set("conf_host", "config.bilibili.co")
  17. flag.Set("conf_path", "/tmp")
  18. flag.Set("region", "sh")
  19. flag.Set("zone", "sh001")
  20. } else {
  21. flag.Set("conf", "../cmd/thumbup-test.toml")
  22. }
  23. flag.Parse()
  24. if err := conf.Init(); err != nil {
  25. panic(err)
  26. }
  27. d = New(conf.Conf)
  28. m.Run()
  29. os.Exit(0)
  30. }
  31. // INSERT INTO `bilibili_likes`.`counts_01`(`id`, `mtime`, `ctime`, `business_id`, `origin_id`, `message_id`, `likes_count`, `dislikes_count`, `likes_change`, `dislikes_change`) VALUES (98, '2018-06-13 14:51:11', '2018-06-13 14:51:11', 1, 99901, 8888, 1, 2, 3, 4);
  32. // INSERT INTO `bilibili_likes`.`counts_01`(`id`, `mtime`, `ctime`, `business_id`, `origin_id`, `message_id`, `likes_count`, `dislikes_count`, `likes_change`, `dislikes_change`) VALUES (99, '2018-06-13 14:56:56', '2018-06-13 14:56:56', 1, 101, 8888, 0, 0, 0, 0);
  33. // INSERT INTO `bilibili_likes`.`likes`(`id`, `mtime`, `ctime`, `business_id`, `origin_id`, `message_id`, `mid`, `type`) VALUES (0, '2018-11-01 18:03:28', '2018-11-01 18:03:28', 1, 1, 1, 1, 1);
  34. // INSERT INTO `bilibili_likes`.`counts`(`id`, `mtime`, `ctime`, `business_id`, `origin_id`, `message_id`, `likes_count`, `dislikes_count`, `likes_change`, `dislikes_change`, `up_mid`) VALUES (0, '2018-11-03 12:16:25', '2018-11-03 12:16:25', 1, 1, 1, 1, 1, 0, 0, 0);