Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0.x] Testsuite backports #11310

Merged
merged 5 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,14 @@ pipeline {

stage('Tests') {
steps {
sh "$MAVEN_HOME/bin/mvn verify -B -V -e -Dmaven.test.failure.ignore=true -Dansi.strip=true $ALT_TEST_BUILD"

sh "$MAVEN_HOME/bin/mvn verify -B -V -e -DrerunFailingTestsCount=2 -Dmaven.test.failure.ignore=true -Dansi.strip=true $ALT_TEST_BUILD"
// Remove any default TestNG report files as this will result in tests being counted twice by Jenkins statistics
sh "rm -rf **/target/*-reports*/**/TEST-TestSuite.xml"
// TODO Add StabilityTestDataPublisher after https://issues.jenkins-ci.org/browse/JENKINS-42610 is fixed
// Capture target/surefire-reports/*.xml, target/failsafe-reports/*.xml,
// target/failsafe-reports-embedded/*.xml, target/failsafe-reports-remote/*.xml
junit testResults: '**/target/*-reports*/**/TEST-*.xml',
testDataPublishers: [[$class: 'ClaimTestDataPublisher']],
testDataPublishers: [[$class: 'ClaimTestDataPublisher'],[$class: 'JUnitFlakyTestDataPublisher']],
healthScaleFactor: 100, allowEmptyResults: true

// Workaround for SUREFIRE-1426: Fail the build if there a fork crashed
Expand Down
14 changes: 12 additions & 2 deletions anchored-keys/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,18 @@
<artifactId>metainf-services</artifactId>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<groupId>org.junit.support</groupId>
<artifactId>testng-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
16 changes: 14 additions & 2 deletions archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,20 @@

<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<groupId>org.junit.support</groupId>
<artifactId>testng-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
3 changes: 2 additions & 1 deletion build/configuration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
<version.arquillian>1.6.0.Final</version.arquillian>
<version.blockhound>1.0.6.RELEASE</version.blockhound>
<version.bouncycastle>1.70</version.bouncycastle>
<version.byteman>4.0.9</version.byteman>
<version.byteman>4.0.21</version.byteman>
<version.caffeine>3.1.1</version.caffeine>
<version.commons.compress>1.21</version.commons.compress>
<version.console>14.0.11.Final</version.console>
Expand Down Expand Up @@ -204,6 +204,7 @@
<version.rocksdb>7.1.2</version.rocksdb>
<version.rxjava>3.1.4</version.rxjava>
<version.sshd>2.10.0</version.sshd>
<version.testng.engine>1.0.4</version.testng.engine>

<!-- these versions must be kept in sync with ${version.micrometer}: -->
<version.io.prometheus>0.15.0</version.io.prometheus>
Expand Down
4 changes: 4 additions & 0 deletions cdi/embedded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@
<forkCount>1</forkCount>
<parallel>none</parallel>
<groups>${defaultTestGroup}</groups>
<properties>
<usedefaultlisteners>false</usedefaultlisteners>
<listener>${testNGListeners}</listener>
</properties>
<dependenciesToScan>
<!-- TestNGSuiteChecksTest -->
<dependency>org.infinispan:infinispan-commons-test</dependency>
Expand Down
4 changes: 4 additions & 0 deletions cdi/remote/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
<forkCount>1</forkCount>
<parallel>none</parallel>
<groups>${defaultTestGroup}</groups>
<properties>
<usedefaultlisteners>false</usedefaultlisteners>
<listener>${testNGListeners}</listener>
</properties>
<dependenciesToScan>
<dependency>org.infinispan:infinispan-commons-test</dependency>
</dependenciesToScan>
Expand Down

This file was deleted.

8 changes: 4 additions & 4 deletions cli/src/main/java/org/infinispan/cli/commands/Install.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
import org.aesh.io.FileResource;
import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
import org.infinispan.cli.artifacts.Artifact;
import org.infinispan.cli.artifacts.MavenSettings;
import org.infinispan.cli.impl.ContextAwareCommandInvocation;
import org.infinispan.cli.impl.ExitCodeResultHandler;
import org.infinispan.cli.logging.Messages;
import org.infinispan.commons.maven.Artifact;
import org.infinispan.commons.maven.MavenSettings;
import org.infinispan.commons.util.Util;
import org.kohsuke.MetaInfServices;

Expand Down Expand Up @@ -77,7 +77,7 @@ public boolean isHelp() {
public CommandResult exec(ContextAwareCommandInvocation invocation) throws CommandException {
try {
StandardCopyOption[] options = overwrite ? new StandardCopyOption[]{StandardCopyOption.REPLACE_EXISTING} : new StandardCopyOption[]{};
MavenSettings.getSettings(mavenSettings == null ? null : Artifact.fromString(mavenSettings).resolveArtifact());
MavenSettings.init(mavenSettings == null ? null : Artifact.fromString(mavenSettings).resolveArtifact());
Path serverLib = CLI.getServerHome(serverHome).resolve(serverRoot).resolve("lib");
if (clean) {
if (verbose) {
Expand All @@ -91,7 +91,7 @@ public CommandResult exec(ContextAwareCommandInvocation invocation) throws Comma
String path = parts[0];
Path resolved = null;
for (int retry = 0; retry <= retries; retry++) {
resolved = Artifact.fromString(path).verbose(verbose).force(retry == 0 ? force : true).resolveArtifact();
resolved = Artifact.fromString(path).verbose(verbose).force(retry != 0 || force).resolveArtifact();
if (resolved == null) {
throw Messages.MSG.artifactNotFound(path);
}
Expand Down
51 changes: 0 additions & 51 deletions cli/src/main/java/org/infinispan/cli/util/Utils.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
package org.infinispan.cli.util;

import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.ByteChannel;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.nio.file.NoSuchFileException;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import java.security.MessageDigest;

import org.infinispan.cli.artifacts.MavenSettings;
import org.infinispan.commons.util.Util;

public class Utils {
Expand Down Expand Up @@ -47,49 +41,4 @@ public static String digest(Path path, String algorithm) {
throw new RuntimeException(e);
}
}

public static Path downloadFile(URL url, Path dest, boolean verbose, boolean force) throws IOException {
if (Files.exists(dest)) {
if (force) {
Files.delete(dest);
if (verbose) {
System.out.printf("Deleting previously downloaded '%s' for '%s'%n", dest, url);
}
} else {
if (verbose) {
System.out.printf("Using previously downloaded '%s' for '%s'%n", dest, url);
}
return dest;
}
}
HttpURLConnection connection = (HttpURLConnection) MavenSettings.getSettings().openConnection(url);

int statusCode = connection.getResponseCode();
if (statusCode == HttpURLConnection.HTTP_NOT_FOUND) {
if (verbose) {
System.out.printf("'%s' not found%n", url);
}
return null;
}
if (statusCode == HttpURLConnection.HTTP_MOVED_TEMP
|| statusCode == HttpURLConnection.HTTP_MOVED_PERM) {
url = new URL(connection.getHeaderField("Location"));
dest = dest.resolveSibling(getFilenameFromURL(url));
connection = (HttpURLConnection) url.openConnection();
}

try (InputStream bis = connection.getInputStream()) {
Files.createDirectories(dest.getParent());
Files.copy(bis, dest, StandardCopyOption.REPLACE_EXISTING);
if (verbose) {
System.out.printf("Downloaded '%s' to '%s'%n", url, dest);
}
return dest;
}
}

public static String getFilenameFromURL(URL url) {
String urlPath = url.getPath();
return urlPath.substring(urlPath.lastIndexOf('/') + 1);
}
}
16 changes: 14 additions & 2 deletions client/hotrod-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,20 @@
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<groupId>org.junit.support</groupId>
<artifactId>testng-engine</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Loading