Skip to content

Non-PHOLD testing infrastructure - #206

Merged
caitlinross merged 6 commits into
ROSS-org:masterfrom
caitlinross:cmake-initial-test-refresh
Jun 15, 2026
Merged

caitlinross merged 6 commits into
ROSS-org:masterfrom
caitlinross:cmake-initial-test-refresh

Conversation

@caitlinross

@caitlinross caitlinross commented Jun 15, 2026 •

Copy link
Copy Markdown
Member

Summary

Stands up a tests/ directory for subsystem driver tests so regressions in
core pieces (rand, queue, lifecycle) surface without depending on phold.
Mostly scaffolding, plus three small drivers
to demonstrate. We can continue to add more tests in the future to better test out
various parts of ROSS.

Scaffolding

  • ROSS_BUILD_TESTING gates include(CTest) and add_subdirectory(tests);
    defaults on at top level, off under add_subdirectory / FetchContent.
    PHOLD binaries still build with -DROSS_BUILD_TESTING=OFF, just without
    test registration.
  • tests/CMakeLists.txt exposes ROSS_DRIVER_TEST(name [SCHEDULERS ...]),
    which registers one ctest entry per single-rank scheduler. Drivers with
    event-handler side effects that don't survive replay can opt down to
    SCHEDULERS Sequential.
  • tests/helpers/test_lp_minimal.{c,h} -- shared no-op LP type for drivers
    that don't need custom handlers.
  • tests/helpers/test_assert.h -- ROSS_TEST_ASSERT(expr, fmt, ...) macro
    with printf-style value interpolation and MPI_Abort so the next
    multi-rank driver lands without rework.

Drivers

  • lifecycle_test -- engine boot/teardown with zero events; smallest ROSS
    program possible. Mostly validates the scaffolding itself.
  • rand_reverse_test -- rand-clcg4 round-trip symmetry (forward draws +
    matching tw_rand_reverse_unif restore Cg and count), plus
    per-distribution cost checks for tw_rand_integer / _exponential /
    _ulong.
  • splay_order_test -- splay priority queue delivers a mix of distinct +
    tied timestamps in monotonically non-decreasing recv_ts.

Checklist

  • Builds cleanly with -Wall and -Wextra
  • CI is green
  • Added a changelog fragment under Documentation/dev/, unless the change is invisible to anyone outside the PR (test refactors, internal renames, comment-only tweaks)
  • Confirmed nothing in CODES breaks. CI has a minimal CODES build that should be green before merging.
  • For new features: blog post on the ROSS website, with link in this PR

Replaces the unconditional ENABLE_TESTING() / include(CTest) block with
a project-scoped knob that defaults ON at top level (honoring an
explicit BUILD_TESTING=OFF) and OFF when ROSS is consumed via
add_subdirectory()/FetchContent. ROSS_TEST_SCHEDULERS and
ROSS_TEST_INSTRUMENTATION early-return when the knob is OFF, so a
parent superbuild's ambient enable_testing() scope can't pull phold's
add_test() calls in by accident.
Stand up the tests/ directory and bring in the first non-phold test.

The driver itself is the smallest useful ROSS program: tw_init,
register one no-op LP via the shared tests/helpers/test_lp_minimal
table, tw_run with zero events, tw_end. Exit code is the pass signal;
no assertion helper yet, deferred until a driver needs one.

Registered under --synch=1/4/6 so the RollbackCheck path runs on every
driver by construction. Multi-rank variants land later.
Plain assert(cond && "msg") tells you the file:line and the verbatim
expression but never the runtime values, so a ctest failure log forces
a rerun under gdb to see which delivery went wrong or how many events
were lost. The new macro takes a printf-style format so the dynamic
context lands in the log on the first run, e.g.

    [ROSS_TEST] FAIL splay_order_test.c:73 (s->delivery_count == (int) N_EVENTS): delivered 17 events, expected 20

The captured #expr keeps the source-level condition visible alongside
the message so they stay in sync.

Aborts via MPI_Abort(MPI_COMM_WORLD, 1) rather than abort() so any
multi-rank test failure doesn't strand non-faulting ranks until ctest's
timeout fires. Safe any time after tw_init -- tw_init brings MPI_Init
up first thing. fflush(stderr) before abort because ctest block-buffers
the redirected stderr and an aborting process doesn't flush on the way
out.
@caitlinross
caitlinross force-pushed the cmake-initial-test-refresh branch from 690e65c to 9c987d4 Compare June 15, 2026 21:36
@codecov

codecov Bot commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.95775% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.75%. Comparing base (079992b) to head (9c987d4).

Files with missing lines Patch % Lines
tests/helpers/test_lp_minimal.c 37.50% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #206      +/-   ##
==========================================
+ Coverage   47.86%   48.75%   +0.89%     
==========================================
  Files          37       41       +4     
  Lines        4745     4816      +71     
  Branches      857      860       +3     
==========================================
+ Hits         2271     2348      +77     
+ Misses       2469     2463       -6     
  Partials        5        5              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caitlinross
caitlinross merged commit 564a8dd into ROSS-org:master Jun 15, 2026
5 checks passed
@caitlinross
caitlinross deleted the cmake-initial-test-refresh branch June 15, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant