Jenkins Running xUnit Tests Code 58 - msbuild

This has me completely stumped. I have a Jenkins build configured to run some xUnit tests in my solution via an MSBuild script.
When it gets to the task to run the tests I get a failure message:
error MSB3073: The command .... exited with code 58.
I can't even find any info on what error code 58 is.
If I copy the command to a CMD window and run it it runs perfectly so the command itself is definitely correct. Any ideas what error code 58 is? Or has anyone seen this problem before and have a solution?

Related

Unexpected job aborting in jenkins when using katalon to execute automatic tests

I’m executing automatic tests using Katalon in console mode.
Sometimes job executed by Jenkins ends unexpectedly without any error.
Katalon Studio version 5.10.1,
Jenkins version 2.121.3
I've tried to find some Jenkins logs other than console logs, which logged why that job is aborted
Jenkins console logs:
/var/lib/jenkins/.katalon/5.10.1/Katalon_Studio_Linux_64-5.10.1/katalon -noSplash -runMode=console -projectPath=/var/lib/jenkins/workspace/(...) -browserType=Firefox -testSuitePath=Test Suites/MainTestingSuite
Delete folder: Libs
Opening project file: /var/lib/jenkins/workspace/(...).prj
Request sent successfully.
[EL Warning]: 2019-05-10 13:54:15.046–Ignoring attribute [lastRun] on class [TestSuiteEntity] as no Property was generated for it.
**Build step ‘Execute shell’ changed build result to UNSTABLE**
Got SIGTERM, exiting
In exit
Terminating xvnc.
$ vncserver -kill :80
Killing Xvnc4 process ID 29224
Archiving artifacts
‘Reports/MainTestingSuite/’ doesn’t match anything, but ‘’ does. Perhaps that’s what you mean?
No artifacts found that match the file pattern “Reports/MainTestingSuite/”. Configuration error?
Recording test results
ERROR: Step ‘Publish JUnit test result report’ failed: No test report files were found. Configuration error?
Finished: FAILURE
Someone already had that problem? How to track that case?
I’m waiting for your answer.
I’ve finally found cause of that problem.
Katalon job failed like that, when you try executed two Katalon instances at the moment. I’ve changed number of executors at jenkins to 1, and problem is not occuring anymore.
Best Regards

TFS 2015 Command Line build task fails after executing xUnit tests but there's no error/issue

In the build definition in TFS 2015, I've got a Command Line step that runs the following command:
xunit.console.exe \PathToTests\Tests.dll -xml \PathToResultsFolder\Results.xml
During the build, I can see the tests are being discovered and executing and everything's looking good.
But if I don't check "Continue on error" in the Command Line step, after the tests run and the result XML file has been saved, the step fails with the following error:
Task CmdLine failed. This caused the job to fail. Look at the logs for the task for more details.
But there's actually no error or anything I can see. The tests have run and the XML file has saved properly and is able to published to TFS. And I don't see an error like this if I run the command from the build machine.
Any ideas?

Empty codeception report, causes Jenkins build failure

In our Yii project we're using Jenkins CI and Codeception for different types of tests. The problem is, that codeception report is empty, which causes whole Jenkins build failure.
All tests are running without errors. Jenkins execute shell for codeception:
php codecept.phar run --xml --html
Console output error line which causes failure:
[xUnit] [ERROR] - The result file '/var/lib/jenkins/jobs/project/workspace/code/protected/tests/_output/report.xml' for the metric 'PHPUnit' is empty. The result file has been skipped.
I understand simple logic, if report is empty -> build failed. But why is report empty? Is that a bug or can I do something about this?
The problem was, that in one of our tearDowns was the following line:
Yii::app()->end();
which makes Yii-Application die. For some reasons this caused that codeception has not generated the report.

TeamCity config fails on cleanup of selenium-server.jar

I've setup a TC configuration ready to run Selenium tests once we get a build agent able to run them.
This is the first TC config I've created but it was running until I got TC to run the Selenium test runner. Now it fails when it tries to cleanup the Selenium-server.jar.
Can you exclude file types from the cleanup or is there another solution that I'm missing here?
TC build errors;
> Problem reported from build script. New build status text is: : {build.status.text}; Swabra cleanup failed
> Error while applying patch: Error while applying patch: Failed to delete: C:\BuildAgent\work\f43641868cf93216\src\django_selenium\selenium-server.jar
You can configure Swabra cleaner to ignore your selenium-server.jar using path rule:
-:src\django_selenium\selenium-server.jar
but it looks like there is a problem in selenium tests setup. The error message you posted may be caused by some process (most probably, selenium server) still running after tests are finished. It has locked the library and thats why swabra can't delete it.

Jenkins succeed when unit test fails (Rails)

I'm barely started to use Jenkins and this is the first problem I've had so far. Basically my jenkins job always succeed even when an error happened in some of the tests. This is what I'm running in the shell config:
bundle install
rake db:migrate:reset
rake test:units
rake spec:models
Thing is that Jenkins only reports a failure when the task which fails is the last one. For instance, if I put "rake test:units" the last task it will notify an error if something go wrong. Using this configuration I only get error reports for the rspec tests but not for the unit tests.
Anyone wondering why I don't only use rspec or unit test, we are currently migrating to rspec but this problem is still painful.
This is part of the log from Jenkinsm as you can see one of the unit test fails but jenkins still finish with success.
314 tests, 1781 assertions, 1 failures, 0 errors, 0 skips
rake aborted!
Command failed with status (1): [/var/lib/jenkins/.rvm/rubies/ruby-1.9.3-p1...]
Tasks: TOP => test:units
(See full trace by running task with --trace)
Lot of rspec tests here....
Finished in 3.84 seconds
88 examples, 0 failures, 42 pending
Pushing HEAD to branch master of origin repository
Pushing HEAD to branch master at repo origin
Finished: SUCCESS
Jenkins executes the commands you type into a Build Step box by writing them to a temporary file and then running the script using /bin/sh -xe.
Usually this produces the desired effect: Commands are executed in sequence (and printed) and the script aborts immediately when a command fails i.e. exits with non-zero exit code.
If this is not happening to you, the only reason can be that you have overridden this behavior. You can override it by starting the first line of your Build Step with these two characters: #!.
For example, if your Build Step looks like this:
#!/bin/bash
bundle install
rake db:migrate:reset
rake test:units
rake spec:models
Then it means Jenkins will write the script to a temporary file and it will be executed with /bin/bash. When invoked like that, bash will execute commands one-by-one and not care if they succeed. The exit code of the bash process will be the exit code of the last command in the script and that will be seen by Jenkins when the script ends.
So, take care in what you put on the first line of the Build Step. If you do not know how shell works, do not put a hash-bang at all and let Jenkins decide how the script should be run.
If you need more control over how the Build Step is executed, you should study the man page of the shell you use to find out how to make it behave the way you want. Jenkins doesn't have much of a role in here. It just executes the shell you wanted the way you wanted.
Jenkins can only see the result code of the last command run so it has no way of knowing what the result of rake test:units is.
The easiest thing is probably to have each command of those commands as a separate jenkins build step.
An alternative solution is change your first line to the following:
#!/bin/bash -e
This tells your script to fail if any of the commands in the script return an error.
See: Automatic exit from bash shell script on error