Skip to content

Commit

Permalink
If running a test (mvn -Dtest=...), then use the test name as the lau…
Browse files Browse the repository at this point in the history
…nch name. Updated version to 0.0.7
  • Loading branch information
anandbagmar committed Oct 4, 2024
1 parent 481210e commit 874735d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>com.github.znsio</groupId>
<artifactId>ReportPortalIntegration</artifactId>
<version>0.0.6</version>
<version>0.0.7</version>
<name>ReportPortalIntegration</name>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;

import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.*;
Expand Down Expand Up @@ -44,6 +45,17 @@ private static void setLaunchDescription() {

private static void setLaunchName() {
String launchName = getLaunchName();
if (null == launchName) {
String testNameProperty = System.getProperty("test");
if (null != testNameProperty) {
launchName = testNameProperty;
System.out.println("Running a test. Use test name (" + launchName + ") as launch name");
} else {
launchName = new File(System.getProperty("user.dir")).getName();
System.out.println("Use current directory name (" + launchName + ") as the launch name");
}
}
System.out.println("Launch Name: " + launchName);
parameters.setLaunchName(launchName);
}

Expand Down

0 comments on commit 874735d

Please sign in to comment.