Re: [PATCH v2 2/2] t: add tests for pull --verify-signatures
From: Junio C Hamano <hidden>
Date: 2017-12-12 19:03:54
Hans Jerry Illikainen [off-list ref] writes:
+test_expect_success GPG 'pull unsigned commit with --verify-signatures' ' + test_must_fail git pull --ff-only --verify-signatures unsigned 2>pullerror && + test_i18ngrep "does not have a GPG signature" pullerror +'
Note that this is without "when-finished"; if 'git pull' got broken and does not fail as expected, the next test will start from a state that it is not expecting. Same for the ones that run 'git pull' under test_must_fail. Interestingly, the tests that do expect 'git pull' to succeed protect themselves with "when-finished" mechanism correctly [*1*], like so:
+test_expect_success GPG 'pull signed commit with --verify-signatures' ' + test_when_finished "git checkout initial" && + git pull --verify-signatures signed >pulloutput && + test_i18ngrep "has a good GPG signature" pulloutput +' +
Other than that, looked nicely done. Thanks.
[Footnote]
*1* I am guessing that the branches that are being pulled in tests
are designed in such a way to never produce merge conflicts, and
failures are possible only due to signature verification. If
that were not the case, "when-finished" would want to do a hard
reset before checking out the initial to go back to a known
state.