Skip to content

Commit 6c556cb

Browse files
keszybzgitster
authored andcommitted
t0303: resurrect commit message as test documentation
The commit message which added those tests (861444f 't: add test harness for external credential helpers' 2011-12-10) provided nice documentation in the commit message. Let's make it more visible by putting it in the test description. The documentation is updated to reflect the fact that GIT_TEST_CREDENTIAL_HELPER must be set for GIT_TEST_CREDENTIAL_HELPER_TIMEOUT to be used and GIT_TEST_CREDENTIAL_HELPER_SETUP can be used. Based-on-commit-message-by: Jeff King <[email protected]> Signed-off-by: Zbigniew Jędrzejewski-Szmek <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 16e4481 commit 6c556cb

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

t/t0303-credential-external.sh

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,34 @@
11
#!/bin/sh
22

3-
test_description='external credential helper tests'
3+
test_description='external credential helper tests
4+
5+
This is a tool for authors of external helper tools to sanity-check
6+
their helpers. If you have written the "git-credential-foo" helper,
7+
you check it with:
8+
9+
make GIT_TEST_CREDENTIAL_HELPER=foo t0303-credential-external.sh
10+
11+
This assumes that your helper is capable of both storing and
12+
retrieving credentials (some helpers may be read-only, and they will
13+
fail these tests).
14+
15+
Please note that the individual tests do not verify all of the
16+
preconditions themselves, but rather build on each other. A failing
17+
test means that tests later in the sequence can return false "OK"
18+
results.
19+
20+
If your helper supports time-based expiration with a configurable
21+
timeout, you can test that feature with:
22+
23+
make GIT_TEST_CREDENTIAL_HELPER=foo \
24+
GIT_TEST_CREDENTIAL_HELPER_TIMEOUT="foo --timeout=1" \
25+
t0303-credential-external.sh
26+
27+
If your helper requires additional setup before the tests are started,
28+
you can set GIT_TEST_CREDENTIAL_HELPER_SETUP to a sequence of shell
29+
commands.
30+
'
31+
432
. ./test-lib.sh
533
. "$TEST_DIRECTORY"/lib-credential.sh
634

0 commit comments

Comments
 (0)