Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- name: install
uses: ./.github/workflows/reusable/cached-install
# The C++<->TS interop test (streamr-dht-test-ts-interop) runs the
# pinned @streamr/dht npm package in a child node process and needs a
# node runtime >= 20 on PATH.
- name: setup node for TS interop tests
uses: actions/setup-node@v4
with:
node-version: 22
- name: check proto sync with pinned TS reference
run:
./check-proto-sync.sh
Expand Down
25 changes: 25 additions & 0 deletions packages/streamr-dht/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,35 @@ if(NOT IOS AND STREAMR_MODULES_SUPPORTED)
PUBLIC GTest::gtest
PUBLIC streamr-dht-test-main
)
# C++<->TS interop: the C++ node joins a DHT whose entry point is the
# pinned TypeScript implementation from npm, run in a child node
# process (test/ts-interop/entryPoint.js). Skips when no node runtime
# >= 20 is available.
add_executable(streamr-dht-test-ts-interop
test/ts-interop/TsInteropTest.cpp
)
target_compile_definitions(streamr-dht-test-ts-interop
PRIVATE TS_INTEROP_HARNESS_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test/ts-interop"
)
target_include_directories(streamr-dht-test-ts-interop
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/test/utils>
)
streamr_enable_imports(streamr-dht-test-ts-interop)
target_link_libraries(streamr-dht-test-ts-interop
PUBLIC streamr-dht
PUBLIC streamr-dht-test-utils
PUBLIC streamr::streamr-logger
PUBLIC streamr::streamr-eventemitter
PUBLIC streamr::streamr-utils
PUBLIC streamr::streamr-proto-rpc
PUBLIC GTest::gtest
PUBLIC streamr-dht-test-main
)
if (NOT (${VCPKG_TARGET_TRIPLET} MATCHES "android"))
include(GoogleTest)
gtest_discover_tests(streamr-dht-test-unit)
gtest_discover_tests(streamr-dht-test-integration)
gtest_discover_tests(streamr-dht-test-end-to-end)
gtest_discover_tests(streamr-dht-test-ts-interop)
endif()
endif()
12 changes: 10 additions & 2 deletions packages/streamr-dht/lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

set -e

