'Automated' option not shown in 'Automation Status' dropdown in Testcase work Item in Azure Devops - azure-devops

In Azure DevOps documentation : https://learn.microsoft.com/en-us/azure/devops/boards/queries/build-test-integration?view=azure-devops
It mentions that :
Field nameDescriptionWork item typeAutomation Status1The status of a test case. You can specify the following values:
Automated
Not Automated
Planned
I am unable to see the Automated Option in the dropdown there are only 2 options available in the dropdown - 'Not Automated' and Planned. Can you please let me know when do you intend to fix this problem ?

The Automated value for Automation Status field is auto set when the test case work item is associated to a test case method. It seems your Test case work item is not associated to test case.
If the Test case work item is not associated. You will only get 'Not Automated' and 'Planned' options in the Automation Status field.
Check document Associate automated tests with test cases to associate your test cases.
When the Test case work item is associated to a test case. You can see the associated test case in the Associated Automation tab. See below:

Related

Can I automatically add comments to Azure DevOps PR based on code changes

Occasionally in our codebase we need to use an //eslint-disable to bypass a styleguide rule on a line. I would like to somehow automatically add a comment on each new instance of that in PRs, requiring the developer to explain why they bypassed the styleguide.
I've found this question referencing how to create a comment programmatically, but what I'm not sure how to do is identify the new code and parse it for a certain piece of text, then add comments on those particular lines where the text was found.
This is one of the approaches to ingest scripts & achieve what you want, wherein Expected outcome is:
On every pull request, a pre build validation pipeline kicks off & adds comments on the PR.
Create a script (powershell/python/bash) with following logic:
Find file names in the given branch which contains //eslint-disable
In the files above (1.), get the location/line number of //eslint-disable
Foreach file.LineNumber (wrote like that just for representation): add comment on file.LineNumber using Pull Request Threads API. See line parameter
Create a pipeline containing above script & add that pipeline as build validation or if you have an existing build validation process, add these scripts as tasks in that pipeline.
Hope this helps :)

Can test-results in azure-devops pipelines be filtered by TestCategory?

