test: Always enable SSL for ES containers

Most of the test code assumed the test container would always be
unsecured (reachable via 'http://', no username/password, etc), but it's
possible (and the default in newer Elasticsearch versions) to configure
the container to run in a secure mode. Use the new support in
testcontainers to always enable SSL for ES so that Elasticsearch
versions will be tested similarly.

This change ensures the tests use any passwords and self-signed
certificates generated by the test container, as well as correctly using
'https://' URLs when needed.

This change uses the tests in testcontainers [1] as an example for how
to do this and ensures the docker-in-docker setup used by gerrit-ci is
supported.

[1] https://github.com/testcontainers/testcontainers-java/blob/main/modules/elasticsearch/src/test/java/org/testcontainers/elasticsearch/ElasticsearchContainerTest.java

Change-Id: Ifca5948995ec881d8e941702fef611a3455e0cb7
8 files changed
tree: a5fca05bbc43d4022c297717ff032e361f22f2cd
  1. src/
  2. BUILD
  3. external_plugin_deps.bzl
  4. Jenkinsfile
  5. LICENSE
  6. README.md
README.md

Index backend for Gerrit, based on ElasticSearch

Indexing backend libModule for Gerrit Code Review based on ElasticSearch.

This module was originally part of Gerrit core and then extracted into a separate component from v3.5.0-rc3 as part of Change-Id: Ib7b5167ce.

Note that, ElasticSearch source code is no longer Apache 2.0-licensed for versions 7.11 and newer. See ElasticSearch 2021 license change for more information.

How to build

This libModule is built like a Gerrit in-tree plugin, using Bazelisk. See the build instructions for more details.

Setup

See the setup instructions for how to install the index-elasticsearch module.

For further information and supported options, refer to the config documentation.

Integration test

This libModule runs tests like a Gerrit in-tree plugin, using Bazelisk. See the test instructions for more details.