Hi, as a proof of concept for VSTS receving tests results via API, I am aiming to:
1. create an emptyish build definition
2. have it present a window of opportunity to receive test results posted via the api
(So far I've done this by calling a visual studio solution that waits 60 seconds, but perhaps a powershell command would have been enough)
Whilst running the above build process, I have tried firing in the following test result request:
POST https://{instance}/DefaultCollection/{project}/_apis/test/runs/{run}/results?api-version={version}
However, whilst the build process is running, until it completes, I am returned:
Test run with id {id} could not be found. It may have been deleted
So, three questions:
1. How can you automatically post to the current test {run}, without finding which number this would be? (Is there a variable which can be passed in the request to indicate latest?)
2. My build process didn't seem to be presenting a window of opportunity to listen for any incoming test results. What step should I add or change to achieve this?
3. Our test cases associated with a build, may not be defined in VSTS. Will it still be acceptable to post test results back, against no defined test cases? For example with json:
[
{
"testCaseTitle": "myTestCaseTitle",
"automatedTestName": "myAutomatedTestName",
"priority": 1,
"outcome": "Passed"
}
]
Many thanks