Timestamp mismatch in Jenkins console and Project report path - selenium

I've setup Selenium with Cucumber java project in Jenkins and this project is generating report through this plugin.
plugin = {"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:" }
This plugin generating reports inside D:\ABC\ABC-Meta\output\reports 03012022_161621901\test-output\SparkReport\Index.html
I want to publish HTML reports in Jenkins by extracting reports from this folder.
For that I've used Build Timestamp plugin and usage of BUILD_TIMESTAMP variable.
Configuration Setup of BUILD_TIMESTAMP parameter in Jenkins
Now I'm using same parameter with HTML Publish report configuration
${WORKSPACE}\output\reports ${BUILD_TIMESTAMP}\test-output\SparkReport
but when this step is executed post automation execution, folder doesn't exist due to mismatch in the timestamp..
Jenkins Console Logs
Jenkins Console Logs Timestamp
Project Report Location
Project Report Location Timestamp
Any idea how could I fetch or process this Build_timestamp parameter so that I can publish HTML report in correct manner? How to use Regex so that it would capture correct value of reporting folder?

Related

can't trigger a test of some appllication via Jenkins job

I am a beginner at the field of Devops.
I have created a simple web application (jsp), using 3 Jenkins jobs to store the code in GIT, to deploy the this app into Tomcat, and also to site-monitor this app (respectively).
Now, I have been trying - with no success -to automate a simple test with 2 verifications of my app functionality, using Selenium IDE and triggering it via Jenkins job (the fourth one in my project).
In order to perform it , I created the following job on Jenkins, with the needed plugin added (which is SeleniumHQ htmlsuite Run).
Here is the job:
https://i.stack.imgur.com/6Pm6a.png
The job running has failed,giving the following error which I cant handle.
When I run it, I get the following error :
https://i.stack.imgur.com/hXGmI.png
Any help would be very appreciated
Just tick Delete workspace before build starts box under Build Environment stanza
If you don't have the option in your Jenkins job configuration - make sure that Workspace Cleanup Plugin is installed
If you're running your Selenium tests via Jenkins Pipeline - all you need to do is to put cleanWS() directive somewhere in your pipeline code or Jenkinsfile

Cannot locate CTest configuration

I am trying to perform a coverage analysis of a project in which I use CMake+CTest. I have created a simple TestingScript.cmake that looks like:
set(CTEST_SOURCE_DIRECTORY .)
set(CTEST_BINARY_DIRECTORY build_coverage)
ctest_start(TestCoverage)
ctest_coverage(BUILD ${CTEST_BINARY_DIR})
and am trying to run it with:
doriad#david-desktop:~/build/Examples/Coverage$ ctest -S ~/src/Examples/Coverage/TestingScript.cmake
Cannot locate CTest configuration: in BuildDirectory: /home/doriad/build/Examples/Coverage/build_coverage/CTestConfig.cmake
Cannot locate CTest configuration: in SourceDirectory: /home/doriad/build/Examples/Coverage/CTestConfig.cmake
Cannot find any coverage files. Ignoring Coverage request.
What do I need to do to produce this CTestConfig.cmake file that it is looking for?
The file CTestConfig.cmake is usually generated by CDash. While logged in to CDash, select Settings > Project > Miscellaneous > Download CTestConfig. The file holds the configuration to submit the results to a dashboard server.
The default settings of the module are to submit the dashboard to Kitware's Public Dashboard, where you can register your project for free.
In order to submit to some other server, CTestConfig.cmake in the top level directory of your source, and set your own dashboard preferences. If you are using a CDash server, you can download a preconfigured file from the respective project page on that server (Settings / Project, tab Miscellaneous).
Source: https://gitlab.kitware.com/cmake/community/wikis/doc/ctest/Testing-With-CTest
Another problem is that you have no coverage files to submit since you skipped the build and test steps in your testing script.

Jenkins: Error in Selenium Publish Report

I have properly configured the Seleniumhq plugin into Jenkins. I've also tried to run it in my local Jenkins and it worked. The problems I encounter are as follows:
suiteFile directory reads from C drive ONLY. Example, C:\TestSelenium\testSuite.html
When I try to specify the absolute path to my test suite (workspace), I get the error
The suiteFile is not a file or an url ! Check your build configuration.
Same thing happens with resultFile.
When I add post-build action "Publish Selenium Report," I'm getting an error because the newly created resultFile is saved into C:\TestResult\result.html and not in the workspace.

Run a project from jetty in intellij with run time info outputted to a file

I have the following scenario:
I run my application in development mode and use jetty as the web server.Maven is used to build the application. Is it possible to output the run time log to a file instead of in the IntelliJ environment ?That is instead of viewing the information in the window with the red arrow pointing towards it I want to display it in a file.
You have a Logs tab in Jetty Server running configuration where you can choose to save console output to a file.

Generation of Selenium reports using Hudson (now known as Jenkins) from JUnit XML format file

For Test Automation of web project we use Hudson, PHPUnit, and Selenium. The results of the build are stored in the JUnit XML format.
When I try to include generation of reports using the Hudson Publish JUnit test result report option, the build finishes with Failed status.
Below is my Hudson configuration to run the tests.
sudo -u apache phpunit - log-junit /var/lib/hudson/jobs/Work-stars-Tests/builds/${BUILD_ID}/ seleniumReports/seleniumTests.xml + path to test php files
Generation of reports is enabled through the Hudson configuration option «Publish JUnit test result report», where I specify the path to the folder with PHP tests.
The user we use to run Hudson has permission to write/read files in the folder with the reports. As for the path we've tried to specify both full and relative.
The error No test report files were found. Configuration error? is displayed in the console after the build.
How do we resolve this issue?
Found my own solution to this problem :)
In Hudson project configuration settings modified execute shell command to
> #!/bin/sh -x phpunit --log-junit ${WORKSPACE}/zf/tests/_tmp/reports/seleniumTests.xml
> ${WORKSPACE}/zf/tests/selenium/; sed
> -i '/<testsuite name=".*\/"/D;/^ <\/testsuite>$/D'
> ${WORKSPACE}/zf/tests/_tmp/reports/seleniumTests.xml
and set following path to Junit reports
**/zf/tests/_tmp/reports/*.xml
Problem is solved. Yahoo!