git-credential-manager icon indicating copy to clipboard operation
git-credential-manager copied to clipboard

Git tests t0303-credential-external fail "Cannot prompt because user interactivity has been disabled"

Open hickford opened this issue 2 years ago • 0 comments

Git includes a set of tests for credential helpers https://github.com/git/git/blob/master/t/t0303-credential-external.sh

This is a tool for authors of external helper tools to sanity-check their helpers.

I tried to test GCM with cache store choosing appropriate non-interactive options:

GIT_TEST_CREDENTIAL_HELPER=manager GCM_CREDENTIAL_STORE=cache GCM_GUI_PROMPT=0 GCM_INTERACTIVE=never GCM_AUTODETECT_TIMEOUT=0 ./t0303-credential-external.sh -v

15 of 21 tests fail.

10 tests fail because GCM prints an unexpected line to stderr "Cannot prompt because user interactivity has been disabled.". t0303-credential-external.sh assumes that a helper exits silently status 0 if it can't find a credential. This is the behaviour of other helpers including credential-cache and credential-store.

5 tests fail for various more interesting reasons.

If possible, it would be nice to change GCM to exit silently status 0 like other helpers. Alternatively, define a GCM_SILENT_EXIT option with this behaviour.

hickford avatar Oct 26 '23 20:10 hickford