can see allure result in jenkins with codeceptjs - jenkins

I am trying to see allure results on Jenkins.
I am using from my jenkins
codeceptjs run --plugins allure
then on codeceptjs folder, the output generated.
I downloaded allure 2.7 and try to set it.
my path is Results :
target/allure-results
when I run the build I am getting
allure-results does not exists
any my allure test is 0...
what can be done?

the issue is resolved.
This is allure bug.
Need to give path without spaces and spacial cricketers .

Related

Jenkins allure report is blank for python behave BDD

Hi I am very new to the python BDD and looking to generate a allure report in Jenkins .
However when I have integrated the allure in jenkins the report is coming blank.
This is my build script:
and this is post build configuration:
I have referred this link Allure Jenkins behave BDD report generating blank report
and other links as well;however no success.
Can anyone please help me
In Jenkins - Dashboard->Manage Jenkins->Install "Allure Jenkins" and "ShiningPanda Plugin"
Then
Goto Manage Jenkins->Global Tool Configuration
Click on Allure Commandline Installations->enter Allure in Name
In Configuration->in Build Steps->click on Custom Python Builder
In Home section->enter you python installation path->open cmd and enter->where python->enter
then again add second Custom Python Builder and enter command->
behave -f allure_behave.formatter:AllureFormatter -o allure-results features/bankmanagerlogin.feature -D browser=chrome -D env=UAT
Add allure report

How to create an allure report in multi module project

I am able to create allure report for my automation tests at individual module level and works fine locally but that doesn't seem to work on Jenkins where all modules are run as part of pipeline and i guess jenkins is unable to find an aggregated allure report at project directory level. Is there a way to handle/solve this? Any suggestions appreciated.
enter image description here
On Jenkins an empty report is attached and log reads -
$ /opt/fsroot/tools/ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation/2.13.1/bin/allure generate -c -o /opt/fsroot/workspace/Flow/~/--tests/allure-report
allure-results does not exists
Report successfully generated to /opt/fsroot/workspace/Flow/~/--tests/allure-report
Allure report was successfully generated.
prerequisite : allure plugin is installed in Jenkins
After test stage use below in post stage
post {
always {
allure includeProperties: false, jdk: '', results: [[path: 'target/allure-results']]
}
}
You can always manually copy results from your modules to the project's root if the core plugin functionality doesn't work for you for some reason. Here's a Gradle example. But you can do the same for the Maven project as well.
tasks.register<Copy>("copyApiResults") {
from("${projectDir}/api/build/allure-results")
into("${buildDir}/allure-results")
}
tasks.register<Copy>("copyUiResults") {
from("${projectDir}/ui/build/allure-results")
into("${buildDir}/allure-results")
}

Can I generate allure report show in jenkins by testng?

I can get the expected allure report by "allure serve" or "allure serve allure-results" .
But when i want it deploy in jenkins, comes the problem. the report is nan... and the jenkins console show the command is "allure generate allure-results -c -o allure-report-path"..
Has anyone encounter the same question?
I solved this problem , it doesn't matters about the command, after i read the allure --help carefully. Of course allure generate ./allure-results -o ./allure-reports, the allure report shows in "allure-reports"!!

Allure Jenkins behave BDD report generating blank report

I have integrated my Acceptance testing Python Behave BDD with Jenkins and wanted to generate HTML report using Allure report. I am not seeing correct results on Allure report, as all are blank/null.
I am getting the below message from jenkins console however the folders are empty and report has no data.
C:\Program Files (x86)\Jenkins\workspace\Scs Testing>cd C:\checkouts\scs\test
C:\checkouts\scs\test>"behave --tags=#defrost_007 -f allure_behave.formatter:AllureFormatter -o C:\checkouts\scs\test\TestResults scs_acceptance_test/ "
1 feature passed, 0 failed, 1 skipped
1 scenario passed, 0 failed, 98 skipped
5 steps passed, 0 failed, 356 skipped, 0 undefined
Took 0m9.663s
C:\checkouts\scs\test>exit 0
[Scs Testing] $ "C:\Program Files (x86)\Jenkins\tools\ru.yandex.qatools.allure.jenkins.tools.AllureCommandlineInstallation\allure_2\allure-2.5.0\bin\allure.bat" generate -o "C:\Program Files (x86)\Jenkins\workspace\Scs Testing\allure-report"
allure-results does not exists
Report successfully generated to C:\Program Files (x86)\Jenkins\workspace\Scs Testing\allure-report
Allure report was successfully generated.
Creating artifact for the build.
Artifact was added to the build.
Finished: SUCCESS
Could you please give me some input?
First image - there is a zip file creating for each build however it is not able to extract it
I am myself a newbie in allure. My OS is Ubuntu. So my answer is based on what I have seen and observed on my OS.
But since this question is still open I will put in my two bits:
You report is empty because the report format is incorrect. What
happens behind the scene is when you ask behave to use allure as a
reporter tool, it creates a JSON file for the test output. In your
case you can see the output on console. JSON should be generated on
path:
C:\checkouts\scs\test\TestResults scs_acceptance_test\
Then when you give command allure generate, allure will read the
JSON file generated in previous step and create a new folder called
reports on path:
C:\checkouts\scs\test\TestResults scs_acceptance_test\reports
in which it generates and places the HTML code and serves the folder
(reports) on a server that is starts.
Your command:
~allure.bat generate -o "C:\Program Files
(x86)\Jenkins\workspace\Scs Testing\allure-report"
is incorrect. The format is allure [path-to-directory-where-you-have-your-json-file] -o [path-to-directory-where-you-want-to-generate-your-reports-directory]
I have been facing the same issue for a while. I somehow figured out a solution.
My windows batch execution command is:
pytest -s -v Test_practice_file.py --alluredir=allure-results
After updating my allure reports folder n number of times, I updated the Post-build Actions for allure report as:
-o ./allure-results
In Allure Commandline, I have selected "From Maven Central">version 2.9.0
Select the check box "Install automatically"
Save all the configurations and run your script

Jenkins TestNG plugin does not fetch results from the test-results.xml file

In my project workspace, the test-results.xml file exists inside the target\surefire-reports\testng-results.xml directory. But Jenkins fails to read the XML file and gives below error on console.
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **\target\surefire-reports\testng-results.xml
Did not find any matching files.
To ensure the file isn't too old, I had checked that the test-results.xml (and other files) belong to the latest test run. The Jenkins server is running on Ubuntu 14.04 LTS.
I'm running my tests in this manner: My project root directory has a run_tests.sh script which looks like this:
#!/bin/bash
if [ "$1" = "" ]; then
echo "Please provide a valid suite XML file name."
else
mvn clean
mvn compile
mvn clean test -Dsurefire.suiteXmlFiles="$1"
fi
I just pass the suite XML file name as a parameter to this script in Jenkins (execute shell).
Please help.
I found the solution for this.
Go to Configure of your Job
in General Tab, you may find
Advanced Button, Click on this
Check the check box of "Use custom
workspace", under this you see the Directory text box, here you copy
your Selenium Workspace Folder, for example mine is
"E:\eclipse\eclipse-workspace\WebDriveTest\"
Scroll down the page
under the Post-build Actions, Publish TestNG Results, TestNG XML
report pattern : give like this
"**/target/surefire-reports/testng-results.xml" (check this path in
the same workspace).
I hope this will help you!.
You should be using / instead of \ (since you mentioned that your Jenkins is running on a UNIX box)
Krishnan, in the testng-users Google Group, pointed out that it could be an issue with my Jenkins project workspace, and it was the same.
I changed the default workspace in my Jenkins project.
So I've added the path "$HOME/myWorkspace/myProject/" in my Jenkins project workspace, and "**/target/surefire-reports/testng-results.xml" in my TestNG setting in the same Jenkins project, and it works!
Thank you Krishan for your help.
Please see my answer in another post here, it should be very clear.
In short, it is caused by the current directory was changed to the default Jenkins workspace, you need set your custom workspace in the Job's Config.
I agree with Krishnan Mahadevan usage of '\' instead of '/' while providing the path for TestNG Report also solved my problem.
Extremely important thing to note here:
When providing path for Root POM in the build section '\' is used
C:\Users\harsh\eclipse-workspace\ProjTwo3\pom.xml
When providing path for TestNG XML report pattern in Publish TestNG Result section
'/' is used
C:/Users/harsh/eclipse-workspace/ProjTwo3/target/surefire-reports/testng-results.xml
Console Output:
channel stopped
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern:
C:/Users/harsh/eclipse-workspace/ProjTwo3/target/surefire-reports/testng-results.xml
Saving reports...
Processing 'C:\Users\harsh.jenkins\jobs\MyApplication\builds\12\testng\testng-results.xml'
11.688312% of tests failed, which exceeded threshold of 0%. Marking build as UNSTABLE

Resources