Unmute a single test with REST API

Hello!

Teamcity 2017.2 intoduced a new possibility to unmute tests but only with "mute" entity (delete request to http://teamcity:81111/app/rest/mutes/id:XXXX). "Mute" entity is essentially a pack of muted tests, so it is impossible to unmute only one test (if it is not the case of single test in "mute") from my point of view.

Am I missing anything and there is a way?

 

 

0
5 comments

Right, at this time a mute object is managed as a whole, it you want to remove one tests from the mute, you need to delete the existing mute data and post a new one.

Is it a frequent case when you mute multiple tests and then want to unmute a single one?

0
Avatar
Permanently deleted user

Happens from time to time but on regular basis.

It has funny side effect by the way, in case of "unmutting" single test throught TC UI, the test still will be present in "mute" entity, which is returned by GET to http://teamcity:8111/app/rest/mutes.

I've thought about this workaround too, but it's quite confusing to "Use the same XML or JSON as returned by GET" as said in documentation.

Let's say I've recieved this and I want to eliminate "test2":

https://pastebin.com/dr8DPQu3

In my opinion it makes no sense to keep mute id, so this is what I expect to be accepted (after deleting original mute):

https://pastebin.com/80YBF4rE

I get "java.lang.IllegalArgumentException: argument type mismatch". With mute id i get the same result. What I am doing wrong?

0

Hi Andrey,

The mute seems correct, but you would need to be posting it without the "mutes" enveloping tag, so simply the content of the "mute" tag. As a general rule, when posting to a node that returns a list of items, and you only want to post one item, you need to only post the item without the list.

 

1
Avatar
Permanently deleted user

Hi Denis,

Thank you, that was helpful.

0

> It has funny side effect by the way, in case of "unmutting" single test throught TC UI, the test still will be present in "mute" entity, which is returned by GET to http://teamcity:8111/app/rest/mutes.

 

Thank you for noticing. Right, I found this one too. The fix should be available with the next bug fix release (2017.2.2, planned for the next week).

0

Please sign in to leave a comment.