From 73cb1811e0cd95830635e4142fe357af1fa89be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ante=20Pu=C5=A1i=C4=87?= Date: Tue, 30 Jan 2024 19:35:53 +0100 Subject: [PATCH] Fix unit tests --- tests/CMakeLists.txt | 40 +++++++++++------------ tests/unit/storage_v2_decoder_encoder.cpp | 4 ++- tests/unit/storage_v2_wal_file.cpp | 8 ++++- 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e6b6197fd..02535dcc7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,29 +1,29 @@ -# # benchmark test binaries -# add_subdirectory(benchmark) +# benchmark test binaries +add_subdirectory(benchmark) -# # macro_benchmark test binaries -# add_subdirectory(macro_benchmark) +# macro_benchmark test binaries +add_subdirectory(macro_benchmark) -# # stress test binaries -# add_subdirectory(stress) +# stress test binaries +add_subdirectory(stress) -# # concurrent test binaries -# add_subdirectory(concurrent) +# concurrent test binaries +add_subdirectory(concurrent) -# # manual test binaries -# add_subdirectory(manual) +# manual test binaries +add_subdirectory(manual) -# # unit test binaries -# add_subdirectory(unit) +# unit test binaries +add_subdirectory(unit) -# # property based test binaries -# add_subdirectory(property_based) +# property based test binaries +add_subdirectory(property_based) -# # integration test binaries -# add_subdirectory(integration) +# integration test binaries +add_subdirectory(integration) -# # e2e test binaries -# add_subdirectory(e2e) +# e2e test binaries +add_subdirectory(e2e) -# # mgbench benchmark test binaries -# add_subdirectory(mgbench) +# mgbench benchmark test binaries +add_subdirectory(mgbench) diff --git a/tests/unit/storage_v2_decoder_encoder.cpp b/tests/unit/storage_v2_decoder_encoder.cpp index 9b627cb77..e39b1bb5a 100644 --- a/tests/unit/storage_v2_decoder_encoder.cpp +++ b/tests/unit/storage_v2_decoder_encoder.cpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2024 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source @@ -355,6 +355,8 @@ TEST_F(DecoderEncoderTest, PropertyValueInvalidMarker) { case memgraph::storage::durability::Marker::DELTA_LABEL_PROPERTY_INDEX_DROP: case memgraph::storage::durability::Marker::DELTA_LABEL_PROPERTY_INDEX_STATS_SET: case memgraph::storage::durability::Marker::DELTA_LABEL_PROPERTY_INDEX_STATS_CLEAR: + case memgraph::storage::durability::Marker::DELTA_TEXT_INDEX_CREATE: + case memgraph::storage::durability::Marker::DELTA_TEXT_INDEX_DROP: case memgraph::storage::durability::Marker::DELTA_EXISTENCE_CONSTRAINT_CREATE: case memgraph::storage::durability::Marker::DELTA_EXISTENCE_CONSTRAINT_DROP: case memgraph::storage::durability::Marker::DELTA_UNIQUE_CONSTRAINT_CREATE: diff --git a/tests/unit/storage_v2_wal_file.cpp b/tests/unit/storage_v2_wal_file.cpp index a67b09305..2c1aa2510 100644 --- a/tests/unit/storage_v2_wal_file.cpp +++ b/tests/unit/storage_v2_wal_file.cpp @@ -1,4 +1,4 @@ -// Copyright 2023 Memgraph Ltd. +// Copyright 2024 Memgraph Ltd. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt; by using this file, you agree to be bound by the terms of the Business Source @@ -49,6 +49,10 @@ memgraph::storage::durability::WalDeltaData::Type StorageMetadataOperationToWalD return memgraph::storage::durability::WalDeltaData::Type::LABEL_PROPERTY_INDEX_STATS_SET; case memgraph::storage::durability::StorageMetadataOperation::LABEL_PROPERTY_INDEX_STATS_CLEAR: return memgraph::storage::durability::WalDeltaData::Type::LABEL_PROPERTY_INDEX_STATS_CLEAR; + case memgraph::storage::durability::StorageMetadataOperation::TEXT_INDEX_CREATE: + return memgraph::storage::durability::WalDeltaData::Type::TEXT_INDEX_CREATE; + case memgraph::storage::durability::StorageMetadataOperation::TEXT_INDEX_DROP: + return memgraph::storage::durability::WalDeltaData::Type::TEXT_INDEX_DROP; case memgraph::storage::durability::StorageMetadataOperation::EXISTENCE_CONSTRAINT_CREATE: return memgraph::storage::durability::WalDeltaData::Type::EXISTENCE_CONSTRAINT_CREATE; case memgraph::storage::durability::StorageMetadataOperation::EXISTENCE_CONSTRAINT_DROP: @@ -267,6 +271,8 @@ class DeltaGenerator final { break; case memgraph::storage::durability::StorageMetadataOperation::LABEL_PROPERTY_INDEX_CREATE: case memgraph::storage::durability::StorageMetadataOperation::LABEL_PROPERTY_INDEX_DROP: + case memgraph::storage::durability::StorageMetadataOperation::TEXT_INDEX_CREATE: + case memgraph::storage::durability::StorageMetadataOperation::TEXT_INDEX_DROP: case memgraph::storage::durability::StorageMetadataOperation::EXISTENCE_CONSTRAINT_CREATE: case memgraph::storage::durability::StorageMetadataOperation::EXISTENCE_CONSTRAINT_DROP: data.operation_label_property.label = label;