Skip to content

master is red: build ladder_bank_server in ladder-tests, and let the pre-flight expect it - #475

Open
Yaraslaut wants to merge 1 commit into
masterfrom
fix/ladder-tests-builds-bank-server
Open

master is red: build ladder_bank_server in ladder-tests, and let the pre-flight expect it#475
Yaraslaut wants to merge 1 commit into
masterfrom
fix/ladder-tests-builds-bank-server

Conversation

@Yaraslaut

Copy link
Copy Markdown
Member

Master is red

59788351 (#473) added a pre-flight to ladder-tests: every
scripts/scenario/scenarios/<name>/ must have a RungSpec and a server this
job builds. 1d690d5d (#470) then added bank's 22-scenario corpus and a
ladder_bank_server that deliberately is not a rung. The pre-flight fires on
master, naming bank — exactly as #473's own comment predicted:

::error::scripts/scenario/scenarios/bank/ is a corpus for 'bank', which is not
listed in examples/rungs.txt -- this job configures no ladder_bank_server for it.
Either list it there, or build its server in this job and extend this check to expect it.

The gate is working. A corpus with no server would otherwise have run five of
six directories and reported green — morph#462's defect one level down. This PR
takes the second branch the error names, rather than weakening the check or
adding bank to examples/rungs.txt (which would enrol bank in
wasm-ladder.yml's build loop, coverage.sh and codecov.yml's per-rung
components — a scope decision examples/rungs.txt and examples/LADDER.md
already settled the other way).

What changed

  1. ladder-tests configures -DMORPH_BUILD_BANK_EXAMPLE=ON. That option
    alone guards add_subdirectory(examples/bank) in the root CMakeLists.txt;
    examples/bank/CMakeLists.txt then declares ladder_bank_server inside its
    own if(MORPH_BUILD_QT), which this job already sets. Nothing new to install:
    the apt step already names Lightweight's libsqlite3-dev, libyaml-cpp-dev,
    libzip-dev, unixodbc-dev, libsqliteodbc and libgl1-mesa-dev, and the
    server links only Qt6::Core + Qt6::WebSocketsqtwebsockets is already
    in the aqtinstall step's modules:.
  2. The Build step names the target after the all-target build. A no-op when
    the flag is present; no rule to make target when someone drops it, rather
    than a silent absence surfacing as the scenario step's exit 2 a Qt build
    later.
  3. The pre-flight gains a third arm — an addition, not a relaxation. A corpus
    that is neither a listed rung nor served by an
    add_executable(ladder_<name>_server) in examples/<name>/CMakeLists.txt
    still fails. The arm is keyed on that declaration, not on the literal name
    bank, so deleting the target makes the check fire again.
  4. scripts/scenario/README.md's "In CI" section claimed CI does not run the
    corpus because no workflow builds the servers. False since ci: run the scenario corpus in ladder-tests, and let corpus changes reach it #473; rewritten to
    describe the pre-flight, the whole-corpus run, and the scripts/scenario/
    entry in the job's path filter.

Verification

Pre-flight run: script extracted from ci.yml with yaml.safe_load and run on
a clean checkout.

Before (at 1d690d5d) — exit 1:

::error::scripts/scenario/scenarios/bank/ is a corpus for 'bank', which is not listed in examples/rungs.txt -- this job configures no ladder_bank_server for it. Either list it there, or build its server in this job and extend this check to expect it.
ok: bookmarks -- corpus, RungSpec and ladder_bookmarks_server all accounted for
ok: kanban -- corpus, RungSpec and ladder_kanban_server all accounted for
ok: ledger -- corpus, RungSpec and ladder_ledger_server all accounted for
ok: pastebin -- corpus, RungSpec and ladder_pastebin_server all accounted for
ok: polls -- corpus, RungSpec and ladder_polls_server all accounted for
EXIT=1

After — exit 0:

ok: bank -- corpus, RungSpec and a local ladder_bank_server in examples/bank/CMakeLists.txt all accounted for
ok: bookmarks -- corpus, RungSpec and ladder_bookmarks_server all accounted for
ok: kanban -- corpus, RungSpec and ladder_kanban_server all accounted for
ok: ledger -- corpus, RungSpec and ladder_ledger_server all accounted for
ok: pastebin -- corpus, RungSpec and ladder_pastebin_server all accounted for
ok: polls -- corpus, RungSpec and ladder_polls_server all accounted for
EXIT=0

Still refuses an unknown corpus — scratch scripts/scenario/scenarios/nonesuch/:

::error::scripts/scenario/scenarios/nonesuch/ has no RungSpec in scripts/scenario/run_scenarios.py, so nothing can start a server for it and the driver would leave it out of its default set
EXIT=1

Still refuses bank if the target goes awayadd_executable(ladder_bank_server …) commented out:

::error::scripts/scenario/scenarios/bank/ is a corpus for 'bank', which is neither listed in examples/rungs.txt nor served by an add_executable(ladder_bank_server) in examples/bank/CMakeLists.txt -- this job configures no ladder_bank_server for it. Either list it there, or declare that target and make this job configure and build it (see bank's -DMORPH_BUILD_BANK_EXAMPLE=ON below).
EXIT=1

The target actually builds. cmake --preset gcc-debug -DMORPH_BUILD_QT=ON -DMORPH_BUILD_LADDER=ON -DMORPH_LADDER_RUNGS=all -DMORPH_BUILD_BANK_EXAMPLE=ON → exit 0; full cmake --build --preset gcc-debug (469 targets) → exit 0:

build/gcc-debug/examples/bank/ladder_bank_server
build/gcc-debug/examples/bookmarks/ladder_bookmarks_server
build/gcc-debug/examples/kanban/ladder_kanban_server
build/gcc-debug/examples/ledger/ladder_ledger_server
build/gcc-debug/examples/pastebin/ladder_pastebin_server
build/gcc-debug/examples/polls/ladder_polls_server

Whole corpus, all six directories (run_scenarios.py --build-dir build/gcc-debug --rung bank …) — exit 0:

bank: 22 file(s) against ws://127.0.0.1:41991   (22 ok)
bookmarks: 14 file(s)                            (14 ok)
kanban: …  ledger: …  pastebin: 12  polls: 10
every scenario passed in: bank, bookmarks, kanban, ledger, pastebin, polls

Other job steps, unchanged and green:

  • ctest --preset gcc-debug -L ladder -LE stress100% tests passed out of 1026
  • bash scripts/check_automoc_includes.sh build/gcc-debug32 generated moc source(s), none ascending
  • bash scripts/check_rung_filters.shAll 39 rung-filter checks passed.
  • bash scripts/ladder_rungs.sh ci-path-regex → byte-identical; neither of its
    inputs (examples/rungs.txt, scripts/ladder_rungs.sh) is touched.
  • ci.yml parses with yaml.safe_load (17 jobs).

Not verified here: the run above used this machine's system Qt 6.11.2 and
GCC 16.2.1, not CI's aqtinstall Qt 6.8.1 on GCC 15 — the flags and target are
the same, but the exact CI toolchain combination is untested outside CI.

🤖 Generated with Claude Code

…expect it

Master went red on the merge of #470 (bank's server and 22-scenario corpus)
into #473's pre-flight, exactly as #473's own comment said it would:

  ::error::scripts/scenario/scenarios/bank/ is a corpus for 'bank', which is
  not listed in examples/rungs.txt -- this job configures no ladder_bank_server
  for it. Either list it there, or build its server in this job and extend this
  check to expect it.

That is the gate working. A corpus with no server in this job would otherwise
have run five of six directories and reported green, which is morph#462's
defect one level down. So this takes the second branch the error names rather
than weakening the check or adding bank to examples/rungs.txt -- the latter
would enrol bank in wasm-ladder.yml's build loop, coverage.sh and codecov.yml's
per-rung components, which is a scope decision that rungs.txt and
examples/LADDER.md have already settled the other way.

ladder-tests now configures -DMORPH_BUILD_BANK_EXAMPLE=ON. That option alone
guards add_subdirectory(examples/bank) in the root CMakeLists.txt;
examples/bank/CMakeLists.txt then declares ladder_bank_server inside its own
if(MORPH_BUILD_QT), which this job already sets. Nothing new to install: the
apt step already names Lightweight's libsqlite3-dev, libyaml-cpp-dev,
libzip-dev, unixodbc-dev and libsqliteodbc (MORPH_BUILD_LADDER=ON fetches the
same pinned ORM through examples/common) and libgl1-mesa-dev, and the server
links only Qt6::Core and Qt6::WebSockets, both already installed. The Build
step names the target after the all-target build -- a no-op when the flag is
present, and "no rule to make target" when someone drops it, instead of a
silent absence surfacing as the scenario step's exit 2 a Qt build later.

The pre-flight gains a third arm, not a relaxation: a corpus that is neither a
listed rung nor served by an add_executable(ladder_<name>_server) in
examples/<name>/CMakeLists.txt still fails. The arm is keyed on that
declaration rather than on the literal name "bank", so deleting the target
makes the check fire again -- verified by commenting the add_executable() out
and watching bank go red -- and a scratch scenarios/nonesuch/ still fails.

scripts/scenario/README.md's "In CI" section said CI does not run the corpus
because no workflow builds the servers. That has been false since #473;
rewritten to describe the pre-flight, the whole-corpus run, and the
scripts/scenario/ entry in the job's path filter.

Verified locally with the job's own flags: ladder_bank_server builds, all six
servers exist, `run_scenarios.py` over bank+bookmarks+kanban+ledger+pastebin+
polls reports "every scenario passed", ctest -L ladder -LE stress is 1026/1026,
scripts/check_rung_filters.sh is 39/39, and `ladder_rungs.sh ci-path-regex` is
byte-identical (neither of its inputs is touched).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C6uB9zxdSG8qp3VNAAyFvF
@codecov

codecov Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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