Skip to content

Commit 3c83a89

Browse files
committed
test(bch): wire 4 M5 embedded-body tests into CI (#156)
embedded_getwork/seam_workview/block_broadcast/coin_node_seam were authored alongside the #156 body but never added to CMake or build.yml, so they built locally yet never ran in CI (authored-but-unrun = false-green). Add bch_embedded_getwork_test, bch_embedded_seam_workview_test, bch_embedded_block_broadcast_test, bch_coin_node_seam_test to the bch test CMakeLists and to BOTH the Linux Release and ASan/UBSan target allowlists in build.yml, mirroring the #137 NOT_BUILT lesson (test in CMake must also be in build.yml). Single-coin src/impl/bch-isolated; no impl_bch coin lib; zero p2pool-merged-v36 surface.
1 parent d9510b0 commit 3c83a89

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ jobs:
282282
bch_utxo_connect_test bch_reorg_connect_test \
283283
bch_compact_block_connector_test \
284284
bch_embedded_daemon_assembly_test \
285+
bch_embedded_getwork_test bch_embedded_seam_workview_test \
286+
bch_embedded_block_broadcast_test bch_coin_node_seam_test \
285287
-j$(nproc)
286288
287289
- name: Run BCH tests
@@ -352,6 +354,8 @@ jobs:
352354
bch_utxo_connect_test bch_reorg_connect_test \
353355
bch_compact_block_connector_test \
354356
bch_embedded_daemon_assembly_test \
357+
bch_embedded_getwork_test bch_embedded_seam_workview_test \
358+
bch_embedded_block_broadcast_test bch_coin_node_seam_test \
355359
-j$(nproc)
356360
357361
- name: Run BCH tests under sanitizers

src/impl/bch/test/CMakeLists.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,33 @@ if(BUILD_TESTING)
119119
c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage c2pool_difficulty
120120
btclibs)
121121
add_test(NAME bch_embedded_daemon_assembly_test COMMAND bch_embedded_daemon_assembly_test)
122+
123+
# M5 embedded-daemon body tests (#156): EmbeddedDaemon / EmbeddedCoinNode /
124+
# CoinNode-seam coverage that was authored alongside the body but never wired
125+
# into CMake -> it built locally yet never ran in CI (authored-but-unrun =
126+
# false-green). Same TU + link set as bch_embedded_daemon_assembly_test (each
127+
# constructs the real Node/EmbeddedCoinNode/CoinNode graph, so it needs the
128+
# out-of-line coin_node/p2p/rpc/transaction TUs). No impl_bch coin lib ->
129+
# per-coin isolation holds.
130+
set(BCH_EMBEDDED_BODY_TESTS
131+
embedded_getwork_test # EmbeddedCoinNode::getwork() contract: sync gate + GBT + ABLA at-tip/stale floor
132+
embedded_seam_workview_test # EmbeddedDaemon real-seam + network-free assemble() split
133+
embedded_block_broadcast_test # dual-path won-block broadcaster (gate A submitblock-RPC + B BIP152 P2P)
134+
coin_node_seam_test # CoinNode seam: embedded-primary / external-RPC-fallback invariants
135+
)
136+
foreach(t IN LISTS BCH_EMBEDDED_BODY_TESTS)
137+
add_executable(bch_${t}
138+
${t}.cpp
139+
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/transaction.cpp
140+
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/coin_node.cpp
141+
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/p2p_connection.cpp
142+
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/p2p_node.cpp
143+
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/rpc.cpp)
144+
target_include_directories(bch_${t} PRIVATE ${CMAKE_SOURCE_DIR}/src)
145+
target_link_libraries(bch_${t} PRIVATE
146+
core pool sharechain
147+
c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage c2pool_difficulty
148+
btclibs)
149+
add_test(NAME bch_${t} COMMAND bch_${t})
150+
endforeach()
122151
endif()

0 commit comments

Comments
 (0)