Adds xce_scheduler_t.job_pick_plugin (global picker name), and on xce_sched_queue_t: project_name + job_pick_plugin (per-queue override, NULL = inherit global). Adds xce_sched_project_t.priority (scaffolding only, no quota logic). sched_set_default_job_pick_plugin() is added but not yet wired into sched_init() -- task 2.4 owns that, alongside replacing the hardcoded "xce_sched_fcfs" literal. Requirements: 2.1, 2.2, 2.3, 2.4
113 lines
6.6 KiB
Meson
113 lines
6.6 KiB
Meson
scheduler_test_src = [
|
|
'test.c',
|
|
]
|
|
|
|
scheduler_test_deps = [libxce_deps, librtti_dep, unity_dep, libxce_dep]
|
|
|
|
incdir = include_directories('../include', '../../include', '.', '../src', '../../lib')
|
|
|
|
scheduler_test = executable('sched_test',
|
|
scheduler_test_src,
|
|
include_directories:[incdir],
|
|
dependencies: [scheduler_test_deps],
|
|
install: false)
|
|
|
|
# White-box test for the notify single-job in-place update path
|
|
# (sched_update_existing_job). It #includes ../src/schedobj.c directly, so it
|
|
# is a standalone TU with its own main() — built as a separate executable.
|
|
sched_job_update_test = executable('sched_job_update_test',
|
|
['test_job_update.c'],
|
|
include_directories:[incdir],
|
|
dependencies: [scheduler_test_deps],
|
|
install: false)
|
|
|
|
# White-box test for the notify/dataset enqueue handlers. It #includes
|
|
# ../src/handler.c directly (enq_pend_update + the static handlers), so it is a
|
|
# standalone TU with its own main() — built as a separate executable.
|
|
sched_handlers_test = executable('sched_handlers_test',
|
|
['test_handlers.c'],
|
|
include_directories:[incdir],
|
|
dependencies: [scheduler_test_deps],
|
|
install: false)
|
|
|
|
# White-box test for the compact job-array push receive/expand path
|
|
# (job-array-single-wal-record task 5.3). It also #includes ../src/handler.c
|
|
# directly, but additionally needs a REAL sched->jobs kvmgr (sched_get_job/
|
|
# sched_add_job) to exercise the per-element dedup check for real — kept as
|
|
# its own binary rather than folded into sched_handlers_test so that file's
|
|
# "self-contained, only sched_init_config stubbed" story stays accurate.
|
|
sched_job_array_test = executable('sched_job_array_test',
|
|
['test_job_array_expand.c'],
|
|
include_directories:[incdir],
|
|
dependencies: [scheduler_test_deps],
|
|
install: false)
|
|
|
|
# Cross-daemon integration test (job-array-single-wal-record task 5.5): the
|
|
# REAL xce_encode()/xce_decode()/extract_data() -> scheduler_req_handler()
|
|
# chain (the top-level function vtask_entry() registers as its handler),
|
|
# proving one-push/N-tasks/log-once and redelivery-safety under genuinely
|
|
# re-decoded wire bytes -- one layer more real than sched_job_array_test's
|
|
# own wire-dispatch case, which stops at sched_handle_dataset(). Kept as its
|
|
# own binary for the same reason sched_job_array_test is separate from
|
|
# sched_handlers_test: it needs a REAL sched->jobs kvmgr for the dedup check.
|
|
sched_job_array_wire_e2e_test = executable('sched_job_array_wire_e2e_test',
|
|
['test_job_array_wire_e2e.c'],
|
|
include_directories:[incdir],
|
|
dependencies: [scheduler_test_deps],
|
|
install: false)
|
|
|
|
# Compile-check for the job picker plugin contract, xce_job_picker_iface_t
|
|
# (scheduler-core spec, task 1.1). Only #includes plugin.h -- no picker
|
|
# implementation exists yet (that's task 2.x). -Werror on incompatible
|
|
# pointer types so a hook signature drift in plugin.h fails the build, not
|
|
# just an assertion: the test's real content is "this compiles at all".
|
|
sched_picker_iface_test = executable('sched_picker_iface_test',
|
|
['test_picker_iface.c'],
|
|
include_directories:[incdir],
|
|
dependencies: [scheduler_test_deps],
|
|
c_args: ['-Werror=incompatible-pointer-types'],
|
|
install: false)
|
|
|
|
# White-box test for the picker plugin registration category and the
|
|
# job_elect_fn compatibility wrapper (scheduler-core spec, task 1.2). It
|
|
# #includes ../src/plugin.c directly (same white-box pattern as
|
|
# sched_handlers_test/sched_job_array_test) so it exercises the real
|
|
# plugin_register() and the real legacy_picker_wrapper_iface, and needs a
|
|
# REAL sched->plugins kvmgr (same setup scheduler.c's sched_plugin_init()
|
|
# uses) to register plugins through it for real.
|
|
sched_picker_registration_test = executable('sched_picker_registration_test',
|
|
['test_plugin_picker_registration.c'],
|
|
include_directories:[incdir],
|
|
dependencies: [scheduler_test_deps],
|
|
install: false)
|
|
|
|
# White-box test for the picker configuration fields added to
|
|
# xce_scheduler_t/xce_sched_queue_t/xce_sched_project_t (scheduler-core
|
|
# spec, task 1.3). It #includes ../src/schedobj.c directly (same white-box
|
|
# pattern as sched_job_update_test) so it exercises the real
|
|
# make_sched_queue/make_sched_project/sched_set_default_job_pick_plugin,
|
|
# not a re-implementation of any of them.
|
|
sched_picker_config_fields_test = executable('sched_picker_config_fields_test',
|
|
['test_picker_config_fields.c'],
|
|
include_directories:[incdir],
|
|
dependencies: [scheduler_test_deps],
|
|
install: false)
|
|
|
|
# Register as meson tests so `meson test --suite scheduler` runs them all.
|
|
# detect_leaks=0 matches the suite convention (fixtures are not torn down).
|
|
test('scheduler test', scheduler_test, suite: 'scheduler',
|
|
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
|
test('scheduler job-update test', sched_job_update_test, suite: 'scheduler',
|
|
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
|
test('scheduler handlers test', sched_handlers_test, suite: 'scheduler',
|
|
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
|
test('scheduler job-array expand test', sched_job_array_test, suite: 'scheduler',
|
|
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
|
test('scheduler job-array wire e2e test', sched_job_array_wire_e2e_test, suite: 'scheduler',
|
|
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
|
test('scheduler picker iface test', sched_picker_iface_test, suite: 'scheduler',
|
|
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
|
test('scheduler picker registration test', sched_picker_registration_test, suite: 'scheduler',
|
|
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
|
test('scheduler picker config fields test', sched_picker_config_fields_test, suite: 'scheduler',
|
|
env: ['ASAN_OPTIONS=detect_leaks=0'])
|