简体   繁体   English

没有Azure DevOps管道-构建-任务

[英]No Azure DevOps Pipelines - Builds - Tasks

Following this Microsoft tutorial ( Run unit tests with your builds ), I was expecting to be able to run my unit-tests automatically when a build is triggered, such as a Pull request. 遵循本Microsoft 教程使用内部版本运行单元测试 )之后,我期望能够在触发内部版本(例如Pull请求)时自动运行单元测试。

However, when I look in the Pipeline / Builds tab and try to edit my pipeline, there is nothing that allows me to add a new task (see screenshot below). 但是,当我查看“ 管道/构建”选项卡并尝试编辑管道时,没有任何东西可以让我添加新任务(请参见下面的屏幕截图)。 在此处输入图片说明

However, there doesn't appear to be any way of adding a task. 但是,似乎没有任何添加任务的方法。 I can't even switch to the YMAL without navigating to the source via the Repo. 如果没有通过Repo导航到源代码,我什至不能切换到YMAL。 I was hoping to use the GUI though as my YMAL is non-existent. 我当时希望使用GUI,因为我的YMAL不存在。

I have created a test solution with the following structure, which is held in the repo: 我创建了一个具有以下结构的测试解决方案,该结构位于回购协议中:

Core Solution
    |_ Class Library Project (.NET Core)
    |_ MSTest Test Project (.NET Core)

I was hoping to have a build step followed by a Unit Test step using the tests in my MSTest Test Project (.NET Core) project once they were built. 我希望建立一个构建步骤之后再执行一个单元测试步骤,以便在构建MSTest测试项目(.NET Core)项目后使用它们进行测试。

There appears to be a Tasks option in the Releases tab by the way, but I was expecting to be able to add tasks for builds as well, especially Unit Tests. 顺便说一句,“ 发布”选项卡中似乎有一个“ 任务”选项,但是我希望也能够为构建添加任务,尤其是单元测试。

Being new at this, perhaps I have missed or misunderstood something. 刚开始时,我可能错过或误解了一些东西。 I would be grateful for any help and to be pointed in the right direction. 我将不胜感激,向您指出正确的方向。

It seems that there is an obscure link that takes you through to the correct process, found it quite by accident, see screenshot below: 似乎有一个模糊的链接可带您进入正确的过程,很偶然地发现了它,请参见下面的屏幕截图:

选择“使用视觉设计器”选项

It turns out that there is a little link titled Use the visual designer that I'd missed. 事实证明,有一个标题为“ 使用我错过的视觉设计师 ”的小链接。 Seems a little odd that most of the tutorials discuss this process and yet it's partially obscured. 似乎大多数教程都讨论了此过程,但有些模糊不清,这似乎有些奇怪。 I guess that this shows that the platform is a work in process and still being added to and improved. 我猜这表明该平台是一个正在进行的工作,并且仍在增加和改进中。

Another few caveats for those descending this little rabbit hole, after selecting the Use the visual designer link, be sure to select the Empty pipeline template, or whatever is appropriate to your project/solution type, and not the YAML option at the top of the list, otherwise you'll be back where you started. 使用“使用可视设计器”链接后, 注意那些从这个小兔子洞掉下来的人的其他注意事项, 确保选择“ 清空管道”模板,或适合于您的项目/解决方案类型的任何东西,而不是顶部的YAML选项。列表,否则您将回到起点。

选择“空管道”​​模板

Finally, it seems that automated Unit Tests don't work on Agents other than Hosted VS2017 Agents (that said, I haven't tried the Hosted option). 最后,似乎自动化的单元测试不适用于Hosted VS2017代理以外的其他代理(也就是说,我没有尝试过Hosted选项)。 This is set in the very next screen by selecting the Pipeline and selecting the Agent pool from the drop-down. 这是在下一个屏幕中设置的,方法是选择管道,然后从下拉列表中选择代理程序池

One last thing... The pipeline won't run automatically unless you check the Enable continuous integration checkbox on the Triggers tab. 最后一件事...除非您选中“ 触发器”选项卡上的“ 启用连续集成”复选框,否则管道不会自动运行。

Once this is all done, I simply chose the tasks needed for the build by clicking the plus symbol on the Agent job 1 item. 一旦完成所有这些,我只需单击“ 代理”作业1项上的加号即可选择构建所需的任务。

Good luck 祝好运

Kaine 凯恩

You have created a new YAML style of build configuration. 您已经创建了新的YAML样式的构建配置。 Currently Azure DevOps does not support of having YAML & GUI editor at the same time (this is upcoming feature in Q1/2019). 当前,Azure DevOps不支持同时具有YAML和GUI编辑器(这是2019年1月即将发布的功能)。

To get a GUI editor, create new build pipeline. 要获得GUI编辑器,请创建新的构建管道。

In this selection click "Use the visual designer". 在此选择中,单击“使用可视设计器”。

在此处输入图片说明

Then at template phase, don't select YAML. 然后在模板阶段,不要选择YAML。 Any other template will do. 任何其他模板都可以。 You can easily delete all the build steps after selecting template, so don't be afraid to choose any. 选择模板后,您可以轻松删除所有构建步骤,因此不要害怕选择任何一个。 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM