Allure Life Cycle Not Triggered When Running Tests via jar file #2862
Replies: 2 comments 1 reply
-
@baev - I'm sorry for bothering you by tagging, but if you get a chance, could you please review this issue? It has been a blocker for a long time, and I haven't found any relevant answers in the community. Thank you. |
Beta Was this translation helpful? Give feedback.
-
I found the root cause for the issue - |
Beta Was this translation helpful? Give feedback.
-
Title:
Allure Results Not Generated When Running JAR File with
-Dallure.results.directory
PropertyDescription:
We are facing an issue where Allure test results are not being generated in the expected directory when running our test project as a standalone JAR file. The system property
allure.results.directory
is set via the-D
argument at runtime, and when accessed within the tests usingSystem.getProperty("allure.results.directory")
, it returns the expected path. However, no Allure result files are actually created in the specified location.Current Setup:
Project Build Process:
Execution Command:
The JAR is executed with the following command:
Code Snippet to Verify Property:
Inside the test runner, the following code is used to verify the property value:
The correct path is printed, confirming that the system property is being set properly.
Issue Details:
allure.results.directory
path is correctly read within the test code.- Upon research it was found that the allure lifecycle is triggered by junit, but in this case since the run is triggered as java -jar the life cycle is not generated. How the Lifecycle can be setup?
Troubleshooting Steps Taken:
Validated Property Setting:
System.getProperty("allure.results.directory")
to confirm it's correctly set at runtime.Checked JAR Execution Behavior:
Manual Directory Verification:
Build Configuration Checks:
allure-junit5
,allure-commandline
).build.gradle
file.Execution Order:
-D
property is passed before-jar
.Tried adding the Allure.step("Sample Test") statement explicitly:
Request for Help:
We would appreciate insights or suggestions on:
Beta Was this translation helpful? Give feedback.
All reactions