Skip to content

Commit

Permalink
Fix issue when installing multiple test cluster plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Feb 14, 2024
1 parent dbc653e commit ede615b
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ public synchronized void start(Version version) {
createConfigDirectory();
copyExtraConfigFiles(); // extra config files might be needed for running cli tools like plugin install
copyExtraJarFiles();
installPlugins();
if (distributionDescriptor.getType() == DistributionType.INTEG_TEST) {
installModules();
}
installPlugins();
currentVersion = spec.getVersion();
} else {
createConfigDirectory();
Expand Down Expand Up @@ -591,7 +591,7 @@ private void configureSecurity() {

private void installPlugins() {
if (spec.getPlugins().isEmpty() == false) {
Pattern pattern = Pattern.compile("(.+)(?:-\\d\\.\\d\\.\\d-SNAPSHOT\\.zip)?");
Pattern pattern = Pattern.compile("(.+)(?:-\\d+\\.\\d+\\.\\d+(-SNAPSHOT)?\\.zip)");

LOGGER.info("Installing plugins {} into node '{}", spec.getPlugins(), name);
List<Path> pluginPaths = Arrays.stream(System.getProperty(TESTS_CLUSTER_PLUGINS_PATH_SYSPROP).split(File.pathSeparator))
Expand All @@ -603,8 +603,8 @@ private void installPlugins() {
.map(
pluginName -> pluginPaths.stream()
.map(path -> Pair.of(pattern.matcher(path.getFileName().toString()), path))
.filter(pair -> pair.left.matches())
.map(p -> p.right.getParent().resolve(p.left.group(1)))
.filter(pair -> pair.left.matches() && pair.left.group(1).equals(pluginName))
.map(p -> p.right.getParent().resolve(p.left.group(0)))
.findFirst()
.orElseThrow(() -> {
String taskPath = System.getProperty("tests.task");
Expand Down

0 comments on commit ede615b

Please sign in to comment.