Run most acceptance tests in-memory

This allows the tests to run faster, with lower system overheads.
The new @UseLocalDisk annotation must be added to any test method
that wants the classical init and daemon testing strategy.

A new sshd.requestLog configuration variable is introduced to
permit tests to disable the SSH command log.

Timing for `buck test --all` on my Linux desktop:

  before 3m37.129s
  after  2m18.789s

Change-Id: I18c07ef2d913f6abbb3925b3e7d3df5d28668497
This commit is contained in:
Shawn Pearce
2013-10-17 22:15:38 -07:00
parent b23dcfdedc
commit 318bfcae5c
19 changed files with 362 additions and 98 deletions

View File

@@ -25,9 +25,9 @@ import com.google.gerrit.server.config.FactoryModule;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.config.SitePaths;
import com.google.gerrit.server.git.GitRepositoryManager;
import com.google.gerrit.server.git.LocalDiskRepositoryManager;
import com.google.gerrit.testutil.InMemoryDatabase;
import com.google.gerrit.testutil.InMemoryH2Type;
import com.google.gerrit.testutil.InMemoryRepositoryManager;
import com.google.gwtorm.server.OrmException;
import com.google.gwtorm.server.SchemaFactory;
import com.google.gwtorm.server.StatementExecutor;
@@ -74,7 +74,6 @@ public class SchemaUpdaterTest extends TestCase {
install(new SchemaVersion.Module());
Config cfg = new Config();
cfg.setString("gerrit", null, "basePath", "git");
cfg.setString("user", null, "name", "Gerrit Code Review");
cfg.setString("user", null, "email", "gerrit@localhost");
@@ -89,8 +88,8 @@ public class SchemaUpdaterTest extends TestCase {
bind(AllProjectsName.class)
.toInstance(new AllProjectsName("All-Projects"));
bind(GitRepositoryManager.class) //
.to(LocalDiskRepositoryManager.class);
bind(GitRepositoryManager.class)
.toInstance(new InMemoryRepositoryManager());
bind(String.class) //
.annotatedWith(AnonymousCowardName.class) //