feat(scheduler-sim-repl-verbosity): task 1.1 - RED-phase tests for job identifier range compression

Adds failing unit tests for repl_fmt_jobid_range() covering contiguous
ranges, non-contiguous sub-ranges, multiple array bases, mixed array/
non-array ids, and a too-small output buffer (Requirement 4, AC 4.1-4.5).
The function itself is not yet implemented (task 1.2) - build fails at
link time with undefined reference to repl_fmt_jobid_range, confirming
the RED phase.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAWMhfRJFnmmnG8h97yUDd
This commit is contained in:
Rongsong Shen 2026-09-02 07:31:31 +00:00
parent 00fc0a43e0
commit f165e3a751
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
3 changed files with 401 additions and 12 deletions

View file

@ -974,6 +974,23 @@ sched_repl_equivalence_test = executable(
dependencies: [scheduler_test_deps, libedit_dep],
install: false)
# RED-phase contract test for the REPL's job-identifier range compressor
# (scheduler-sim-repl-verbosity spec, task 1.1, Requirement 4). Unlike every
# other sched_repl_*_test above, this is NOT a white-box #include of
# ../src/repl.c and friends -- repl_fmt_jobid_range() is a pure formatter
# with no xce_sched_sim_driver_t/xce_sched_core_t dependency, so this file
# declares it as a plain extern instead (see test_repl_output_compression.c's
# own header comment for the full rationale). As of task 1.1, the function
# has no definition anywhere in this codebase (task 1.2 adds it), so this
# target is EXPECTED to fail at link time -- that is task 1.1's own
# Observable evidence, not a defect in this build file.
sched_repl_output_compression_test = executable(
'sched_repl_output_compression_test',
['test_repl_output_compression.c'],
include_directories:[incdir],
dependencies: [scheduler_test_deps],
install: false)
# Tests for the scheduler's unified candidate-list connect/rejoin pipeline
# (component-failover-adoption, task 3.1, boundary: SchedulerControllerClient).
# Unlike the white-box #include-the-.c-file tests above, this target links
@ -1324,6 +1341,9 @@ test('scheduler repl snapshot params test',
test('scheduler repl equivalence test',
sched_repl_equivalence_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
test('scheduler repl output compression test',
sched_repl_output_compression_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
test('scheduler connect pipeline test',
sched_scheduler_connect_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])