Skip to content

Commit 215cfaa

Browse files
environment variable YDB_TOKEN in ydb-cli tests (#7781)
1 parent ac2e53a commit 215cfaa

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

ydb/apps/ydb/ut/run_ydb.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ TString GetYdbDatabase()
2323

2424
TString RunYdb(const TList<TString>& args1, const TList<TString>& args2, bool checkExitCode)
2525
{
26+
SetEnv("YDB_TOKEN", "root@builin");
27+
2628
TShellCommand command(BinaryPath(GetEnv("YDB_CLI_BINARY")));
2729

2830
command << "-e" << ("grpc://" + GetYdbEndpoint());

ydb/apps/ydb/ut/workload-transfer-topic-to-table.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ TString ExecYdb(const TList<TString>& args, bool checkExitCode = true)
8181
//
8282
// ydb -e grpc://${YDB_ENDPOINT} -d /${YDB_DATABASE} workload transfer topic-to-table ${args}
8383
//
84-
return RunYdb({"--user", "root", "--no-password", "workload", "transfer", "topic-to-table"}, args,
84+
return RunYdb({"workload", "transfer", "topic-to-table"}, args,
8585
checkExitCode);
8686
}
8787

@@ -96,8 +96,6 @@ void RunYdb(const TList<TString>& args,
9696

9797
Y_UNIT_TEST(Default_Run)
9898
{
99-
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());
100-
10199
ExecYdb({"init"});
102100
auto output = ExecYdb({"run", "-s", "10"});
103101
ExecYdb({"clean"});
@@ -110,8 +108,6 @@ Y_UNIT_TEST(Default_Run)
110108

111109
Y_UNIT_TEST(Default_Init_Clean)
112110
{
113-
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());
114-
115111
const TString topic = "transfer-topic";
116112
const TString table = "transfer-table";
117113

@@ -121,8 +117,6 @@ Y_UNIT_TEST(Default_Init_Clean)
121117

122118
Y_UNIT_TEST(Specific_Init_Clean)
123119
{
124-
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());
125-
126120
const TString topic = "my-topic";
127121
const TString table = "my-table";
128122

@@ -140,15 +134,11 @@ Y_UNIT_TEST(Specific_Init_Clean)
140134

141135
Y_UNIT_TEST(Clean_Without_Init)
142136
{
143-
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());
144-
145137
UNIT_ASSERT_EXCEPTION(ExecYdb({"clean"}), yexception);
146138
}
147139

148140
Y_UNIT_TEST(Double_Init)
149141
{
150-
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());
151-
152142
ExecYdb({"init"});
153143
UNIT_ASSERT_EXCEPTION(ExecYdb({"init"}), yexception);
154144
ExecYdb({"clean"});
@@ -172,8 +162,6 @@ void EnsureStatisticsColumns(const TList<TString>& args,
172162

173163
Y_UNIT_TEST(Statistics)
174164
{
175-
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());
176-
177165
EnsureStatisticsColumns({"run", "-s", "1", "--warmup", "0"},
178166
{"Window", "Write speed", "Write time", "Inflight", "Read speed", "Topic time", "Select time", "Upsert time", "Commit time"},
179167
{"#", "msg/s", "MB/s", "percentile,ms", "percentile,msg", "msg/s", "MB/s", "percentile,ms", "percentile,ms", "percentile,ms", "percentile,ms"});

0 commit comments

Comments
 (0)