Skip to content

Commit 32cb50d

Browse files
Solved codeRabbit comments
Signed-off-by: Bhuvanashree B S <bhuvanashree.b@cyberpwn.com>
1 parent bda525b commit 32cb50d

1 file changed

Lines changed: 6 additions & 12 deletions

File tree

uitest-admin/src/main/java/io/mosip/testrig/adminui/utility/EmailableReport.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,10 @@ public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String
9898
+ totalFailedTests + "_KI-" + totalKnownIssues;
9999
String newString = oldString.replace("-report", temp);
100100

101-
String reportDir = outputDirectory; // or System.getProperty("testng.output.dir")
102-
File orignialReportFile = new File(reportDir, oldString);
103-
logger.info("reportFile is::" + System.getProperty("user.dir") + "/" + System.getProperty("testng.output.dir")
104-
+ "/" + System.getProperty("emailable.report2.name"));
105-
106-
File newReportFile = new File(
107-
System.getProperty("user.dir") + "/" + System.getProperty("testng.output.dir") + "/" + newString);
108-
logger.info("New reportFile is::" + System.getProperty("user.dir") + "/"
109-
+ System.getProperty("testng.output.dir") + "/" + newString);
101+
File orignialReportFile = new File(outputDirectory, oldString);
102+
File newReportFile = new File(outputDirectory, newString);
103+
logger.info("reportFile is::" + orignialReportFile.getAbsolutePath());
104+
logger.info("New reportFile is::" + newReportFile.getAbsolutePath());
110105

111106
if (orignialReportFile.exists()) {
112107
if (orignialReportFile.renameTo(newReportFile)) {
@@ -115,8 +110,7 @@ public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String
115110

116111
if (ConfigManager.getPushReportsToS3().equalsIgnoreCase("yes")) {
117112
S3Adapter s3Adapter = new S3Adapter();
118-
boolean isStoreSuccess = false;
119-
boolean isStoreSuccess2 = true; // or remove this flag until a second upload is added
113+
boolean isStoreSuccess = false; // or remove this flag until a second upload is added
120114
try {
121115
isStoreSuccess = s3Adapter.putObject(ConfigManager.getS3Account(), "Adminui", null, null,
122116
newString, newReportFile);
@@ -127,7 +121,7 @@ public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites, String
127121
} catch (Exception e) {
128122
logger.error("error occured while pushing the object" + e.getMessage());
129123
}
130-
if (isStoreSuccess && isStoreSuccess2) {
124+
if (isStoreSuccess) {
131125
logger.info("Pushed report to S3");
132126
} else {
133127
logger.error("Failed while pushing file to S3");

0 commit comments

Comments
 (0)