Skip to content

test: drop the v0.13.0 guards now that libkcl 0.13.1 is in the tree - #402

Merged
Peefy merged 3 commits into
mainfrom
behaviour/v0.13.1
Oct 8, 2026
Merged

Peefy merged 3 commits into
mainfrom
behaviour/v0.13.1

Conversation

@Peefy

@Peefy Peefy commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Sits directly on main — #399 (the v0.13.1 release bump) is merged, so this PR's diff is exactly the three commits below.

Follow-up to #399. That PR replaced the checked-in binaries with the v0.13.1 release and fixed the two CI failures the bump caused; this one removes the workarounds that release made dead, and corrects the docs that described the old behaviour.

Why the guards are dead

v0.13.1 closes three RPC-registry gaps the bindings had been compensating for:

  • BuiltinService.ListMethod and BuiltinService.Ping are registered. Bindings that treated an empty method table as "this RPC doesn't exist" now always get a table.
  • KclService.FormatTestReport and the five Generate* RPCs (GenerateToml, GenerateKcl, GenerateOpenAPI, GenerateProto, GenerateDoc) are registered, so the skip guards in front of their assertions never fire.
  • KclService.ListDepFiles was removed, replaced by new LoadPackageResult.imports / kcl_mod / apps fields.

28 RPCs are now advertised: 26 under service KclService plus Ping and ListMethod under service BuiltinService.

What this changes

Removes the t.Skip / pytest.skip / markTestSkipped / pending() / empty-table guards across go, python, dart, zig, julia, lua, nodejs, java, kotlin, dotnet, ruby, swift, cpp and replaces them with the assertions they were written to enable.

Where a guard was the only thing keeping a test green, the assertion now pins the registry size at 28 — so the next core-side RPC removal cannot pass unnoticed. ListDepFiles is exactly the case that slipped through: it was deleted from the core and these bindings kept carrying a skip for it.

Doc corrections that the release made stale:

  • dart/lib/src/kcl_lib.dart — the old comment claimed spec.proto declares FormatCode / LintPath / etc. under BuiltinService. It does not; the core registers every RPC under KclService except the two spec.proto puts in BuiltinService.
  • zig/README.md RPC count (20 → 26), julia/README.md, dart/README.md, wasm/README.md getVersion examples
  • docs/architecture.md — the ListDepFiles drift entry is now closed, and item A's core half landed in v0.13.1

Deliberate non-changes: the per-case new_core skips (python, ruby, swift, cpp, lua, dotnet, kotlin, java, go, c) stay. They query the live core through list_method() and skip only when the loaded core genuinely does not advertise the RPC — an evidence-driven capability check, not a v0.13.0 artifact.

cpp: three separate things

The six examples asserted nothing. The Generate* / FormatTestReport examples each carried a comment saying the linked runtime "currently prints nothing" — and then asserted nothing at all, so cpp-test's exit 1-on-failure loop had nothing to catch. They all produce real output on 0.13.1; they now check it.

cpp/src/lib.rs hand-copied 12 proto messages for these RPCs, on the stated grounds that "the kcl-api revision pinned in Cargo.lock predates the RPC, so the wrapper has no generated counterpart". It does have them: kcl_api::FormatTestReportArgs, GenerateTomlArgs, GenerateKclArgs, GenerateOpenApiArgs, GenerateProtoArgs, GenerateDocArgs (and the matching *Result) are all generated at the pinned rev, field-for-field. The copies are gone. The From impls stay — they convert the cxx types to the prost ones — and so do call_rpc and list_method, because kcl_api still exposes no typed client method for these, only kcl_api::call.

The first CI run of this PR caught a build break in the above. call_rpc takes &Req with Req: prost::Message, so call_rpc(b"...", &args.into()) leaves Req pinned only by the argument; Into has too many candidate impls and the type parameter is never pinned elsewhere, so all six dispatch functions fail with E0283. Fixed by binding the conversion to a named local — which also documents which generated message each RPC expects. Worth noting how this survived local testing: cpp/CMakeLists.txt's add_custom_command lists ${RUST_BRIDGE_CPP} ${RUST_LIB} ${RUST_HEADER_FILE} as outputs but has no DEPENDS on ${RUST_SOURCE_FILE}, so editing cpp/src/lib.rs does not re-run cargo build and the previous ctest/consistency run was against a stale staticlib. That is a pre-existing bug in the build, left alone here — the re-verification below builds the crate explicitly first.

