Skip to content

Commit

Permalink
Homestore tests through basic framework. (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
szmyd authored Oct 17, 2023
1 parent 98032d3 commit 022efda
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/lib/homestore_backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,28 @@ target_link_libraries("${PROJECT_NAME}_homestore"

if(BUILD_TESTING)
add_subdirectory(tests)

add_executable (pg_homestore_test)
target_sources(pg_homestore_test PRIVATE $<TARGET_OBJECTS:pg_test>)
target_link_libraries(pg_homestore_test
homeobject_homestore
${COMMON_TEST_DEPS}
)
add_test(NAME PGHomestoreTest COMMAND pg_homestore_test -csv error)

add_executable (shard_homestore_test)
target_sources(shard_homestore_test PRIVATE $<TARGET_OBJECTS:shard_test>)
target_link_libraries(shard_homestore_test
homeobject_homestore
${COMMON_TEST_DEPS}
)
#add_test(NAME ShardHomestoreTest COMMAND shard_homestore_test -csv error)

add_executable (blob_homestore_test)
target_sources(blob_homestore_test PRIVATE $<TARGET_OBJECTS:blob_test>)
target_link_libraries(blob_homestore_test
homeobject_homestore
${COMMON_TEST_DEPS}
)
#add_test(NAME BlobHomestoreTest COMMAND blob_homestore_test -csv error)
endif()
2 changes: 1 addition & 1 deletion src/lib/homestore_backend/index_kv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ HSHomeObject::get_from_index_table(shared< BlobIndexTable > index_table, shard_i
auto status = index_table->get(get_req);
if (status != homestore::btree_status_t::success) {
LOGERROR("Failed to get from index table {}", index_key.to_string());
return folly::makeUnexpected(BlobError::INDEX_ERROR);
return folly::makeUnexpected(BlobError::UNKNOWN_BLOB);
}

return index_value.pbas();
Expand Down

0 comments on commit 022efda

Please sign in to comment.