Skip to content

Commit

Permalink
if PROJECT_NAME is not provided, use the current directory name for r…
Browse files Browse the repository at this point in the history
…eportportal
  • Loading branch information
anandbagmar committed Apr 24, 2024
1 parent 5a93f56 commit 30edfc2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/znsio/kendo/RunTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
Expand Down Expand Up @@ -44,6 +46,7 @@ public class RunTest {
private static final String DEFAULT_TEST_DATA_FILENAME = "./src/test/java/test_data.json";

private static final String WORKING_DIR = System.getProperty("user.dir");
private static final String CURRENT_DIR_NAME = Paths.get("").toAbsolutePath().getFileName().toString();
private static final String NOT_SET = "NOT_SET";
private static final String LOCAL_RUN = "LOCAL_RUN";
private static final String NA = "N/A";
Expand Down Expand Up @@ -82,7 +85,7 @@ public RunTest() {
buildId = getOverloadedValueFor(Metadata.BUILD_ID_ENV_VAR, NOT_SET);
buildInitiationReason = getOverloadedValueFor(Metadata.BUILD_INITIATION_REASON_ENV_VAR, NOT_SET);
parallelCount = Integer.parseInt(getOverloadedValueFromPropertiesFor(Metadata.PARALLEL_COUNT, DEFAULT_PARALLEL_COUNT));
projectName = getOverloadedValueFromPropertiesFor(Metadata.PROJECT_NAME, WORKING_DIR);
projectName = getOverloadedValueFromPropertiesFor(Metadata.PROJECT_NAME, CURRENT_DIR_NAME);
rpEnable = getOverloadedValueFromPropertiesFor(Metadata.RP_ENABLE, String.valueOf(false));
testDataFile = getTestDataFileName();
testType = getOverloadedValueFromPropertiesFor(Metadata.TEST_TYPE, NOT_SET);
Expand Down Expand Up @@ -171,7 +174,7 @@ void runKarateTests() {
System.out.printf("Class: %s :: Test: runKarateTests%n", this.getClass().getSimpleName());
List<String> tags = getTags();
System.setProperty("rp.launch", projectName + " " + testType + " tests");
System.setProperty("rp.description", projectName + " " + testType + " tests");
System.setProperty("rp.description", "Running " + testType + " tests for project: " + projectName);
System.setProperty("rp.launch.uuid.print", String.valueOf(Boolean.TRUE));
System.setProperty("rp.client.join", String.valueOf(Boolean.FALSE));
System.setProperty("rp.attributes", getRpAttributes());
Expand Down

0 comments on commit 30edfc2

Please sign in to comment.