Skip to content

Commit

Permalink
environment variable YDB_TOKEN in ydb-cli tests (#7781)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alek5andr-Kotov authored Aug 14, 2024
1 parent ac2e53a commit 215cfaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 2 additions & 0 deletions ydb/apps/ydb/ut/run_ydb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ TString GetYdbDatabase()

TString RunYdb(const TList<TString>& args1, const TList<TString>& args2, bool checkExitCode)
{
SetEnv("YDB_TOKEN", "root@builin");

TShellCommand command(BinaryPath(GetEnv("YDB_CLI_BINARY")));

command << "-e" << ("grpc://" + GetYdbEndpoint());
Expand Down
14 changes: 1 addition & 13 deletions ydb/apps/ydb/ut/workload-transfer-topic-to-table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ TString ExecYdb(const TList<TString>& args, bool checkExitCode = true)
//
// ydb -e grpc://${YDB_ENDPOINT} -d /${YDB_DATABASE} workload transfer topic-to-table ${args}
//
return RunYdb({"--user", "root", "--no-password", "workload", "transfer", "topic-to-table"}, args,
return RunYdb({"workload", "transfer", "topic-to-table"}, args,
checkExitCode);
}

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

Y_UNIT_TEST(Default_Run)
{
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());

ExecYdb({"init"});
auto output = ExecYdb({"run", "-s", "10"});
ExecYdb({"clean"});
Expand All @@ -110,8 +108,6 @@ Y_UNIT_TEST(Default_Run)

Y_UNIT_TEST(Default_Init_Clean)
{
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());

const TString topic = "transfer-topic";
const TString table = "transfer-table";

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

Y_UNIT_TEST(Specific_Init_Clean)
{
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());

const TString topic = "my-topic";
const TString table = "my-table";

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

Y_UNIT_TEST(Clean_Without_Init)
{
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());

UNIT_ASSERT_EXCEPTION(ExecYdb({"clean"}), yexception);
}

Y_UNIT_TEST(Double_Init)
{
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());

ExecYdb({"init"});
UNIT_ASSERT_EXCEPTION(ExecYdb({"init"}), yexception);
ExecYdb({"clean"});
Expand All @@ -172,8 +162,6 @@ void EnsureStatisticsColumns(const TList<TString>& args,

Y_UNIT_TEST(Statistics)
{
RunYdb({"-v", "yql", "-s", R"(ALTER USER root PASSWORD "")"}, TList<TString>());

EnsureStatisticsColumns({"run", "-s", "1", "--warmup", "0"},
{"Window", "Write speed", "Write time", "Inflight", "Read speed", "Topic time", "Select time", "Upsert time", "Commit time"},
{"#", "msg/s", "MB/s", "percentile,ms", "percentile,msg", "msg/s", "MB/s", "percentile,ms", "percentile,ms", "percentile,ms", "percentile,ms"});
Expand Down

0 comments on commit 215cfaa

Please sign in to comment.