Skip to content

Commit 98bc556

Browse files
fix after review
1 parent 3108bec commit 98bc556

File tree

5 files changed

+19
-23
lines changed

5 files changed

+19
-23
lines changed

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PR-check
1+
name: Tests
22

33
on:
44
push:

CMakePresets.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
"timeout": 1200
6262
},
6363
"environment": {
64-
"ENDPOINT": "localhost:2136",
65-
"DATABASE": "/local"
64+
"YDB_ENDPOINT": "localhost:2136",
65+
"YDB_DATABASE": "/local"
6666
}
6767
},
6868
{

tests/integration/basic_example_it/basic_example.cpp

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@ static std::string JoinPath(const std::string& basePath, const std::string& path
2525
return prefixPathSplit;
2626
}
2727

28+
RunArgs GetRunArgs() {
29+
30+
std::string database = std::getenv("YDB_DATABASE");
31+
std::string endpoint = std::getenv("YDB_ENDPOINT");
32+
33+
auto driverConfig = TDriverConfig()
34+
.SetEndpoint(endpoint)
35+
.SetDatabase(database)
36+
.SetAuthToken(std::getenv("YDB_TOKEN") ? std::getenv("YDB_TOKEN") : "");
37+
38+
TDriver driver(driverConfig);
39+
return {driver, JoinPath(database, "basic")};
40+
}
41+
2842
///////////////////////////////////////////////////////////////////////////////
2943

3044
//! Creates sample tables with CrateTable API.
@@ -242,10 +256,6 @@ static TStatus PreparedSelectTransaction(TSession session, const std::string& pa
242256
return prepareResult;
243257
}
244258

245-
if (!prepareResult.IsQueryFromCache()) {
246-
std::cerr << "+Finished preparing query: PreparedSelectTransaction" << std::endl;
247-
}
248-
249259
auto dataQuery = prepareResult.GetQuery();
250260

251261
auto params = dataQuery.GetParamsBuilder()
@@ -441,7 +451,7 @@ static TStatus ScanQuerySelect(TTableClient client, const std::string& path, std
441451
if (!streamPart.IsSuccess()) {
442452
eos = true;
443453
if (!streamPart.EOS()) {
444-
std::cerr << "ScanQuery execution failure: " << streamPart.GetIssues().ToString() << std::endl;
454+
return resultScanQuery;
445455
}
446456
continue;
447457
}

tests/integration/basic_example_it/basic_example.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ NYdb::TParams GetTablesDataParams();
2626

2727
void CreateTables(TTableClient client, const std::string& path);
2828
void ThrowOnError(const TStatus& status);
29+
RunArgs GetRunArgs();
2930
TStatus FillTableDataTransaction(TSession session, const std::string& path);
3031
std::string SelectSimple(TTableClient client, const std::string& path);
3132
void UpsertSimple(TTableClient client, const std::string& path);

tests/integration/basic_example_it/main.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "basic_example.h"
22

3-
#include <src/util/stream/file.h>
43
#include <ydb-cpp-sdk/json_value/ydb_json_value.h>
54

65
#include <cstdlib>
@@ -9,20 +8,6 @@
98

109
#include <gtest/gtest.h>
1110

12-
RunArgs GetRunArgs() {
13-
14-
std::string database = std::getenv("YDB_DATABASE");
15-
std::string endpoint = std::getenv("YDB_ENDPOINT");
16-
17-
auto driverConfig = TDriverConfig()
18-
.SetEndpoint(endpoint)
19-
.SetDatabase(database)
20-
.SetAuthToken(std::getenv("YDB_TOKEN") ? std::getenv("YDB_TOKEN") : "");
21-
22-
TDriver driver(driverConfig);
23-
return {driver, database};
24-
}
25-
2611
TEST(Integration, BasicExample) {
2712

2813
auto [driver, path] = GetRunArgs();

0 commit comments

Comments
 (0)