I'm using Maven Rerun Failing Tests parameter to retry some acceptance tests written using Serenity.
Everyting seems to work well, but I noticed that the retry counter, sometimes, exceed the expected number.
For instance if I set 2 as retry number, for some test cases I'm getting:
Warning: com.***.XXXX.And e2e-be-upgrade is used(com.***.XXX)
Error: Run 1: XXX.setScenarioContext:607 » NotFound status 404 reading FindAndMana...
[INFO] Run 2: PASS
[INFO]
Warning: com.***.XXX.And user task getVarsTask was started(com.***.XXX)
[INFO] Run 1: PASS
[INFO] Run 2: PASS
[INFO] Run 3: PASS
[INFO] Run 4: PASS
[INFO] Run 5: PASS
[INFO] Run 6: PASS
Error: Run 7: XXX.xxx:43 » Runtime Task getVarsTask didn't reach the de...
[INFO] Run 8: PASS
[INFO]
Warning: com.***.xxx.XXX.And it is released(com.***.xxxx.XXX)
[INFO] Run 1: PASS
[INFO] Run 2: PASS
Error: Run 3: XXX.xxx:53 » BadRequest status 400 reading ProjectsApiCl...
[INFO] Run 4: PASS
[INFO] Run 5: PASS
[INFO] Run 6: PASS
[INFO] Run 7: PASS
[INFO] Run 8: PASS
[INFO] Run 9: PASS
[INFO] Run 10: PASS
[INFO] Run 11: PASS
[INFO] Run 12: PASS
[INFO] Run 13: PASS
Someone knows why?
Related
I am using Jenkins version of 2.289.3. And I am working on a Maven-TestNG Selenium project in it. I have added Build Timestamp plugin and setup it in Manage Jenkins -> Configure System -> Build Timestamp with a pattern yyyy.MM.dd.HH.mm.ss of Asia/Calcutta. I am using Publish Html reports in Post Build action of that job's configuration. I have given path for HTML directory to archive is:
test-output\reports\report_${BUILD_TIMESTAMP}
But when running this job, the time stamp is not matching for publishing html report. End-portion of my comsole output is given below:
ChromeDriver was started successfully.
Aug 03, 2021 4:55:46 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 41.343 sec - in TestSuite
Results :
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
[WARNING] Could not delete temp directory
C:\Users\CS1027C\.jenkins\workspace\SeleniumTestNG\target\surefire because Directory
C:\Users\CS1027C\.jenkins\workspace\SeleniumTestNG\target\surefire unable to be deleted.
[JENKINS] Recording test results
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:05 min
[INFO] Finished at: 2021-08-03T16:56:22+05:30
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving C:\Users\CS1027C\.jenkins\workspace\SeleniumTestNG\pom.xml to
MockTest/MockFrameTest/0.0.1-SNAPSHOT/MockFrameTest-0.0.1-SNAPSHOT.pom
channel stopped
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level
C:\Users\CS1027C\.jenkins\workspace\SeleniumTestNG\test-
output\reports\report_2021.08.03.16.54.51 to
C:\Users\CS1027C\.jenkins\jobs\SeleniumTestNG\htmlreports\HTML_20Reports
ERROR: Specified HTML directory 'C:\Users\CS1027C\.jenkins\workspace\SeleniumTestNG\test-
output\reports\report_2021.08.03.16.54.51' does not exist.
Build step 'Publish HTML reports' changed build result to FAILURE
Finished: FAILURE
Here the Chrome browser started at 4.55 but at post build action directory is created with timestamp containing 4.54. Why it is not taking the finishing time of the test? I can see a report folder generated at jenkins workspace is:
report_2021.08.03.16.55.36
Even I deleted the seconds from the time pattern, it is not matching with the generated report name. How can i fix this? Can anyone help me...Thanks in advance.
In my opinion the most probable explanation is as follows:
Build Timestamp plugin:
Export build timestamps to build env variables.
This is similar to setting environment variables via build parameters and the inline help of ☑ This project is parameterized reads:
Parameters allow you to prompt users for one or more inputs that will be passed into a build.
„passed into a build“ means that the environment variable is set before the first build step starts.
The output of a Freestyle test project with the following Execute Windows batch command build step confirms this (Timestamp plugin pattern is set to HH:mm:ss,S):
#echo off
echo Build step begin: %time%
:: let 10 seconds pass
ping -n 10 localhost > nul
echo Build step end: %time%
echo Build Timestamp: %BUILD_TIMESTAMP%
Console Output:
...
Build step begin: 21:19:33,88
Build step end: 21:19:42,90
Build Timestamp: 21:19:33,828
...
I am working with an aws serverless architecture with spring boot application. When I some time build the project using sam build in intellij, I am getting the following error.
Building codeuri: . runtime: java11 metadata: {} functions: ['MedisproutApiFunction']
Running JavaMavenWorkflow:CopySource
Running JavaMavenWorkflow:MavenBuild
Build Failed
Error: JavaMavenWorkflow:MavenBuild - 'utf-8' codec can't decode byte 0xbb in position 150889: invalid start byte
It is not showing any other error details. If I remove the newly made code changes (even though it does not had any encoding code) this error will not come. Please help me to fix this.
Already checked this link, but no answer found.
Updating Lambda to AWS through intellij plugin
I encountered the same problem today when trying to do a sam build on my machine for a Java 11 project built with Maven.
I believe the problem is this:
Maven outputs some text that is not valid UTF-8 when the Maven build fails. This happened to me because a unit test was failing.
The SAM CLI attempts to capture and trim the Maven output in some Python code, then outputs it to the console. This falls apart when the Maven output is not clean UTF-8 text.
We only get to see the Python code error caused by the invalid UTF-8 text. The Maven output is lost.
I found some hits in Google where other SAM users encountered a similar problem. Unfortunately, the workaround involves messing with Python source code that was installed as part of the SAM CLI. I prefer not to do this, but I found no cleaner solution as of today.
WORKAROUND STEPS:
Execute your SAM build in debug mode with this command:
sam build --debug
You will see more details of what SAM is doing before the error is displayed.
When the build fails, take note of the Python file and line number where the error occurred. For me, it looked like this:
2021-11-19 09:41:30,430 | JavaMavenWorkflow:MavenBuild raised unhandled exception
Traceback (most recent call last):
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflow.py", line 278, in run
action.execute()
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\java_maven\actions.py", line 36, in execute
self.subprocess_maven.build(self.scratch_dir)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\java_maven\maven.py", line 31, in build
LOG.debug("Maven logs: %s", stdout.decode("utf8").strip())
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 3795: invalid start byte
Find the offending Python file and open it in a text editor. For me, that file is:
C:\Program Files\Amazon\AWSSAMCLI\runtime\lib\site-packages\aws_lambda_builders\workflows\java_maven\maven.py
NOTE: On Windows, you need to do this step as an Administrator if the SAM CLI is installed under "Program Files".
For me, this was the Python function that was the source of the error:
def build(self, scratch_dir):
args = ["clean", "install"]
ret_code, stdout, _ = self._run(args, scratch_dir)
LOG.debug("Maven logs: %s", stdout.decode("utf8").strip())
if ret_code != 0:
raise MavenExecutionError(message=stdout.decode("utf8").strip())
Edit the code and change the "utf8" to a different character set code. This one worked for me:
def build(self, scratch_dir):
args = ["clean", "install"]
ret_code, stdout, _ = self._run(args, scratch_dir)
LOG.debug("Maven logs: %s", stdout.decode("iso8859_2").strip())
if ret_code != 0:
raise MavenExecutionError(message=stdout.decode("iso8859_2").strip())
Here is the official list of Python encodings, in case you need to try a different one on your own machine:
https://docs.python.org/3/library/codecs.html#standard-encodings
I saved my edits to the Python file, then ran the sam build again. This time I get normal output from Maven displayed.
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] DataFileEntryTest.unmarshallJsonSampleFileWithUnknownProperties:57 Unexpected exception type thrown ==> expected: <com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException> but was: <java.io.FileNotFoundException>
[ERROR] Errors:
[ERROR] DataFileEntryTest.unmarshallJsonSampleFileWithMissingProperties:49 ť FileNotFound
[ERROR] DataFileEntryTest.unmarshallValidJsonSampleFile:33 ť FileNotFound ..\test-data...
[INFO]
[ERROR] Tests run: 4, Failures: 1, Errors: 2, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.979 s
[INFO] Finished at: 2021-11-19T09:48:55-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project hello-sam: There are test failures.
[ERROR]
[ERROR] Please refer to C:\Users\jtough\AppData\Local\Temp\tmpi8or6ls5\target\surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Using the maven site plugin with the command:
mvn clean install deploy site site:deploy
gives a sequence of error messages when trying to deploy each of the site files:
Transfer finished. 3824 bytes copied in 0.015 seconds
Transfer error: java.io.IOException: Unable to create collection: https://repo.icatproject.org/repository/; status code = 400
Uploading: .//apidocs/allclasses-frame.html to https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/
#https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/allclasses-frame.html - Status code: 201
Transfer finished. 924 bytes copied in 0.015 seconds
Transfer error: java.io.IOException: Unable to create collection: https://repo.icatproject.org/repository/; status code = 400
Uploading: .//apidocs/script.js to https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/
#https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/script.js - Status code: 400
Transfer error: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/script.js. Return code is: 400
https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1- SNAPSHOT/ - Session: Disconnecting
https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/ - Session: Disconnected
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.155 s
[INFO] Finished at: 2016-05-11T11:04:11+01:00
[INFO] Final Memory: 34M/408M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.4:deploy (default-cli) on project a.a1: Error uploading site: Failed to transfer file: https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/script.js. Return code is: 400 -> [Help 1]
The error messages are shown in the example in the sonatype v3 documentation. The output is identical in structure to http://books.sonatype.com/nexus-book/3.0/reference/raw.html#_publishing_a_maven_site with a series of 400 error codes but they get [INFO] BUILD SUCCESS where I get BUILD FAILURE.
Transfer error: org.apache.maven.wagon.TransferFailedException: Failed
to transfer file:
https://repo.icatproject.org/repository/maven-sites/a/a1/1.0.1-SNAPSHOT/./apidocs/script.js.
Return code is: 400
The output in our book and your deployment is slightly different.
The 400 response that failed the build in your output is from a file deployment, where the book only has it for directory path MKCOL requests.
One reason a 400 response for a file deployment ( not directory ) may happen is that file is already present inside the repository and the repository Deployment Policy prevents overwriting existing files.
Go to the maven-sites repository configuration in Nexus. Make sure the "Deployment Policy" is set to "Allow Redeploy" - then try the deployment again.
If it still doesn't work, there should be more information in nexus.log on the server.
I followed instructions from the phonegap platform guides to create a hello world app and deploy to BB10. Had no problems with Android or iOS, but when I try to run the app on a BB10 I get this output:
$ platforms/blackberry10/cordova/run --device --keystorepass passhere --devicepass devicepasshere
[INFO] Target Z30-2ba65880 selected
[INFO] The existing debug token is valid
[INFO] Deploying debug token to target "Z30-2ba65880"
[INFO] Sending request: INSTALL_DEBUG_TOKEN
[INFO] Action: Install Debug Token
[INFO] File size: 2645
[INFO] result::success
[INFO] Populating application source
[INFO] Parsing config.xml
[INFO] Generating output files
[INFO] Package created: /Users/adriaan/Documents/phonegap/hello/platforms/blackberry10/build/simulator/bb10app.bar
[INFO] Package created: /Users/adriaan/Documents/phonegap/hello/platforms/blackberry10/build/device/bb10app.bar
[INFO] BAR packaging complete
[INFO] Sending request: INSTALL_AND_LAUNCH
[INFO] Action: Install and Launch
[INFO] File size: 78983
[INFO] Installing com.example.hello.testDev_ample_hellodf4765a1...
[INFO] Processing 78983 bytes
[INFO] actual_dname::actual_id::
[INFO] actual_version::result::failure 500 'ascii' codec can't decode byte 0xe2 in position 120: ordinal not in range(128)
I've tried this on Mountain Lion and Mavericks. On Mountain Lion I had the native and webworks sdks installed, on Mavericks only the Web Works.
Somewhere in your project some data is not correctly encoded as UTF-8. Check your filenames and file content for non UTF-8 characters and make sure you escape or replace them.
I face same issue please follow below step i resolve this issue by change the author name from bar-descriptor.xml
solution 1)
changed the author simply to "Julian Buss", recreated the debug token, cleaned the project and then I could run it on the device. Problem solved. click here
solution 2)
Remove debug token from your device or simulator please follow below step
1) goto Setting->Security and Privacy->Development Mode-> click on remove debug token button(This button is display if and only if you have install any debug token )
2) if you have not install debug token then regenerate debug token and install it.
I hope this will work This solution is work for me.
I am in need of accessing data that is produced through a maven build during a run on Jenkins which is then used in a curl command. This ultimately sends a message to a bot to post in a chat room. Plugins are not an option for this particular chat client unless I would be the one to make them. Any other plugins that would be able to execute curl or hit url are fine given I can get to the data.
Currently when I run the command
mvn surefire-report:report
I am able to see output like this from the job:
...
Results :
Failed tests:
passwordLengthRequirement(test.java.com.company.appium.suites.RegistrationTest): expected:<P[assword must be 6 characters or longer].> but was:<P[lease accept the Terms of Service].>
...
Tests in error:
SendText(test.java.com.company.appium.suites.ChatTest): Timed out after 10 seconds waiting for presence of element located by: By.xpath: //window[2]/UIAKeyboard[1]/UIAKey[5]
...
Tests run: 40, Failures: 3, Errors: 2, Skipped: 4
[ERROR] There are test failures.
Please refer to .../target/surefire-reports for the individual test results.
[INFO]
[INFO] <<< maven-surefire-report-plugin:2.16:report (default-cli) # ios_junit <<<
[INFO]
[INFO] --- maven-surefire-report-plugin:2.16:report (default-cli) # ios_junit ---
[WARNING] Unable to locate Test Source XRef to link to - DISABLED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17:26.412s
[INFO] Finished at: Mon Jan 13 11:19:25 EST 2014
[INFO] Final Memory: 16M/81M
[INFO] ------------------------------------------------------------------------
Recording test results
If there are variables that can be used to get the data that would be a huge help but I don't know what they are if they even exist. My latest attempt has been to use the Post Build Task plugin to access the build.xml or log files with completed output. When trying to grep the build.xml that is created and extract the data I need grep is not working for some reason
XML:
`<failCount>72</failCount>`
`<skipCount>4</skipCount>`
`<totalCount>76</totalCount>`
Command:
$FAIL_COUNT=grep "failCount" ../../builds/$BUILD_NUMBER/build.xml | cut -d">" -f2,2 | cut -d"<" -f1,1
Output:
+ =grep failCount ../../builds/25/build.xml
/var/folders/2b/jv3l9cys1sqbbk6l2hxx_n1000007c/T/hudson6366869578068337646.sh: line 3: =grep: command not found
This page has been helpful with getting other variables but does not list what could be available during a maven run
https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables
The message I am ultimately trying to send would be something like
Finished with status '$BUILD_STATUS'. Total tests run '$TOTAL_COUNT'. Total failed tests '$FAIL_COUNT'.
Thanks in advance for any suggestions.