The one skip that was not a version artifact

swift/Tests/KclLibTests/AstJsonAlignmentTest.swift skipped on "the pinned kcl runtime does not copy the parent into mixins". That is not what the pin does. The parser fills mixins only from an explicit mixin [...] clause (crates/parser/src/parser/stmt.rs); the parent goes to parent_name alone. No future pin will make that skip stop firing, so it is replaced with the invariant it was standing in for — a schema with a parent and no mixins has an empty mixins.

The stale ruby/Cargo.lock is not here — it is release correctness, so it rides in #399 with the manifest bump.

Verification

Run locally against the v0.13.1 darwin-arm64 dylib:

suite result
swift 102 tests, 0 failures, 0 skipped
ruby 145 runs, 654 assertions, 0 failures, 0 errors, 0 skips
cpp cargo build --release clean · 9/9 ctest · 13/13 consistency cases, 0 skipped · all 31 examples exit 0 under the CI loop · cargo fmt --check adds no new diffs (3 pre-existing at 1775/1805/2328)
go (native/path/plugin) ok — the 6 Generate* / FormatTestReport guards now assert instead of skipping
python 160 passed, 2 skipped (skips want PyYAML, unrelated)
nodejs 109 passed (listMethod returns 28)
dart 124 passed, dart analyze clean
zig exit 0 (BuiltinService.Ping now dispatches)
julia 129 + 106 + 168 + 18 (coverage and test report are populated)

swift, ruby and cpp all report zero skips, which is the direct evidence that every guard removed here was dead.

@Peefy
Peefy force-pushed the behaviour/v0.13.1 branch 3 times, most recently from ac40faf to 274e086 Compare October 8, 2026 02:10
@Peefy Peefy mentioned this pull request Oct 8, 2026
11 tasks done
@Peefy
Peefy force-pushed the behaviour/v0.13.1 branch from 2d9e15f to f0a74c5 Compare October 8, 2026 02:38
@Peefy
Peefy changed the base branch from release/v0.13.1 to main October 8, 2026 03:01
@Peefy Peefy closed this Oct 8, 2026
@Peefy Peefy reopened this Oct 8, 2026
Peefy and others added 3 commits October 8, 2026 11:19
#399 replaced the checked-in binaries with the v0.13.1 release. That
release closes three RPC-registry gaps the bindings had been working
around, and every workaround for them is now dead code:

  - `BuiltinService.ListMethod` and `BuiltinService.Ping` are registered,
    so the bindings that treated an empty method table as "the RPC
    doesn't exist" now always get a table.
  - `KclService.FormatTestReport` and the five `Generate*` RPCs are
    registered, so the skip/empty-payload guards in front of their
    assertions never fire.
  - `KclService.ListDepFiles` was dropped in favour of new
    `LoadPackageResult.imports` / `kcl_mod` / `apps` fields.

Removes the `t.Skip` / `pytest.skip` / `pending()` / empty-table guards
in go, python, dart, zig and julia, and replaces them with the assertions
they were written to enable. Where a guard was the only thing keeping a
test green, the assertion now pins the registry size at 28, so the next
core-side RPC removal cannot pass unnoticed — `ListDepFiles` is exactly
the case that slipped through.

Verified against the v0.13.1 `darwin-arm64` dylib:

  go      native/path/plugin      ok (6 Generate*/FormatTestReport now assert)
  python  160 passed, 2 skipped   (skips want PyYAML, unrelated)
  nodejs  109 passed              (listMethod returns 28)
  dart    124 passed, analyze ok
  zig     exit 0                  (BuiltinService.Ping now dispatches)
  julia   129 + 106 + 168 + 18    (coverage and report are populated)

