使用REST VSTS API-更新现有的测试套件配置 [英] Using REST VSTS API - Update existing Test Suite Configurations

查看:107
本文介绍了使用REST VSTS API-更新现有的测试套件配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一种更新现有测试套件的方法.该方法的执行没有任何异常或错误.但是,Test Suite不会使用配置列表进行更新,继承默认配置"也不会设置为false.

I created a method to update an existing Test Suite. The method executes without any exception or error. However, the Test Suite is not getting updated with the list of configurations nor is the "Inherit Default Configurations" getting set to false.

    public TestSuite UpdateTestSuiteConfigurations(Guid projectId, int planId, int suiteId, List<int> configIds)
    {
        var VstsConfigurationIds = new List<ShallowReference>();

        foreach (var item in configIds)
        {
            VstsConfigurationIds.Add(new ShallowReference(item.ToString()));
        }

        var SuiteToUpdate = new SuiteUpdateModel(inheritDefaultConfigurations: false, defaultConfigurations: VstsConfigurationIds.ToArray());

        var VSTS = new TestManagementHttpClient(URI, Credentials);

        var TestSuiteUpdate = VSTS.UpdateTestSuiteAsync(SuiteToUpdate, projectId, planId, suiteId).Result;

        VSTS.Dispose();

        return TestSuiteUpdate;
    }

有人可以指出这个问题吗?我的期望是,更新测试套件后,不应继承默认配置,而应为其分配提供的配置.我已经验证了配置是否存在,并且我使用的是正确的配置ID.

Can someone please point out the issue? My expectation is that after updating the Test Suite should not inherit default configurations and should have the provided configurations assigned to it. I have verified that the configurations are present and that I am using the correct configuration ids.

我之前没有创建过浅层引用,所以也许是问题所在吗?

I have not created a shallow reference before so maybe that is the issue?

推荐答案

我可以使用

I can reproduce this issue with 15.112.1 version of Microsoft.TeamFoundationServer.ExtendedClient package, but works fine with latest version (15.131.0-preview).

因此,您可以创建一个新项目并安装最新版本的程序包,然后重试.

So, you can create a new project and install latest version package, then try again.

这篇关于使用REST VSTS API-更新现有的测试套件配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