小编riQ*_*iQQ的帖子

如何在 Azure DevOps 中使部分成功的阶段变为失败?

我正在发布管道上运行纽曼测试,但是当测试出错时,它只是将该阶段标记为部分成功,但我想让它无法触发自动重新部署触发器。这可能吗?

在此输入图像描述

azure azure-devops azure-pipelines

1
推荐指数
1
解决办法
6507
查看次数

TfsTeamProjectCollection API

我正在使用TFS API连接到Team Foundation Server.在服务器URI中,我传递服务器的主机名.我收到错误的URI格式错误.

teamFoundationServer = new TfsTeamProjectCollection(new Uri(this.Server,UriKind.Absolute),this.Credentials); teamFoundationServer.EnsureAuthenticated();

tfs tfs-sdk

0
推荐指数
1
解决办法
5989
查看次数

无法以编程方式更新测试用例的区域

我正在尝试以编程方式更新测试用例的区域。

我的代码似乎合乎逻辑,但是失败了:

Microsoft.TeamFoundation.WorkItemTracking.Client.dll中发生了类型为'Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException'的未处理异常

附加信息:TF400276:您试图为未打开或部分打开的工作项的字段设置值。您无法为未打开或未部分打开的工作项的字段设置值。

这是代码:

private static void Main(string[] args)
      {
         TeamProjectPicker tpp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
         tpp.ShowDialog();

         var tc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(
                                                                           tfsUri,
            new UICredentialsProvider());

         tc.EnsureAuthenticated();

         var wiStore = tc.GetService<TestManagementService>();

         var project = wiStore.GetTeamProject(tpp.SelectedProjects[0].Name);

         SetAreaPathByTestSuiteID(project, 501);



      }

      private static void SetAreaPathByTestSuiteID(ITestManagementTeamProject project, int testSuiteID)
      {
         var testSuite = project.TestSuites.Find(testSuiteID).TestCases;

         foreach (ITestSuiteEntry entry in testSuite)
         {
            ITestCase theCase = entry.TestCase;
            theCase.Area = "NewAreaPath"; //Error thrown here
            theCase.Save();

         }
      }
Run Code Online (Sandbox Code Playgroud)

c# tfs tfs-sdk

0
推荐指数
1
解决办法
727
查看次数

从 Azure 发布管道执行 Git 推送

我想在来自自托管构建服务器的 Azure Devops 发布管道中从 powershell 脚本执行 git push 。

它在构建管道中工作,但从发布管道中我最终遇到身份验证错误。“允许脚本访问 OAuth 令牌”已激活,并且构建机器具有贡献权限(正如我所说,它在构建管道中工作)。

这是我在 devops protal 中看到的错误:

git : remote: 001f# service=git-receive-pack
At C:\Builds\A1\_work\r1\a\Source\Scripts\CreateTagFromPipeline.ps1:11 char:1
+ git push
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (remote: 001f# service=git-receive-pack:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

PowerShell exited with code '1'.
Run Code Online (Sandbox Code Playgroud)

如果我通过远程桌面登录到机器并手动推送,我会得到一些更好的错误:

$ git push
remote: 001f# service=git-receive-pack
remote: 0000000000aaTF401027: You need the Git 'GenericContribute' permission to perform this action. Details: identity 'Build\58bb64d7-d065-4522-94e2-a153b9fdadd6', scope 'repository'.
remote: TF401027: You need the Git 'GenericContribute' permission to …
Run Code Online (Sandbox Code Playgroud)

git azure-devops azure-pipelines

0
推荐指数
1
解决办法
1617
查看次数

标签 统计

azure-devops ×2

azure-pipelines ×2

tfs ×2

tfs-sdk ×2

azure ×1

c# ×1

git ×1