Allow to enable note DB for all integration tests

So far only a subset of the tests have a configuration where the
note DB is enabled.

Remove the configuration from these tests, and instead allow the note
DB configuration to be enabled for all tests by setting an environment
variable, GERRIT_ENABLE_NOTEDB:

 GERRIT_ENABLE_NOTEDB=TRUE buck test --no-results-cache

When the variable is set and has a value "TRUE", "YES" or "Y" (case
insensitive), the note DB is enabled for all integration tests.

Note that when switching between enabled and disabled note DB, the
--no-results-cache option must be specified, otherwise buck will not
actually run the tests again with the different setting.

Enabling the note DB exposes a number of failures in tests that were
not previously being run with note DB:

FAIL com.google.gerrit.acceptance.api.change.ChangeIT
FAIL com.google.gerrit.acceptance.api.change.CheckIT
FAIL com.google.gerrit.acceptance.api.revision.RevisionIT
FAIL com.google.gerrit.acceptance.git.SubmitOnPushIT
FAIL com.google.gerrit.acceptance.rest.change.SubmitByCherryPickIT
FAIL com.google.gerrit.acceptance.rest.change.SubmitByFastForwardIT
FAIL com.google.gerrit.acceptance.rest.change.SubmitByMergeAlwaysIT
FAIL com.google.gerrit.acceptance.rest.change.SubmitByMergeIfNecessaryIT
FAIL com.google.gerrit.acceptance.rest.change.SubmitByRebaseIfNecessaryIT
FAIL com.google.gerrit.acceptance.server.project.CustomLabelIT

This commit does not fix any of these failures; they will be addressed
separately in followup commits.

Change-Id: I09f513c352ba6b37b415ad804ad0a7c0a5cc3c6d
This commit is contained in:
David Pursehouse
2015-10-22 17:40:34 +09:00
parent 7722378708
commit 39db6c73e6
8 changed files with 20 additions and 49 deletions

View File

@@ -31,10 +31,7 @@ import com.google.gerrit.extensions.common.ChangeInfo;
import com.google.gerrit.extensions.common.EditInfo;
import com.google.gerrit.extensions.common.LabelInfo;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.server.notedb.NotesMigration;
import com.google.gerrit.testutil.ConfigSuite;
import org.eclipse.jgit.lib.Config;
import org.eclipse.jgit.revwalk.RevCommit;
import org.joda.time.DateTime;
import org.joda.time.DateTimeUtils;
@@ -48,11 +45,6 @@ import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
public abstract class AbstractPushForReview extends AbstractDaemonTest {
@ConfigSuite.Config
public static Config noteDbEnabled() {
return NotesMigration.allEnabledConfig();
}
protected enum Protocol {
// TODO(dborowitz): TEST.
SSH, HTTP