8000 [PREGEL] Provide test binary for Pregel (#17922) · arangodb/arangodb@809183f · GitHub
[go: up one dir, main page]

Skip to content

Commit 809183f

Browse files
authored
[PREGEL] Provide test binary for Pregel (#17922)
* Provide test binary for Pregel * Make it actually work * Leave a note to future us to remove a hack * Make linkage of libraries private * Add necessary include * Clang-format
1 parent ff70811 commit 809183f

File tree

8 files changed

+51
-8
lines changed

8 files changed

+51
-8
lines changed

arangod/Pregel/CommonFormats.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
#include "Pregel/MessageFormat.h"
3535
#include "Pregel/VertexComputation.h"
3636

37+
#include "Inspection/VPack.h"
38+
3739
namespace arangodb::pregel {
3840

3941
// Speaker-listerner Label propagation

arangod/Pregel/ExecutionNumber.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
////////////////////////////////////////////////////////////////////////////////
2323

2424
#pragma once
25-
#include <Inspection/VPack.h>
25+
#include <Inspection/VPackWithErrorT.h>
2626

2727
#include <ostream>
2828
#include <fmt/core.h>

arangod/Pregel/Status/ConductorStatus.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@
2828
#include <numeric>
2929
#include <string>
3030

31-
#include <Inspection/VPack.h>
31+
#include <Inspection/VPackWithErrorT.h>
3232
#include <Inspection/Transformers.h>
3333

34-
#include <Cluster/ClusterTypes.h>
35-
3634
#include <Pregel/Common.h>
3735
#include <Pregel/Status/Status.h>
3836

37+
// TODO: This is a hack to not have to include ClusterTypes.h
38+
// which in turn pulls in Result.h which requires building
39+
// of voc-errors.
40+
// First step: split ClusterTypes.h into sensible bits
41+
// Second step: only include the type aliases here
42+
namespace arangodb {
43+
typedef std::string ServerID; // ID of a server
44+
}
45+
3946
namespace arangodb::pregel {
4047

4148
struct AccumulatedConductorStatus {

arangod/Pregel/Status/ExecutionStatus.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#include <string>
2626
#include <chrono>
2727

28-
#include <Inspection/VPack.h>
28+
#include <Inspection/VPackWithErrorT.h>
29+
#include <CrashHandler/CrashHandler.h>
30+
#include <Assertions/ProdAssert.h>
2931

3032
namespace arangodb::pregel {
3133

arangod/Pregel/Status/Status.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <optional>
3030
#include <string>
3131

32-
#include <Inspection/VPack.h>
32+
#include <Inspection/VPackWithErrorT.h>
3333
#include <Inspection/Transformers.h>
3434

3535
#include <Pregel/Common.h>

lib/Assertions/ProdAssert.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939

4040
#include "AssertionConditionalLogger.h"
4141

42+
#include "Basics/system-compiler.h"
43+
4244
// Always evaluates expr, even if the assertion does not fail
4345
#define ADB_PROD_ASSERT(expr) /*GCOVR_EXCL_LINE*/ \
4446
::arangodb::debug::AssertionConditionalLogger{ \

tests/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ add_subdirectory(Zkd)
1818
add_subdirectory(Graph)
1919
add_subdirectory(Replication2)
2020
add_subdirectory(Futures)
21+
add_subdirectory(Pregel)
2122

2223
# ----------------------------------------
2324
# Link directories
@@ -233,9 +234,7 @@ set(ARANGODB_TESTS_SOURCES
233234
Network/ConnectionPoolTest.cpp
234235
Network/MethodsTest.cpp
235236
Network/UtilsTest.cpp
236-
Pregel/DurationTest.cpp
237237
Pregel/typedbuffer.cpp
238-
Pregel/StatusTest.cpp
239238
ProgramOptions/InifileParserTest.cpp
240239
ProgramOptions/ParametersTest.cpp
241240
Replication/ReplicationClientsProgressTrackerTest.cpp
@@ -312,6 +311,7 @@ target_link_libraries(arangodbtests
312311
arango_tests_graph
313312
arango_tests_futures
314313
arango_tests_zkd
314+
arango_tests_pregel
315315
arango_agency
316316
arango_cluster_engine
317317
arango_rocksdb

tests/Pregel/CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# note that typedbuffer.cpp is excluded intentionally
2+
# since it seems to have a big dependency footprint;
3+
# we intent to remove the TypedBuffer construct soon
4+
add_library(arango_tests_pregel OBJECT
5+
DurationTest.cpp
6+
StatusTest.cpp)
7+
8+
target_include_directories(arango_tests_pregel
9+
PRIVATE
10+
${PROJECT_SOURCE_DIR}/arangod
11+
${PROJECT_SOURCE_DIR}/lib)
12+
13+
target_link_libraries(arango_tests_pregel
14+
PRIVATE
15+
gtest
16+
date_interface
17+
velocypack
18+
fmt)
19+
20+
add_executable(arangodbtests_pregel
21+
EXCLUDE_FROM_ALL)
22+
23+
target_link_libraries(arangodbtests_pregel
24+
gtest_main
25+
arango_tests_pregel
26+
arango_crashhandler_light
27+
arango_assertions)
28+
29+
add_test(NAME pregel
30+
COMMAND arangodbtests_pregel)

0 commit comments

Comments
 (0)
0