File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 6
6
#include " types/FloatTest.hpp"
7
7
#include " types/InterpretationTest.hpp"
8
8
9
+
10
+ #include " oatpp-postgresql/orm.hpp"
9
11
#include " oatpp/core/base/Environment.hpp"
10
12
13
+ #include < thread>
14
+ #include < chrono>
15
+
11
16
namespace {
12
17
13
18
void runTests () {
14
19
20
+ OATPP_LOGI (" Tests" , " DB-URL='%s'" , TEST_DB_URL);
21
+ auto connectionProvider = std::make_shared<oatpp::postgresql::ConnectionProvider>(TEST_DB_URL);
22
+ for (v_int32 i = 0 ; i < 6 ; i ++) {
23
+ try {
24
+ auto connection = connectionProvider->get ();
25
+ if (connection) {
26
+ OATPP_LOGD (" Tests" , " Database is up! We've got a connection!" );
27
+ break ;
28
+ }
29
+ } catch (...) {
30
+ // DO NOTHING
31
+ }
32
+
33
+ OATPP_LOGD (" Tests" , " Database is not ready. Sleep 10s..." );
34
+ std::this_thread::sleep_for (std::chrono::seconds (10 ));
35
+ }
36
+
15
37
OATPP_RUN_TEST (oatpp::test::postgresql::ql_template::ParserTest);
16
38
17
39
OATPP_RUN_TEST (oatpp::test::postgresql::types::IntTest);
You can’t perform that action at this time.
0 commit comments