GitProtocolV2IT: Fail if git client is too old to support v2

JUnit assumption violation is not reflected on Bazel UI: [1]. As the
consequence, if a test is passing it's not clear, it's skipped due to
assumption violation or it is passing the actual tests. Especially for
the important Gerrit features like git wire protocol v2 we must be sure
that the integration tests got actually executed and were successful.

Given that the git wire protocol test requires very recent git client
version (2.18) add git-protocol-v2 label to the test rule and provide
instructions how to skip the test in Bazel documentation.

[1] https://github.com/bazelbuild/bazel/issues/3476

Bug: Issue 12032
Change-Id: Icba99ab22fa7e99fb303eb79cf3df3b354ee3d77
This commit is contained in:
David Pursehouse
2019-12-04 20:05:07 +09:00
committed by David Ostrovsky
parent b19501d2ba
commit 180bca5b61
3 changed files with 11 additions and 4 deletions

View File

@@ -15,7 +15,6 @@
package com.google.gerrit.integration.git;
import static com.google.common.truth.Truth.assertThat;
import static com.google.common.truth.TruthJUnit.assume;
import static com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.allow;
import static com.google.gerrit.acceptance.testsuite.project.TestProjectUpdate.deny;
import static java.nio.charset.StandardCharsets.UTF_8;
@@ -63,8 +62,9 @@ public class GitProtocolV2IT extends StandaloneSiteTest {
GitClientVersion requiredGitVersion = new GitClientVersion(2, 18, 0);
GitClientVersion actualGitVersion =
new GitClientVersion(execute(ImmutableList.of("git", "version")));
// If not found, test succeeds with assumption violation
assume().that(actualGitVersion).isAtLeast(requiredGitVersion);
// If git client version cannot be updated, consider to skip this tests. Due to
// an existing issue in bazel, JUnit assumption violation feature cannot be used.
assertThat(actualGitVersion).isAtLeast(requiredGitVersion);
try (ServerContext ctx = startServer()) {
ctx.getInjector().injectMembers(this);