I have a pipeline running on Azure Devops that builds and runs tests for a C# solution. We use MsTest for test-runner, and we use the TestCategory attribute to categorize different tests. For example, we might have:
[TestClass]
[TestCategory("UnitTests")]
[TestCategory("SomeFeature"]
public class SomeTestsForSomeFeatureTests
{
Some test-code...
}
and
[TestClass]
[TestCategory("IntegrationTests")]
[TestCategory("SomeFeature"]
public class SomeIntegrationTestsForSomeFeatureTests
{
Some test-code...
}
Is there a way to group the test-results in Azure Devops Pipelines by TestCategory?
It is possible to group the test-results by Test Run, Test File, Priorty, Owner or None, but I have not found a way to group by the TestCategory.
I know that it is possible to setup the pipeline to run tests by TestCategory, but this is not what I am after. Rather, I would like to be able to get a subset of the test-results in my solution. Ideally, I would like to be able to link to the results of the tests in the TestCategory of my choice.
It seems that group by test category in test results UI is not supported currently. You can go to the developer community to suggest a feature.
You can also have a try developing a custom extension for this. You can check here for official documents about how to create extension.

Workaround for saving / editing a VSTS test case

I have an issue with VSTS manual test cases. When I try to edit one, I got an error message as follows:
An element with the same key already exists in the dictionary
e</n.prototype.add#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:3:2142
ki</n.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:46195
bi</n.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:40049
tf</t.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:62452
bi</n.prototype._updateParametersRefCountOnAddingStep/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:39659
.each#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:12291
bi</n.prototype._updateParametersRefCountOnAddingStep#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:39614
bi</n.prototype._calculateParameterRefCountsFromSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:40691
bi</n.prototype.setParameters#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:35794
yt</t.prototype.readParameters#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:58274
yt</t.prototype._onStepsLoaded#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:72430
o/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:53:215
u#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:81038
yt</t.prototype._fetch#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:81408
yt</t.prototype.invalidate#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:57579
c</n.prototype._onFieldChanged#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async636480634-vHvWOSM8E8rCxBa3bYo2R7w==:149:2040
o/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:53:215
u#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:94:177
o</n.prototype.invokeHandlers#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:94:526
tr</n.prototype.fireEvent#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:100720
tr</n.prototype.fireFieldChange#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:103810
tr</n.prototype.evaluateFields#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:112953
tr</n.prototype.evaluate#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:112662
tr</n.prototype._takeUpdateResult#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:110218
vi</t.prototype._beginSaveWorkItemsInternal/</</<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:74066
vi</t.prototype.beginGetWorkItemTypeExtensions#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:69585
vi</t.prototype._beginSaveWorkItemsInternal/</<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:74001
.each#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:12291
vi</t.prototype._beginSaveWorkItemsInternal/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:73876
rt#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:59:938
l/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:59:1252
i.Callbacks/l#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:35816
i.Callbacks/s.fireWith#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:36641
w#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:73448
.send/t/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:79367
Session Id: 73288d72-580f-42fb-9aeb-f5cadb6b3bc5
I only have this issue if a test step contains parameters. After refreshing the page and reopening the test case, the color code is black and it doesn't display the Save button. Also, the dropdown of the ... is empty.
Existing tests are fine, running them is also possible. Working with bugs, user stories and tasks is fine.
Screenshots can be found here
Is there a way to workaround this?
This is caused by the parameter name "#length", remove it or rename it to others like "#length1" would works.
This seems to be a bug with VSTS, I have help you created a feedback on MS Connect Page, refer to this link for details: "An element with the same key already exists in the dictionary" error occurs when save a test case contains a parameter named as "length".

Get NodeRef of a workflow task Alfresco

I create a workflow, and when I go to the task-edit page:
I'm trying to obtain the nodeRef of the file (latexexemplo-2.pdf) of the workflow task:
http://localhost:8080/share/page/task-edit?taskId=activiti$20649
I'm trying to make this way:
var taskId = args.taskId
var task = workflow.getTaskById(taskId);
nodeRef = task.getPackageResources()[0].nodeRef;
But I obtain "args is not defined" ... "workflow is not defined" ... "task is not defined".
How can I get the nodeRef with another way?
Unfortunately, you cannot access in the browser information that is in the repository.
A quick and dirty solution is to use directly the information that is already in the page.
I have started a workflow and opened the task page as you did.
Using the browser debug tool, I have inspected the html.
As you can see in the image attached below, Alfresco stores the documents attached to the task in an hidden input. You could use YAHOO to get it.
Search for an element with the id "page_x002e_data-form_x002e_task-edit_x0023_default_assoc_packageItems".
If there is more than one document associated, the value will be a comma separated list of noderefs. I am getting the first element. This of course works, as is, only if there is one and only one document associated. You should probably take into account also the case when no document is associated or there is more than one.
var nodeRef = YAHOO.util.Selector.query("#page_x002e_data-form_x002e_task-edit_x0023_default_assoc_packageItems")[0].value;
You can get all the current task details which are assigned to you by using
Workflow API in Freemarker.
So you can get the task id or noderef of tasks.

TeamCity REST API get list of pending changes

Is there a REST API endpoint to get a collection of changes that are pending for a build in TeamCity?
We have the build set to manual and it is triggered outside TeamCity and would like to show a bullet point list of commits that'd be in that build.
In the user interface you can see this under the "Pending Changes (X)" tab.
I can't find any examples of doing this and the closest I've found is:
http://<server>/httpAuth/app/rest/changes/buildType:<build type id>
This seems to return the last change though.
Anyone done this before?
I just found a working solution thanks to this question. I'll show it here in case other people are looking for a full solution :
You need to know the buildTypeId of the build on which you want to get the pending changes. In this case lets say buildTypeId=bt85
1
http://<server>/httpAuth/app/rest/buildTypes/id:bt85/builds/
// Get the last build from the XML returned.
// Lets say last build id = 14000
2
http://<server>/httpAuth/app/rest/changes?build=id:14000
// The newest change returned is the one you need.
// Lets say newest change id = 15000
3
http://<server>/httpAuth/app/rest/changes?buildType=id:bt85&sinceChange=15000
// You're now looking at the pending changes list of the buildType bt85
My eventual solution in a work around kind of way is to:
Find the latest change ID from my database of builds outside of TeamCity (I guess you could query the TeamCity API to find the last successful build and pull it from there)
Then call:
http://<server>/httpAuth/app/rest/changes?buildId=id:<build id>&sinceChange=id:<last change id>
Then fetch each individual change from that list.
A bit of a workaround but I couldn't see anyway otherwise to get the list of pending changes.