Declare some modules as a test dependency - #246
Merged
Conversation
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>
oetiker
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.)