Skip to content

Commit

Permalink
HPCC4J-594 Add support for skipping tests
Browse files Browse the repository at this point in the history
- Updated version of surefire plugin to support excludes file
- Added logic to generate an excludes file to GH actions
- Separated test subproject test runs in GH actions
- Removed old tests
- Fixed surefire upgrade issues
- Added excluded-tests.txt file with examples

Signed-off-by: James McMullan [email protected]
  • Loading branch information
jpmcmu committed May 29, 2024
1 parent f088b3d commit 6328081
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 124 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/baremetal-regression-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,22 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build with Maven
run: mvn -B --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false -Dhpccconn=http://eclwatch.default:8010 -Dwssqlconn=http://sql2ecl.default:8510 -DHPCC30117=open install
- name: Exclude Tests
env:
EXCLUDES: ${{ vars.EXCLUDED_TESTS }}
run: |
echo $EXCLUDES >> excluded-tests.txt
- name: Build Project
run: mvn clean install -DskipTests=true

- name: Run Commons-HPCC Tests
run: mvn -pl commons-hpcc --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false verify

- name: Run WSClient Tests
run: mvn -pl wsclient --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false -Dhpccconn=http://eclwatch.default:8010 -Dwssqlconn=http://sql2ecl.default:8510 verify

- name: Run DFSClient Tests
run: mvn -pl dfsclient --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false -Dhpccconn=http://eclwatch.default:8010 verify


19 changes: 17 additions & 2 deletions .github/workflows/k8s-regression-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,20 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build with Maven
run: mvn -B --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false -Dhpccconn=https://eclwatch.default:8010 -Dwssqlconn=https://sql2ecl.default:8510 -DHPCC30117=open install
- name: Exclude Tests
env:
EXCLUDES: ${{ vars.EXCLUDED_TESTS }}
run: |
echo $EXCLUDES >> excluded-tests.txt
- name: Build Project
run: mvn clean install -DskipTests=true

- name: Run Commons-HPCC Tests
run: mvn -pl commons-hpcc --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false verify

- name: Run WSClient Tests
run: mvn -pl wsclient --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false -Dhpccconn=https://eclwatch.default:8010 -Dwssqlconn=https://sql2ecl.default:8510 verify

- name: Run DFSClient Tests
run: mvn -pl dfsclient --activate-profiles jenkins-on-demand -Dmaven.gpg.skip=true -Dmaven.javadoc.skip=true -Dmaven.test.failure.ignore=false -Dhpccconn=https://eclwatch.default:8010 verify
3 changes: 3 additions & 0 deletions commons-hpcc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.version}</version>
<configuration>
<excludesFile>../excluded-tests.txt</excludesFile>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
1 change: 1 addition & 0 deletions dfsclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<value>org.hpccsystems.ws.client.TestResultNotifier</value>
</property>
</properties>
<excludesFile>../excluded-tests.txt</excludesFile>
</configuration>
</plugin>
<plugin>
Expand Down
3 changes: 3 additions & 0 deletions excluded-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# See: https://maven.apache.org/surefire/maven-surefire-plugin/examples/inclusion-exclusion.html#multiple-formats-in-one
# Example:
# **/*RampsDevRegressionTest.java
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<maven.deploy.version>2.8.2</maven.deploy.version>
<maven.install.version>2.5.2</maven.install.version>
<maven.jar.version>3.0.2</maven.jar.version>
<maven.surefire.version>2.22.1</maven.surefire.version>
<maven.surefire.version>3.2.5</maven.surefire.version>
<antlr.version>4.10.1</antlr.version>
<javax.mail.version>1.4</javax.mail.version>
<jsch.version>0.1.54</jsch.version>
Expand Down Expand Up @@ -213,6 +213,7 @@
<configuration>
<argLine>${argLine}</argLine>
<groups>${groups}</groups>
<excludesFile>excluded-tests.txt</excludesFile>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -433,6 +434,7 @@
<configuration>
<argLine>${argLine}</argLine>
<groups>${groups}</groups>
<excludesFile>excluded-tests.txt</excludesFile>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -485,6 +487,7 @@
<configuration>
<argLine>${argLine}</argLine>
<groups>${groups}</groups>
<excludesFile>excluded-tests.txt</excludesFile>
</configuration>
</plugin>
</plugins>
Expand Down Expand Up @@ -560,6 +563,7 @@
<configuration>
<argLine>${argLine}</argLine>
<groups>${groups}</groups>
<excludesFile>excluded-tests.txt</excludesFile>
</configuration>
</plugin>
</plugins>
Expand Down
1 change: 1 addition & 0 deletions wsclient/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
<value>org.hpccsystems.ws.client.TestResultNotifier</value>
</property>
</properties>
<excludesFile>../excluded-tests.txt</excludesFile>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public class WSFileIOClientTest extends BaseRemoteTest
private final static String testfilename = System.getProperty("lztestfile", "myfilename.txt");
private final static String targetLZ = System.getProperty("lzname", "localhost");
private final static String targetLZPath = System.getProperty("lzpath", "/var/lib/HPCCSystems/mydropzone");
private final static String HPCC_30117 = System.getProperty("HPCC30117", "fixed");

