HP ALM API : Execution Duration coming as 0 for the testrun which was updated using the REST API - alm

We have automated the HP ALM Testrun Execution.
Manually when we execute the Testrun, we have the option of Begin run and once execution is complete, we click on end run.
Since we have automated the testrun execution, we are updating the actual result of the test run step through the HP ALM API, the Duration column of the test run is coming as 0.
Please let us know is there any HP ALM API available to begin the testrun and end the run
Using PUT call to update the duration field of the testrun can be done, but it will be better if there is any API available.

Related

Test Run Result steps and Test Run Result Summary Details but unable to find any API related

i am trying to fetch the attachments of the Test Run Result steps and Test Run Result Summary Details but unable to find any API related to that is i need the attchments for Test Run Result Steps and attachments id, for Test Run Result Summary
A test case describes the steps to take when you run a test. Test suites are groups of test cases, and a test plan is the collection of test suites that need to be run for a particular iteration or release. Test points are the pairings of test cases with test configurations that need to be run for the test plan. A test run consists of a set of test points. The results are the outcome of running the tests in the test run.
Check out the doc
https://learn.microsoft.com/en-us/rest/api/azure/devops/test/?view=azure-devops-rest-6.0
Work with test attachments programmatically using the REST APIs for Azure DevOps Services and Azure DevOps Server
and what you need specifically is at the website
https://learn.microsoft.com/en-us/rest/api/azure/devops/test/attachments/get-test-run-attachment-zip?view=azure-devops-rest-6.0

Azure Devops -Test Data displayed in pipeline is incorrect and is displaying data which i ran in my local esktop

I needed a small help. Whenever I run the pipeline, the data being displayed in testtab is incorrect and it displays the data which I ran on my local desktop rather than the job ran on Agent.
You can run tests in test tabs using different options. You can use any to solve your problem:
Automatically inferred test result: for some popular test runners' pipeline automatically infer the test output.
This is done with the help of describing the error logs generated during build operation.
Publish Test result task: Publishes test result to azure pipeline you choose the runner for tests execution available in
any formats.
Test execution tasks: Built -in test execution tasks such as visual studio test that automatically publish tests results to the pipeline
Azure Devops also provide other way to surface the test information You can use this.
Test analytics provide rich insights into test result over a period of time, identify problematic area in your test.
The dashboard provide track of your work's progress add widgets that surface test related information.
Requirement quality
Test result trend
Deployment status
Reference: https://learn.microsoft.com/en-us/azure/devops/pipelines/test/review-continuous-test-results-after-build?view=azure-devops

Azure Devops - Test Run Managment : resuming in-progress test

Been trying to figure out how to resume an in-progress test in DevOps without any success.
In screenshot 1, you can see that I have three tests that are in progress, but there doesn't seem to be a way to resume them.
In screenshot 2, you can see that double-clicking on the in-progress test and then viewing test results DevOps shows the test is presently paused.
Reviewing other posts related to pausing and resuming tests or searching for any right-click menus or methods of resuming have not yielded any results. Looking for help resuming tests.
screenshot 1 of recent test runs from DevOps
Screenshot 2 of test results tab of a previous in-progress run
It appears it is not possible to resume the test run in question. The only solution I have seen for this is to delete the test run. The test run deletion can only be done via the Rest API as answered here: How to change a status of a Run in Azure DevOps when it wasn't complete
This doesn't say much if you don't know how to use a Rest API. User #ATCCAN mentioned in the comments of that question that this issue is a bug from Azure DevOps and that it is already solved. I however, have experienced this same issue in the days surrounding this post. It seems to me that the bug still persists.
Research from different has lead me to the conclusion that this is a bug and that it hasn't been solved.
Here is a program to delete test runs using the Rest API:
https://www.opentechguides.com/how-to/article/azure/207/rest-api-delete-test-run.html

How to retrieve VsTest Test Plan test case id during Azure pipeline is running and use that in automation code

Use Case:
Define a Test Plan, Test Suite and add test cases to it on ADO.
Link multiple (all) the tests on Test Plan to a single MsTest method.
Azure pipeline is setup to run the automation suite using the “Visual Studio Test” task and “Select tests using” option is set as “Test Plan”
I am searching for a solution on when Azure pipeline starts and VsTest task is running, can we get the Test case ID/Name (from ADO Test Plan) which is currently processed to run and provide that ID/Name to automation test method (as a parameter option to MsTest test). Using that test case ID, I will run few control statements in the code to perform desired tasks.
But, everything should happen runtime and the approach should be dynamic. Also, it should support parallel test execution.
Could you please share your thoughts.
TIA.
Akshay J.
Azure pipeline is setup to run the automation suite using the “Visual Studio Test” task and “Select tests using” option is set as “Test Plan”
According to your description, so Visual Studio Test task is configured like below.
In that case, you will know the id of test plan and id of test suite, so you could use Rest API: Test Suites - Get Test Cases to get all test cases in a suite including id and url, and then request this url will get fields.System.Title, that is the name of test case.
BTW, you could use API: Definitions - Get to get this release definition, in the response you will find the following VsTest task and its settings including id of test plan and id of test suite.

How to Run Azure Pipeline Builds Sequentially

I have created an Azure build pipeline using the 'classic editor' (i.e. not yaml). The build consists of two agent jobs:
Job 1 - Build code and deploy to test enviornment using a single agent.
Job 2 - Run tests against the test enviornment in parallel (using max 3 agents at a time).
My problem with this setup is if a build is triggered, and the tests are mid-run, if a second build is triggered, the code that is deployed to the test enviornment will be overwritten by the subsequent build, causing the test run in Job 2 of the first build to fail.
Is it possible to tell the build pipeline to only trigger builds sequentially?
I have figured out how to use Azure DevOps API to check if the latest build has completed, however Im not sure how I can use it in the pipeline. Is it possible to do something like:
1 - Invote REST API to check status of latest build.
2 - Success Criteria met (i.e. the build has completed)? If yes continue build, if not wait a minute and check again.
You have the option to control this in the Build options. Should work based on what you described.
Edit:
After looking again to your question, i noticed that you are running your tests after you deploy your app to test environment, so it means you run your tests during release, so you need to control the flow on your release and not on your buid. In order to do it, you should control on the maximum number of parallel deployments:

Resources