Skip to content

Declare some modules as a test dependency - #246

Merged
oetiker merged 3 commits into
oetiker:masterfrom
zaucker:fix/test-requires-mojo-sqlite
Aug 19, 2026
Merged

Declare some modules as a test dependency#246
oetiker merged 3 commits into
oetiker:masterfrom
zaucker:fix/test-requires-mojo-sqlite

Conversation

@zaucker

@zaucker zaucker commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

t/config-restore.t, added in 0.58.3, opens the config database, and CallBackery::Database loads Mojo::SQLite to do so. The module has not been a declared dependency since 774d1f8 removed it in 2017 -- the require is lazy, so a Pg-backed installation does not need it -- and nothing put it back for the tests. CI has been red since 0.58.3 with "Can't locate Mojo/SQLite.pm in @inc" from t/config-restore.t.

Declare it in TEST_REQUIRES rather than PREREQ_PM: MY::postamble merges TEST_REQUIRES into the module list "make thirdparty" installs, so the tests get it, while the runtime requirements stay as they were.

(The "unexpected OP_CUSTOM (await)" lines the CI log is annotated with are unrelated noise: Devel::Cover deparses ops, and B::Deparse does not know Future::AsyncAwait's custom ops. They appear in green runs too.)

zaucker and others added 3 commits August 19, 2026 15:38
t/config-restore.t, added in 0.58.3, opens the config database, and
CallBackery::Database loads Mojo::SQLite to do so. The module has not
been a declared dependency since 774d1f8 removed it in 2017 -- the
require is lazy, so a Pg-backed installation does not need it -- and
nothing put it back for the tests. CI has been red since 0.58.3 with
"Can't locate Mojo/SQLite.pm in @inc" from t/config-restore.t.

Declare it in TEST_REQUIRES rather than PREREQ_PM: MY::postamble merges
TEST_REQUIRES into the module list "make thirdparty" installs, so the
tests get it, while the runtime requirements stay as they were.

(The "unexpected OP_CUSTOM (await)" lines the CI log is annotated with
are unrelated noise: Devel::Cover deparses ops, and B::Deparse does not
know Future::AsyncAwait's custom ops. They appear in green runs too.)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Once Mojo::SQLite is available t/config-restore.t gets one step further
and dies on "Can't locate Crypt/Rijndael.pm": getConfigBlob() encrypts
the blob through CallBackery::Config::getCrypt, which requires the
module lazily. Same situation as Mojo::SQLite, same treatment.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The test asserted the generic 9999 "Couldn't process request" and was
green -- but not because CallBackery handled the invalid plugin that
way. Mojo::SQLite was not installed, so the request died in
CallBackery::Database before the plugin was ever looked up, and that
crash was what got sanitised:

  [error] Error while processing default::processPluginData:
          Can't locate Mojo/SQLite.pm in @inc ...
  [error] JsonRPC error sent to client: '9999: Couldn't process request'

With the module declared the request reaches the plugin lookup and
raises mkerror(39943) "No prototype for undefinedPlugin" from
CallBackery::Config, which reaches the client with its own code -- the
normal contract for mkerror exceptions, and what applications depend on
to put error messages in front of users.

The expectation is updated to that, and a note in the test explains the
history and flags the alternative reading for review: if "No prototype
for X" should stay internal, then RpcService's sanitising is what needs
fixing and the expectation should go back to 9999.

Verified both ways locally: the test now fails when Mojo::SQLite is
absent (it no longer passes on the crash path) and passes when it is
present.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@zaucker zaucker changed the title Declare Mojo::SQLite as a test dependency Declare some modules as a test dependency Aug 19, 2026
@oetiker
oetiker merged commit e6c06b9 into oetiker:master Aug 19, 2026
10 checks passed
@zaucker
zaucker deleted the fix/test-requires-mojo-sqlite branch August 19, 2026 15:23
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.

2 participants