Skip to content

Commit

Permalink
JAPI-524 Address wsfileio/wsfs junit failures
Browse files Browse the repository at this point in the history
- Ignores invalid fileio tests until HPCC_30117 is addressed
- WsFS conditionally provides DZ path and name if available
- Adds HPCC30117=open mvn arg in github action

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Aug 17, 2023
1 parent b6e6d26 commit 9be82bc
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/httpsUnitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,4 @@ jobs:
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 install
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
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,18 @@ public boolean uploadLargeFile(File uploadFile, DropZoneWrapper dropZone)
URLConnection fileUploadConnection = null;
URL fileUploadURL = null;
String uploadurlbuilder = UPLOADURI;
uploadurlbuilder += "&NetAddress=" + dropZone.getNetAddress();

if (dropZone.getPath().isEmpty())
{
log.error("HPCCFileSprayClient::uploadLargeFile: empty dropZone path detected!");
return false;
}

uploadurlbuilder += "&NetAddress=" + dropZone.getNetAddress() + "&Path=" + dropZone.getPath();

if (!dropZone.getName().isEmpty())
uploadurlbuilder += "&DropZoneName=" + dropZone.getName();

String path = dropZone.getPath().trim();
if (!path.endsWith("/"))
path += "/";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ HPCC SYSTEMS software Copyright (C) 2019 HPCC Systems®.

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;

import java.util.HashSet;
import java.util.Set;
Expand All @@ -44,6 +45,8 @@ 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 @@ -52,13 +55,21 @@ public class WSFileIOClientTest extends BaseRemoteTest

if (System.getProperty("lzname") == null)
System.out.println("lzname not provided - defaulting to localhost");

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 @@ -135,14 +146,15 @@ 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 @@ -152,6 +164,7 @@ 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

0 comments on commit 9be82bc

Please sign in to comment.