How to display exact error for failed Azure DevOps Pipeline in summary? - azure-devops

I am using Azure DevOps pipeline to run my automation test cases.
I am facing an issue that whenever my test run task fails, it doesn't display me the exact error that why the task failed, it just displays "cmd.exe exited with code '1' " for all test lists in the Summary section and the email.
Is there a way I can recieve the information that which test case failed and why in the summary section and email?
I have 5 cmd tasks in my pipeline, each of them has same configuraion, just the test list name is different.

Related

Test Execution fails when VM is not connected through RDP

I am trying to run the Test Compelete Scripts on a virtual machine through Azure DevOps pipeline.
When I run the Azure Devops pipeline release. Execution starts in VM. But when I check the logs I see that the user action in the Test scripts are not performed.
Eg: My application is launched, and next steps when I have to select a radio button execution fails and also in
TE log I can see "User session is disconnected and also I can see that it is not able to identify the object)
You typically get this error when the test is run from a scheduled task with the Run whether user is logged on or not option. The error occurs because in this case the test is run in a non-interactive session and cannot interact with the GUI.
To resolve the problem, do the following:
Modify properties of the scheduled task to use the Run only when the
user is logged on option and specify the user account under which
the task will be run.
Make sure that the specified user is logged into the system when the
task is triggered.
Here is the document you can refer to.

Error and stack trace messages are getting cut off in the Azure DevOps pipeline test results

I am running some tests in azure pipelines which generate a xml report. The report is visible under the 'tests' tab. Failed test cases contains a huge error message and a stack trace which gets cut off inside that error message box. Is there any way I can see the full message no matter how long it is?
Attached is the screen shot for that page in azure devops to convey better understanding.

Publishing test results in AzureDevops Hangs

We are using the Publish Test Results task PublishTestResults#2 to publish junit type results in a pipeline in Azure Devops. It has previously worked fine but is now hanging for 10mins (I think this is the default job timeout) and then failing, even though the results have been published. If I try to cancel the job when it starts hanging, the cancel request is ignored and the job continues to hang. Has anyone else experienced similar?
This is the log output whilst the task is hanging
Starting: PublishTestResults
==============================================================================
Task : Publish Test Results
Description : Publish test results to Azure Pipelines
Version : 2.160.0
Author : Microsoft Corporation
Help : https://learn.microsoft.com/azure/devops/pipelines/tasks/test/publish-test-results
==============================================================================
##[warning]An error occurred while sending the request.
Publishing test results to test run '1033544'.
TestResults To Publish 11, Test run id:1033544
Test results publishing 11, remaining: 0. Test run id: 1033544
Async Command Start: Publish test results
We eventually nailed this down to only occurring on agents running as a service, rather than interactively. The problem is that our agents are behind a proxy. We provided the proxy settings as per the instructions but it appears the Publish Test Results task doesn't use that settings, so we had to provide it to the environment that runs the service as well by editing runsvc.sh:
export HTTP_PROXY=http://ourproxy:8080/
export NO_PROXY=localhost,127.0.0.1,localaddress
export HTTPS_PROXY=http://ourproxy:8080/
Publishing test results in AzureDevops Hangs
According to the error message:
[warning]An error occurred while sending the request.
It shows that an error was encountered while sending the request, you could enable the debug log by changing the default variables system.debug to true.
If it worked fine previously and you haven't changed your build definition, then the problem should be caused by your network or Azure devops agent server. You could use private agent to check if it related to the hosted agent.
Besides, for the cancel request is ignored and the job continues to hang, you could set the Build job cancel timeout in minutes in the build options:
So, it won't hang your job all the time.
Hope this helps.
We had the same issue and it really looks like a proxy problem. Since we don't need result files uploaded, the following 'input' helped:
publishRunAttachments: false

Job failed error when I try to run an excel test script on Botium v1.7.5

I recently deployed Botium v1.7.5 and have been getting "Job failed: Error: Worker finished with error" error. The bot does not detect any user utterance at all and ends the test session with a fail.
I included screenshots of my test case settings, test result and excel sheet containing test cases
I created a test set from manually chatting with my bot, through a feature in Botium, ran it, and it passed.

Teamcity interaction with powershell script

I have a powershell script that runs for ~30 minutes (waiting on various process' to finish). At the end, it writes a message to the event log, determining if the process was a success or failure. I plan on hosting this script on teamcity and want the build to fail, but don't know how to handle the interaction between the script and teamcity in order for this to happen.
I'm looking for a way to make a powershell script that is ran remotely to communicate to teamcity whether it was a failure or success. I've read up on a lot of the teamcity documentation and I'm still not sure how to start going about this.
You should probably consider using TeamCity Service Messages, or specifically Reporting Build Problems.
An example of how to emit a service message using PowerShell (assuming you're using the PowerShell build step):
Write-Output "##teamcity[buildStatus text='I am a successful build']"
or
Write-Output "##teamcity[buildProblem description='$powershell_error_message']"
where you can inject the captured powershell error message.
To intentionally fail a build in teamcity you should use "[Environment] :: Exit (1)" instead of "Exit 1".
More information can be obtained at the link below:
https://confluence.jetbrains.com/display/TCD9/PowerShell