Skip to content

Commit

Permalink
Fix DockerTests.test022InstallPlugin assertion (elastic#80741)
Browse files Browse the repository at this point in the history
Use order agnostic assertion when testing plugin installation.
https://gradle-enterprise.elastic.co/s/57wwszvhfzwnw/tests/:qa:os:destructiveDistroTest.default-dockerCloud/org.elasticsearch.packaging.test.DockerTests/test022InstallPlugin
@pugnascotia This will likely need to be included in your backport of
elastic#80734
# Conflicts:
#	qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java
  • Loading branch information
mark-vieira committed Nov 16, 2021
1 parent 41232f4 commit 1f43fad
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.elasticsearch.packaging.util.Shell.Result;
import org.elasticsearch.packaging.util.docker.DockerRun;
import org.elasticsearch.packaging.util.docker.MockServer;
import org.hamcrest.Matcher;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -187,11 +188,11 @@ public void test022InstallPlugin() {
final boolean isCloudImage = distribution().packaging == Packaging.DOCKER_CLOUD
|| distribution().packaging == Packaging.DOCKER_CLOUD_ESS;

final List<String> expectedPlugins = isCloudImage
? asList("analysis-icu", "repository-azure", "repository-gcs", "repository-s3")
: asList("analysis-icu");
final Matcher<Iterable<?>> matcher = isCloudImage
? containsInAnyOrder("repository-azure", "repository-gcs", "repository-s3", "analysis-icu")
: equalTo(List.of("analysis-icu"));

assertThat("Expected installed plugins to be listed", listPlugins(), equalTo(expectedPlugins));
assertThat("Expected installed plugins to be listed", listPlugins(), matcher);
}

/**
Expand Down

0 comments on commit 1f43fad

Please sign in to comment.