Add a --disable-keychain command line flag

As per the discussion on (Homebrew/homebrew-core/pull/83099) and (joplin/issues/5281) it looks like we can't get the joplin terminal app into homebrew until we can get a working test. The tests always fail on macOS with a keychain error. The issue is that the keychain access becomes interactive, and the tests need to be able to be run non interactively.

Could we add a --disable-keychain flag to the joplin terminal app? That would solve this issue by allowing jopling --disable-keychain version to be used as a test command. Or we could also potentially set an environment variable, like JOPLIN_DISABLE_KEYCHAIN=1, hopefully there's a way to pass environment variables to tests in brew...

Unfortunately as a new user I can't post links in discourse, so I can't actually link to those two topics above, I'll try to add them in a reply...

I'm not in favour of adding an option as it will apply to all commands and it's useful for only a specific case. Instead, I think a separate command like joplin test that runs a few checks (but not on the keychain) would be preferable. Actually is there any standard for this kind of command in Homebrew formulas? I thought maybe of calling it joplin doctor, which likewise would do some basic checks on the config?

1 Like

joplin test sounds like an interesting approach. I'm not sure what it could test, but even just asserting that joplin is running would be a good start. I'm not sure that testing the config is possible, as ~/.config/joplin may not exist on test machines, etc. Also, I'm not sure which user the test are run as, maybe that's why there's an issue with the keychain service.

A simple joplin test command that doesn't rely on the keychain would be great. It could be expanded over time to test more functionality, or could take additional arguments in time like --disable-keychain and so on. But even if it outputs just joplin ok for now, that would be great.

Actually after looking into it I've decided to keep it simple and fix the version command so that it doesn't require the keychain. I've also made it output more information although it's not quite related to our current issue.

Regarding testing functionalities, that was discussed when the initial Homebrew formula was created and it was agreed that since the version command requires at least the config, database and profile to work, it's good enough as a check.

Ok that should be in CLI version 2.2.2 now.

Awesome, I’ll update the PR to the new version. Thanks for the ultra quick response! :+1:

There’s one other issue on the PR about fsevents being a generic binary. I’ll hopefully figure out what the solution is for that next…

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.