Skip to content

Extension of opensearch image, containing version as used by npo api, used in tests.

Notifications You must be signed in to change notification settings

npo-poms/opensearch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poms shared opensearch

Opensearch with plugins pre-installed, such as analysis-icu.

Opensearch currently is the distribution of Elasticsearch that is provided to us @Openshift.

This is used in junit-tests. But may also be of use if we want to deploy a cheaper version for test/acceptance environments?

Use in gitlab.ci

Set up a service like so:

.opensearch:
  services:
    - name: ghcr.io/npo-poms/opensearch:opendistro-1.13.4
      alias: opensearch  # Alias is also the hostname (i.e. http://opensearch:9200)
  script:
    - echo ES returns status code $(curl -s -o /tmp/health -w "%{http_code}" "http://opensearch:9200/_cluster/health?wait_for_status=green&timeout=50s")
    - cat /tmp/health

Test-container

Even nicer may be using test containers:

import org.testcontainers.containers.GenericContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;

...

@Testcontainers
public abstract class AbstractESPublisherRouteITest {

    @Container
    public static GenericContainer<?> opensearch = new GenericContainer<>("ghcr.io/npo-poms/opensearch:opendistro-1.13.4")
        .withExposedPorts(9200);


    @BeforeEach
    public void abstractSetup() {
        factory.setHosts(new HttpHost( opensearch.getHost(), opensearch.getMappedPort(9200)));
        ..

    }

About

Extension of opensearch image, containing version as used by npo api, used in tests.

Resources

Stars

Watchers

Forks

Packages