Also corrects the docs that described the old behaviour: the service-name
divergence notes in dart/zig/julia/lua, `zig/README.md`'s RPC count, the
`getVersion` examples in wasm/julia, and the `ListDepFiles` drift entry in
`docs/architecture.md` — which the core resolving item A has now closed.

Not covered here, because these suites cannot run in this environment:
swift, ruby, cpp and the c/examples guards still carry the same
predates-the-RPC wording. lua's spec guards are updated but unverified —
`luarocks make` fails to link mlua against Homebrew's Lua 5.4 locally,
which is unrelated to this change. java, kotlin and dotnet are updated
but unrun (no JRE / dotnet SDK here).

Signed-off-by: Peefy <xpf6677@163.com>
Same cleanup as the other bindings: v0.13.1 registers
`KclService.FormatTestReport` and the five `Generate*` RPCs, so the
guards in front of their assertions no longer have anything to guard.

ruby, swift
  - Drop `skip "core does not list KclService.FormatTestReport"` from
    the two report tests and the `XCTSkipIf(report.isEmpty, ..)` pair
    from `testFormatTestReport` / `testFormatTestReportEmpty`. The
    assertions underneath -- the 80-dash separator, `PASS: 2/2`, and
    `"no test files\n"` -- now run.

cpp
  - The six `Generate*` / `FormatTestReport` examples each carried a
    comment saying the linked runtime "currently prints nothing" and
    then asserted nothing at all, so a regression could not fail CI.
    They all produce real output on 0.13.1; they now check it, and
    `cpp-test`'s `exit 1`-on-failure loop actually has something to
    catch.
  - `src/lib.rs` hand-copied 12 proto messages for these RPCs on the
    stated grounds that "the kcl-api revision pinned in Cargo.lock
    predates the RPC, so the wrapper has no generated counterpart".
    It does have them: `kcl_api::FormatTestReportArgs`,
    `GenerateTomlArgs`, `GenerateKclArgs`, `GenerateOpenApiArgs`,
    `GenerateProtoArgs` and `GenerateDocArgs` (plus the matching
    `*Result`) are all generated at the pinned rev, field-for-field.
    The copies and their doc comments are gone; the `From` impls stay
    because they still convert the cxx types to the prost ones.
    `call_rpc` and `list_method` stay too -- `kcl_api` still exposes
    no typed *client* method for these, only `kcl_api::call`, so the
    dispatcher is still the only route.

The one skip that is not a version artifact
  `AstJsonAlignmentTest` skipped on "the pinned kcl runtime does not
  copy the parent into mixins". That is not what the pin does: the
  parser fills `mixins` only from an explicit `mixin [...]` clause
  (`crates/parser/src/parser/stmt.rs`), and the parent goes to
  `parent_name` alone. No future pin will make the skip stop firing,
  so the skip is replaced with the invariant it was standing in for --
  a schema with a parent and no mixins has an empty `mixins`.

Verified locally against the v0.13.1 darwin-arm64 core:
  swift  102 tests, 0 failures, 0 skipped
  ruby   145 runs, 654 assertions, 0 failures, 0 errors, 0 skips
  cpp    9/9 ctest, 13/13 consistency cases, 0 skipped, examples all
         exit 0 under the CI loop; `cargo fmt` adds no new diffs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Peefy <xpf6677@163.com>
`call_rpc` takes `&Req` with `Req: prost::Message`, so passing
`&args.into()` leaves the type parameter pinned only by the argument.
`Into` has too many candidate impls for the compiler to pick one and
`Req` is never pinned elsewhere in the signature, so all six dispatch
functions fail with E0283.

Bind the conversion to a named local instead, which both fixes the
inference and documents which generated message each RPC expects.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Peefy <xpf6677@163.com>
@Peefy
Peefy force-pushed the behaviour/v0.13.1 branch from f0a74c5 to 0525da6 Compare October 8, 2026 03:20
@Peefy
Peefy merged commit 284927c into main Oct 8, 2026
90 of 91 checks passed
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