main_test.go 398 B

12345678910111213141516171819
  1. package user
  2. import (
  3. "flag"
  4. "testing"
  5. "git.i2edu.net/i2/go-zero/core/conf"
  6. "git.i2edu.net/i2/i2-bill-api/internal/config"
  7. "git.i2edu.net/i2/i2-bill-api/internal/svc"
  8. )
  9. var configFile = flag.String("f", "etc/i2bill-api.yaml", "the config file")
  10. var c config.Config
  11. var ctx *svc.ServiceContext
  12. func TestMain(m *testing.M) {
  13. conf.MustLoad(*configFile, &c)
  14. ctx = svc.NewServiceContext(c)
  15. }