()
| 1380 | } |
| 1381 | |
| 1382 | func init() { |
| 1383 | ctx = context.Background() |
| 1384 | logs.Init(os.Stderr, "stdFlags") |
| 1385 | adp = backend.GetTestAdapter() |
| 1386 | conffile := flag.String("config", "./test.conf", "config of the database connection") |
| 1387 | |
| 1388 | if file, err := os.Open(*conffile); err != nil { |
| 1389 | log.Fatal("Failed to read config file:", err) |
| 1390 | } else if err = json.NewDecoder(jcr.New(file)).Decode(&config); err != nil { |
| 1391 | log.Fatal("Failed to parse config file:", err) |
| 1392 | } |
| 1393 | |
| 1394 | if adp == nil { |
| 1395 | log.Fatal("Database adapter is missing") |
| 1396 | } |
| 1397 | if adp.IsOpen() { |
| 1398 | log.Print("Connection is already opened") |
| 1399 | } |
| 1400 | |
| 1401 | err := adp.Open(config.Adapters[adp.GetName()]) |
| 1402 | if err != nil { |
| 1403 | log.Fatal(err) |
| 1404 | } |
| 1405 | |
| 1406 | db = adp.GetTestDB().(*pgxpool.Pool) |
| 1407 | testData = test_data.InitTestData() |
| 1408 | if testData == nil { |
| 1409 | log.Fatal("Failed to initialize test data") |
| 1410 | } |
| 1411 | store.SetTestUidGenerator(*testData.UGen) |
| 1412 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…