fix(xce-test-cli-ux): fix bug-1711's display and text defects
Eight display/text defects in test.c: worker_status_str's "UNKOWN" typo, cmd_runtasks's "sequentail" typo (display-only, verified inert against the real launch_type consumer), cmd_reslist's right-justified columns and unlabeled hex Flags (now matching workerlist/state_raw's conventions), joblist's raw-epoch timestamps (now via a format_job_time helper delegating to the same formatter ctrlstatus already uses) and combined NTasks column split into MinTasks/MaxTasks, job_state_str's missing raw-state fallback for ambiguous RUN+EXIT (mirroring print_jobinfo's existing pattern), and getconf's no-op group/config list stubs (now genuinely implemented from already-fetched data, matching the three sibling print functions' convention). worker_status_str/job_state_str/format_job_time are pure functions with no networking/REPL/global-state dependency, extracted into a new joblist_display.c/.h module with a permanent 20-test standalone suite -- following this codebase's own resval_typeresolve.c/misc.c precedent for testing functions that would otherwise be stranded inside untестable test.c. cmd_reslist/joblist_query/cmd_getconf's table-printing bodies inline fetch+print and remain untestable without a live cluster. 1348/1348 across the full controller suite (+20), 0 regressions. Task 2.5 of .kiro/specs/xce-test-cli-ux/tasks.md. Requirements: 11.1, 11.3, 11.4, 11.5, 11.6, 11.7, 11.8 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019jaMf9QEwpugH2W9KAuc7f
This commit is contained in:
parent
c709eba813
commit
a8154acb0a
6 changed files with 545 additions and 62 deletions
|
|
@ -82,7 +82,7 @@
|
|||
- _Requirements: 13.1, 13.2, 13.3, 13.4, 13.5, 13.6_
|
||||
- _Boundary: Source Command_
|
||||
|
||||
- [ ] 2.5 (P) Fix bug-1711's display and text defects
|
||||
- [x] 2.5 (P) Fix bug-1711's display and text defects
|
||||
- Correct the misspelled unrecognized-worker-status text and the misspelled default launch-type label (the malformed help-not-found grammar is fixed in 3.5, alongside that same code path's broader rework)
|
||||
- Left-justify the resource-listing command's text columns to match the worker-listing command's convention, and label/prefix its flags column as hexadecimal
|
||||
- Format the job-listing command's submit/start/finish time columns using the existing human-readable time formatting instead of raw epoch seconds, split its combined task-count column into two correctly labeled columns, and add a raw-state fallback for its ambiguous run-plus-exit state
|
||||
|
|
@ -178,6 +178,7 @@
|
|||
## Implementation Notes
|
||||
- `src/tools/xce-build.sh controller asan xce.build --incremental` writes its build dir at `src/xce.build/` (relative to the script's own location), not a repo-root `xce.build/` — meson logs are at `src/xce.build/meson-logs/testlog.txt`. (task 1.1)
|
||||
- New Unity test files need two wiring points, not just meson.build's source list: also register an `extern void test_<module>(void);` + `TEST(test_<module>);` in `src/controller/testsuite/controller_test.c`, mirroring the existing `test_rcfile` registration, or the suite silently never runs. (task 1.1)
|
||||
- When a fix touches a pure function stuck inside `test.c` (no networking/REPL/global-state dependency), extract it into its own module with a standalone meson `test()` target rather than settling for a throwaway/manual verification — this codebase already has two precedents for exactly this (`resval_typeresolve.c`, `misc.c`'s runusage helpers; now also `joblist_display.c` for `worker_status_str`/`job_state_str`/`format_job_time`). `test.c` itself is never linked into `controller_unit_test`, so this extract-to-standalone-module pattern is the only way to get permanent automated coverage for such functions — a scratch/deleted verification harness is not sufficient and will be sent back on review. `cmd_reslist`/`joblist_query`/`cmd_getconf`'s table-printing bodies remain genuinely untestable without a live cluster (fetch+print are inlined together, confirmed on review) and stay uncovered by permanent tests for now. (task 2.5)
|
||||
- `cmd_source` translates `rcfile_load`'s raw positive "aborted" return to `-1` rather than forwarding it verbatim, because `preprocess_and_run` only treats a *negative* return as failure (`if (rc < 0)`) — forwarding the raw positive value would let an enclosing `source` line silently read a transitively-aborted nested source as success. No test yet exercises this specific nested-abort-propagation case (all 3 required scenarios pass either way) — worth a dedicated test in Validation phase (4.3 or nearby). (task 2.4)
|
||||
- libedit (this project's pinned NetBSD libedit 3.1) provides GNU-readline-compatible `rl_attempted_completion_function`/`rl_completion_matches` verbatim — confirmed against the actual linked header, not assumed. An ambiguous match needs a SECOND consecutive Tab to list candidates (standard readline/bash double-Tab convention) — later black-box tests using Tab must account for this. Also: `test_test_cli.c`'s `clitest_spawn()` disabling kernel ECHO also silently suppressed libedit's own completion feedback in this libedit build (bug-1792) — use the new `clitest_spawn_ex(sess, path, argv, disable_echo)` with `disable_echo=false` for any future test that needs to observe libedit UI behavior (completion, etc.), not just raw command output. (task 2.3)
|
||||
- `listfmt_json.c`'s tests only exercise power-of-two double values (Unity's `TEST_ASSERT_EQUAL_DOUBLE` is disabled project-wide, matching `test_host_runusage.c`/`test_e2e_capnp.c`); cJSON's real print path uses shortest-round-trippable-double formatting so fractional values are fine, but task 3.4 should add a real fractional-value (e.g. a resource value like 12.34) round-trip test once actual command fields are wired in, since nothing here proves that end-to-end yet. (task 2.2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue