(t *testing.T, ctx context.Context)
| 138 | } |
| 139 | |
| 140 | func NewAPIServer(t *testing.T, ctx context.Context) (*APIServer, csconfig.Config) { |
| 141 | config := LoadTestConfig(t) |
| 142 | |
| 143 | os.Remove("./ent") |
| 144 | |
| 145 | logger, _ := logtest.NewNullLogger() |
| 146 | apiServer, err := NewServer(ctx, config.API.Server, logger.WithFields(nil)) |
| 147 | require.NoError(t, err) |
| 148 | |
| 149 | log.Info("Creating new API server") |
| 150 | gin.SetMode(gin.TestMode) |
| 151 | |
| 152 | return apiServer, config |
| 153 | } |
| 154 | |
| 155 | func NewAPITest(t *testing.T, ctx context.Context) (*gin.Engine, csconfig.Config) { |
| 156 | apiServer, config := NewAPIServer(t, ctx) |
no test coverage detected
searching dependent graphs…