Merge branch 'stable-2.16' into stable-3.0

* stable-2.16:
  FakeGroupAuditService: Make auditEvents final
  ErrorProne: Increase severity of MutableConstantField to ERROR
  ConfigUpdatedEvent: Use immutable type in field declaration
  Add missing slf4j dependencies in BUILD file
  JGitMetricModule: fix WindowCache miss ration which wasn't reported
  Revert "JGitMetricModule: Replace anonymous Supplier instances with method references"
  Suppress generic logging on docker start for ElasticSearch container
  Replace deprecated OptionParser with ArgumentParser

Change-Id: I36a7ce5c043bd43d90fb415fcec67440db2b5c84
This commit is contained in:
Marco Miller
2020-02-26 16:15:31 -05:00
11 changed files with 167 additions and 103 deletions

View File

@@ -18,6 +18,7 @@ java_library(
"//lib/guice",
"//lib/httpcomponents:httpcore",
"//lib/jgit/org.eclipse.jgit:jgit",
"//lib/log:api",
"//lib/testcontainers",
"//lib/testcontainers:testcontainers-elasticsearch",
],

View File

@@ -16,6 +16,8 @@ package com.google.gerrit.elasticsearch;
import org.apache.http.HttpHost;
import org.junit.AssumptionViolatedException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.elasticsearch.ElasticsearchContainer;
/* Helper class for running ES integration tests in docker container */
@@ -74,6 +76,11 @@ public class ElasticContainer extends ElasticsearchContainer {
super(getImageName(version));
}
@Override
protected Logger logger() {
return LoggerFactory.getLogger("org.testcontainers");
}
public HttpHost getHttpHost() {
return new HttpHost(getContainerIpAddress(), getMappedPort(ELASTICSEARCH_DEFAULT_PORT));
}