Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allure report hotfix #1490

Merged
merged 9 commits into from
Feb 22, 2024
Merged
Prev Previous commit
Next Next commit
Fixes and virtual thread and sync point added
  • Loading branch information
MustafaAgamy committed Feb 14, 2024
commit be1538dc9dacd99dcbc8481f26cd4030dd81665c
3 changes: 2 additions & 1 deletion src/main/java/com/shaft/listeners/TestNGListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,14 @@ public void onExecutionFinish() {
Thread.ofVirtual().start(JiraHelper::reportExecutionStatusToJira);
Thread.ofVirtual().start(GoogleTink::encrypt);
Thread.ofVirtual().start(ReportManagerHelper::logEngineClosure);
Thread openAllureReportAfterExecution = Thread.ofVirtual().start(AllureManager::openAllureReportAfterExecution);
try {
summaryReportGeneration.join();
allureArchiveGeneration.join();
openAllureReportAfterExecution.join();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
AllureManager.openAllureReportAfterExecution();
}

@Override
Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/shaft/tools/io/internal/AllureManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static void openAllureReportAfterExecution() {
copyAndOpenAllure();
}

public static void copyAndOpenAllure(){
private static void copyAndOpenAllure(){
FileActions.getInstance(true).copyFolder(allureOutPutDirectory, allureReportPath);
FileActions.getInstance(true).deleteFile(allureOutPutDirectory);
String newFileName = renameAllureReport();
Expand Down Expand Up @@ -160,20 +160,19 @@ private static void createAllureListenersMetaFiles() {
"io.qameta.allure.listener.StepLifecycleListener", "io.qameta.allure.listener.TestLifecycleListener").forEach(fileName -> FileActions.getInstance(true).writeToFile(Properties.paths.services(), fileName, "com.shaft.listeners.AllureListener"));
}

public static void writeAllureReport() {
private static void writeAllureReport() {
String commandToCreateAllureReport;
allureBinaryPath = allureExtractionLocation + "allure-" + SHAFT.Properties.internal.allureVersion()
+ "/bin/allure";
String outputDirectory = System.getProperty("user.dir") + File.separator + "target" + File.separator + allureReportPath;
allureOutPutDirectory = outputDirectory;
allureOutPutDirectory = System.getProperty("user.dir") + File.separator + "target" + File.separator + allureReportPath;
if (SystemUtils.IS_OS_WINDOWS) {
commandToCreateAllureReport = allureBinaryPath + ".bat" + " generate --single-file --clean '"
+ allureResultsFolderPath.substring(0, allureResultsFolderPath.length() - 1)
+ "' -o '" + outputDirectory + "'";
+ "' -o '" + allureOutPutDirectory + "'";
} else {
commandToCreateAllureReport = allureBinaryPath + " generate --single-file --clean "
+ allureResultsFolderPath.substring(0, allureResultsFolderPath.length() - 1)
+ " -o " + outputDirectory;
+ " -o " + allureOutPutDirectory;
}
TerminalActions.getInstance(false, false).performTerminalCommand(commandToCreateAllureReport);
}
Expand Down
Loading