Skip to content

Commit

Permalink
[7.16] Fix DockerTests.test022InstallPlugin assertion (#80741) (#80773)
Browse files Browse the repository at this point in the history
* Fix DockerTests.test022InstallPlugin assertion (#80741)

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
#80734
# Conflicts:
#	qa/os/src/test/java/org/elasticsearch/packaging/test/DockerTests.java

* Fix compiler error
  • Loading branch information
mark-vieira authored Nov 16, 2021
1 parent 41232f4 commit 3cc5446
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(asList("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 3cc5446

Please sign in to comment.