static
{
Expand All @@ -57,18 +56,12 @@ public class WSFileIOClientTest extends BaseRemoteTest

if (System.getProperty("lzpath") == null)
System.out.println("lzpath not provided - defaulting to /var/lib/HPCCSystems/mydropzone");

if (System.getProperty("HPCC30117") == null)
System.out.println("HPCC30117 status not provided - defaulting to fixed");
else
System.out.println("HPCC30117 status: '" + HPCC_30117 + "'");
}

@Test
public void copyFile() throws Exception
{
Assume.assumeFalse("Test not valid on containerized HPCC environment", client.isTargetHPCCContainerized());
assumeTrue("Ignoring test 'copyFile' because HPCC-30117 is not fixed", HPCC_30117.equalsIgnoreCase("fixed"));
String lzfile=System.currentTimeMillis() + "_csvtest.csv";
String hpccfilename="temp::" + lzfile;
client.createHPCCFile(lzfile, targetLZ, true);
Expand Down Expand Up @@ -145,15 +138,13 @@ public void copyFile() throws Exception
public void AcreateHPCCFile() throws Exception, ArrayOfEspExceptionWrapper
{
Assume.assumeFalse("Test not valid on containerized HPCC environment", client.isTargetHPCCContainerized());
assumeTrue("Ignoring test 'copyFile' because HPCC-30117 is not fixed", HPCC_30117.equalsIgnoreCase("fixed"));
System.out.println("Creating file: '" + testfilename + "' on LandingZone: '" + targetLZ + "' on HPCC: '" + super.connString +"'");
Assert.assertTrue(client.createHPCCFile(testfilename, targetLZ, true));
}

@Test
public void BwriteHPCCFile() throws Exception, ArrayOfEspExceptionWrapper
{
assumeTrue("Ignoring test 'copyFile' because HPCC-30117 is not fixed", HPCC_30117.equalsIgnoreCase("fixed"));
System.out.println("Writing data to file: '" + testfilename + "' on LandingZone: '" + targetLZ + "' on HPCC: '" + super.connString +"'");
byte[] data = "HELLO MY DARLING, HELLO MY DEAR!1234567890ABCDEFGHIJKLMNOPQRSTUVXYZ".getBytes();
Assert.assertTrue(client.writeHPCCFileData(data, testfilename, targetLZ, true, 0, 20));
Expand All @@ -163,7 +154,6 @@ public void BwriteHPCCFile() throws Exception, ArrayOfEspExceptionWrapper
public void CreadHPCCFile() throws Exception, ArrayOfEspExceptionWrapper
{
Assume.assumeFalse("Test not valid on containerized HPCC environment", client.isTargetHPCCContainerized());
assumeTrue("Ignoring test 'copyFile' because HPCC-30117 is not fixed", HPCC_30117.equalsIgnoreCase("fixed"));

System.out.println("reading data from file: '" + testfilename + "' on LandingZone: '" + targetLZ + "' on HPCC: '" + super.connString +"'");
byte[] data = "HELLO MY DARLING, HELLO MY DEAR!1234567890ABCDEFGHIJKLMNOPQRSTUVXYZ".getBytes();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

import org.hpccsystems.ws.client.wrappers.ArrayOfEspExceptionWrapper;
import org.hpccsystems.ws.client.wrappers.wsdfu.DFUDataColumnWrapper;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

@Ignore
@Category(org.hpccsystems.commons.annotations.IntegrationTests.class)
public class RampsDevRegressionTest extends EclParseRegressionTest
{
Expand Down

0 comments on commit 6328081

Please sign in to comment.