Skip to content

Commit

Permalink
move test TShardReader to a common place (ydb-platform#7441)
Browse files Browse the repository at this point in the history
  • Loading branch information
zverevgeny committed Sep 14, 2024
1 parent a2e2db4 commit 3f8cee0
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 61 deletions.
4 changes: 0 additions & 4 deletions ydb/core/tx/columnshard/common/tests/shard_reader.cpp

This file was deleted.

14 changes: 0 additions & 14 deletions ydb/core/tx/columnshard/common/tests/ya.make

This file was deleted.

4 changes: 2 additions & 2 deletions ydb/core/tx/columnshard/test_helper/columnshard_ut_common.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "columnshard_ut_common.h"
#include "shard_reader.h"

#include <ydb/core/tx/columnshard/common/tests/shard_reader.h>
#include <ydb/core/tx/columnshard/hooks/testing/controller.h>
#include <ydb/core/tx/columnshard/engines/reader/sys_view/portions/portions.h>
#include <ydb/core/tx/columnshard/engines/storage/indexes/max/meta.h>
Expand Down Expand Up @@ -522,7 +522,7 @@ namespace NKikimr::NColumnShard {
fields.emplace_back(f.GetName());
}

NOlap::NTests::TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, snapshot);
NTxUT::TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, snapshot);
reader.SetReplyColumns(fields);
auto rb = reader.ReadAll();
UNIT_ASSERT(reader.IsCorrectlyFinished());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <contrib/libs/apache/arrow/cpp/src/arrow/record_batch.h>
#include <optional>

namespace NKikimr::NOlap::NTests {
namespace NKikimr::NTxUT {

class TShardReader {
private:
Expand Down Expand Up @@ -267,4 +267,4 @@ class TShardReader {
}
};

}
} //namespace NKikimr::NTxUT
1 change: 1 addition & 0 deletions ydb/core/tx/columnshard/test_helper/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ LIBRARY()

PEERDIR(
ydb/core/protos
ydb/core/formats/arrow
contrib/libs/apache/arrow
ydb/library/actors/core
ydb/core/tx/columnshard/blobs_action/bs
Expand Down
58 changes: 29 additions & 29 deletions ydb/core/tx/columnshard/ut_rw/ut_columnshard_read_write.cpp

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions ydb/core/tx/columnshard/ut_rw/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ PEERDIR(
ydb/core/tx/columnshard/test_helper
ydb/core/tx/columnshard/hooks/abstract
ydb/core/tx/columnshard/hooks/testing
ydb/core/tx/columnshard/common/tests
ydb/core/tx/columnshard/test_helper
ydb/services/metadata
ydb/core/tx
ydb/public/lib/yson_value
Expand Down
16 changes: 8 additions & 8 deletions ydb/core/tx/columnshard/ut_schema/ut_columnshard_schema.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <ydb/core/cms/console/configs_dispatcher.h>
#include <ydb/core/tx/tx_proxy/proxy.h>
#include <ydb/core/tx/schemeshard/schemeshard.h>
#include <ydb/core/tx/columnshard/common/tests/shard_reader.h>
#include <ydb/core/tx/columnshard/test_helper/shard_reader.h>
#include <ydb/core/tx/columnshard/hooks/abstract/abstract.h>
#include <ydb/core/tx/columnshard/hooks/testing/controller.h>
#include <ydb/core/tx/columnshard/blobs_reader/actor.h>
Expand Down Expand Up @@ -246,7 +246,7 @@ void TestTtl(bool reboots, bool internal, TTestSchema::TTableSpecials spec = {},

{
--planStep;
NOlap::NTests::TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep, Max<ui64>()));
TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep, Max<ui64>()));
reader.SetReplyColumns({spec.TtlColumn});
auto rb = reader.ReadAll();
UNIT_ASSERT(reader.IsCorrectlyFinished());
Expand Down Expand Up @@ -278,7 +278,7 @@ void TestTtl(bool reboots, bool internal, TTestSchema::TTableSpecials spec = {},

{
--planStep;
NOlap::NTests::TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep, Max<ui64>()));
TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep, Max<ui64>()));
reader.SetReplyColumns({spec.TtlColumn, NOlap::TIndexInfo::SPEC_COL_PLAN_STEP});
auto rb = reader.ReadAll();
UNIT_ASSERT(reader.IsCorrectlyFinished());
Expand Down Expand Up @@ -312,7 +312,7 @@ void TestTtl(bool reboots, bool internal, TTestSchema::TTableSpecials spec = {},

{
--planStep;
NOlap::NTests::TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep, Max<ui64>()));
TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep, Max<ui64>()));
reader.SetReplyColumns({spec.TtlColumn});
auto rb = reader.ReadAll();
UNIT_ASSERT(reader.IsCorrectlyFinished());
Expand Down Expand Up @@ -621,9 +621,9 @@ std::vector<std::pair<ui32, ui64>> TestTiers(bool reboots, const std::vector<TSt

// Read crossed with eviction (start)
{
std::unique_ptr<NOlap::NTests::TShardReader> reader;
std::unique_ptr<TShardReader> reader;
if (!misconfig) {
reader = std::make_unique<NOlap::NTests::TShardReader>(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep - 1, Max<ui64>()));
reader = std::make_unique<TShardReader>(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep - 1, Max<ui64>()));
reader->SetReplyColumns({specs[i].TtlColumn});
counter.CaptureReadEvents = specs[i].WaitEmptyAfter ? 0 : 1; // TODO: we need affected by tiering blob here
counter.WaitReadsCaptured(runtime);
Expand Down Expand Up @@ -662,7 +662,7 @@ std::vector<std::pair<ui32, ui64>> TestTiers(bool reboots, const std::vector<TSt
// Read data after eviction
TString columnToRead = specs[i].TtlColumn;

NOlap::NTests::TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep - 1, Max<ui64>()));
TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep - 1, Max<ui64>()));
reader.SetReplyColumns({columnToRead});
auto rb = reader.ReadAll();
if (expectedReadResult == EExpectedResult::ERROR) {
Expand Down Expand Up @@ -981,7 +981,7 @@ void TestDrop(bool reboots) {
TAutoPtr<IEventHandle> handle;
{
--planStep;
NOlap::NTests::TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep, Max<ui64>()));
TShardReader reader(runtime, TTestTxConfig::TxTablet0, tableId, NOlap::TSnapshot(planStep, Max<ui64>()));
reader.SetReplyColumns({TTestSchema::DefaultTtlColumn});
auto rb = reader.ReadAll();
UNIT_ASSERT(reader.IsCorrectlyFinished());
Expand Down

0 comments on commit 3f8cee0

Please sign in to comment.