2 Commits
Author SHA1 Message Date
Dario LipicarandClaude Opus 4.8 71e003813a test: switch the suite to the full-api test module (all types + events, both codecs) (#9)
* test: switch integration tests to the full-api module (all types + events)

Replace the `test_basic_module_cpp` method tests with a full type-surface
suite against `test_fullapi_cpp` — the universal C++ provider of the shared
`full_api` contract — so the logoscore-py integration suite showcases every
supported parameter, return, and event type, including the typed events the
basic module never exercised (its events carried only scalars).

- tests/integration/test_fullapi_module_cpp.py: params/returns for
  tstr/bstr/int/uint/float64/bool/any/[tstr]/[int]/[uint]/[float64]/[bool]/
  [any]/{tstr:any}/result/void, plus one typed event per event-legal type
  driven through the module's bool-returning fire<X>Event triggers.
- client: `_arg_to_str` now JSON-encodes bytes + containers behind the CLI's
  `json:` prefix — byte arrays via the canonical `{"_bytes": …}` tag
  (NUL/high-byte safe; a raw latin-1 arg UTF-8-mangled any byte >= 0x80), and
  list/dict/`any` values pass as natural Python objects.
- events: the pump now decodes tagged bytes into `bytes`, symmetric with
  `call`; the shared decoder moves to `_proc` so both paths use one impl.
- flake.nix: build `test_fullapi_cpp` (dev + portable) into the merged test
  modules dir in place of `test_basic_module_cpp`; `test_basic_module` (Qt)
  stays for the end-to-end + event-lifecycle tests.

Validated: `nix build .#checks.<sys>.{unit,integration-local}` green
(48 unit + 97 integration) and the new suite passes on local + tcp.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test/events: address review — guard event decode + retry event fires

Two robustness fixes from Copilot review on PR #9:

- events._pump: wrap `decode_bytes_tags` in its own report-and-continue
  guard so a malformed `{"_bytes":…}` tag (which raises binascii.Error)
  reports the error and skips that one event — same as a JSON parse
  failure — instead of propagating to the outer `except` and tearing
  down the subscription thread.
- test `_capture_event`: replace the fixed `sleep(0.5)` + single fire
  with a re-fire-to-deadline loop. The `fire<X>Event` triggers are
  idempotent emits, so re-firing on a 1s cadence closes the
  watcher-subscription race without a hard-coded settle; the old
  single-fire path could miss the event on a slow-to-subscribe CI
  watcher and then never recover.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test: fully switch the suite off test_basic_module → test_fullapi_cpp

The full-api module is a strict superset for client-side testing (every
supported type as param/return + one typed event per type), and from the
wrapper's perspective a module's internal typing is invisible over RPC —
so test_basic_module was redundant. Drop it everywhere:

- delete tests/integration/test_basic_module_methods.py and the shared
  tests/_basic_module_cases.py (superseded by test_fullapi_module_cpp.py +
  _fullapi_module_cases.py);
- repoint test_end_to_end.py at test_fullapi_cpp (fireStringEvent →
  stringEvent), with the robust re-fire-to-deadline event capture;
- docker smoke: the codec matrix, event matrix, two-daemon isolation, the
  legacy fallbacks and the tcp_ssl smoke all load test_fullapi_cpp; the
  in-container build provisions only test_fullapi_cpp;
- flake builds only test_fullapi_cpp (dev + portable);
- docs + READMEs updated.

Multi-argument argv construction (which the basic module's twoArgs…fiveArgs
exercised end-to-end) is now pinned by unit tests — test_client_with_fake
asserts a 6-arg mixed-type call's argv plus the bytes/container encoding —
so no client-side coverage is lost. test_fullapi_cpp's methods are all
0/1-arg by design.

Also close a nested-float-over-cbor gap in the shared method table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-20 23:17:10 -03:00
Iuri Matias 560e98b7b4 add docs 2026-06-18 12:49:37 -04:00