FILES=$(find . -type d \( -name src -o -name test -o -name include \) ! -path '*/build/*' ! -path '*/proto/*' -print0 | xargs -0 -I{} find {} -type f \( -name "*.hpp" -o -name "*.cpp" \) -print0 | xargs -0 echo)
# node_modules is excluded because the TS interop harness (test/ts-interop)
# npm-installs packages that vendor third-party C++ sources
# (node-datachannel's napi wrappers etc.) — not our code.
FILES=$(find . -type d \( -name src -o -name test -o -name include \) ! -path '*/build/*' ! -path '*/proto/*' -print0 | xargs -0 -I{} find {} -type f \( -name "*.hpp" -o -name "*.cpp" \) ! -path '*/node_modules/*' -print0 | xargs -0 echo)
# Compile database: the standalone build dir when present, else the root
# tree's (the Linux CI legs skip the standalone builds — MODERNIZATION.md
# "After the consolidation: CI speed" — and lint against the root tree,
Expand Down Expand Up @@ -98,8 +101,13 @@ echo "Running clangd-tidy on $FILES"
# exclusion in phase B3: DhtNode's BMI grew with the ConnectionManager-path
# imports and the TU now trips the branded-ServiceID false positive
# documented for MultipleEntryPointJoiningTest above.)
# TsInteropTest.cpp (phase B3, C++<->TS interop) imports the DhtNode
# aggregate like the end-to-end tests and trips the same std-type
# unification false positive (std::string-vs-std::string mismatches on its
# own std::string locals); the compiler builds and runs it, clang-format
# still checks it.
HEAVY_TIDY_FILES='./test/integration/Layer1ScaleTest.cpp ./test/integration/DhtNodeExternalApiTest.cpp ./test/integration/KademliaCorrectnessTest.cpp'
TIDY_FILES=$(echo "$FILES" | tr ' ' '\n' | grep -v 'test/integration/ConnectionLockingTest.cpp' | grep -v 'test/unit/PendingConnectionTest.cpp' | grep -v 'test/unit/SimulatorTest.cpp' | grep -v 'test/integration/SimultaneousConnectionsTest.cpp' | grep -v 'test/integration/ConnectionManagerIntegrationTest.cpp' | grep -v 'test/unit/DhtNodeRpcLocalTest.cpp' | grep -v 'test/integration/DhtNodeRpcRemoteTest.cpp' | grep -v 'test/unit/RoutingSessionTest.cpp' | grep -v 'test/unit/RecursiveOperationSessionTest.cpp' | grep -v 'test/unit/StoreRpcLocalTest.cpp' | grep -v 'test/unit/StoreManagerTest.cpp' | grep -v 'test/integration/MultipleEntryPointJoiningTest.cpp' | grep -v 'test/utils/DhtNodeTestUtils.hpp' | grep -v 'test/integration/DhtNodeTest.cpp' | grep -v 'test/integration/MockLayer1Layer0Test.cpp' | grep -v 'test/integration/Layer1ScaleTest.cpp' | grep -v 'test/integration/DhtNodeExternalApiTest.cpp' | grep -v 'test/integration/KademliaCorrectnessTest.cpp' | grep -v 'test/unit/CreatePeerDescriptorTest.cpp' | grep -v 'test/unit/ConnectivityRequestHandlerTest.cpp' | grep -v 'test/integration/WebsocketConnectionManagementTest.cpp' | grep -v 'test/unit/WebrtcConnectionTest.cpp' | grep -v 'test/unit/WebrtcConnectorTest.cpp' | grep -v 'test/integration/RpcConnectionsOverWebrtcTest.cpp' | grep -v 'test/integration/WebrtcConnectorRpcTest.cpp' | grep -v 'test/integration/WebrtcConnectionManagementTest.cpp' | grep -v 'test/end-to-end/Layer0Test.cpp' | grep -v 'test/end-to-end/Layer0WebrtcTest.cpp' | grep -v 'test/end-to-end/Layer0MixedConnectionTypesTest.cpp' | grep -v 'test/end-to-end/Layer0Layer1Test.cpp' | grep -v 'test/end-to-end/Layer0WebrtcLayer1Test.cpp' | tr '\n' ' ')
TIDY_FILES=$(echo "$FILES" | tr ' ' '\n' | grep -v 'test/integration/ConnectionLockingTest.cpp' | grep -v 'test/unit/PendingConnectionTest.cpp' | grep -v 'test/unit/SimulatorTest.cpp' | grep -v 'test/integration/SimultaneousConnectionsTest.cpp' | grep -v 'test/integration/ConnectionManagerIntegrationTest.cpp' | grep -v 'test/unit/DhtNodeRpcLocalTest.cpp' | grep -v 'test/integration/DhtNodeRpcRemoteTest.cpp' | grep -v 'test/unit/RoutingSessionTest.cpp' | grep -v 'test/unit/RecursiveOperationSessionTest.cpp' | grep -v 'test/unit/StoreRpcLocalTest.cpp' | grep -v 'test/unit/StoreManagerTest.cpp' | grep -v 'test/integration/MultipleEntryPointJoiningTest.cpp' | grep -v 'test/utils/DhtNodeTestUtils.hpp' | grep -v 'test/integration/DhtNodeTest.cpp' | grep -v 'test/integration/MockLayer1Layer0Test.cpp' | grep -v 'test/integration/Layer1ScaleTest.cpp' | grep -v 'test/integration/DhtNodeExternalApiTest.cpp' | grep -v 'test/integration/KademliaCorrectnessTest.cpp' | grep -v 'test/unit/CreatePeerDescriptorTest.cpp' | grep -v 'test/unit/ConnectivityRequestHandlerTest.cpp' | grep -v 'test/integration/WebsocketConnectionManagementTest.cpp' | grep -v 'test/unit/WebrtcConnectionTest.cpp' | grep -v 'test/unit/WebrtcConnectorTest.cpp' | grep -v 'test/integration/RpcConnectionsOverWebrtcTest.cpp' | grep -v 'test/integration/WebrtcConnectorRpcTest.cpp' | grep -v 'test/integration/WebrtcConnectionManagementTest.cpp' | grep -v 'test/end-to-end/Layer0Test.cpp' | grep -v 'test/end-to-end/Layer0WebrtcTest.cpp' | grep -v 'test/end-to-end/Layer0MixedConnectionTypesTest.cpp' | grep -v 'test/end-to-end/Layer0Layer1Test.cpp' | grep -v 'test/end-to-end/Layer0WebrtcLayer1Test.cpp' | grep -v 'test/ts-interop/TsInteropTest.cpp' | tr '\n' ' ')
# Chunked: one clangd process accumulates source-location space across the
# files it serves and never releases it; with the phase-A8 module graph a
# single process no longer survives the whole list (mid-batch the affected
Expand Down
3 changes: 3 additions & 0 deletions packages/streamr-dht/test/ts-interop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
npm-install.log
driver-stderr.log
Loading
Loading