简体   繁体   English

使用 Jenkins 进行 UWP 单元测试

[英]UWP unit testing with Jenkins

It is not really an issue I would like to ask today but I search best practices to unit testing a UWP application with Jenkins.这不是我今天想问的真正问题,但我搜索了使用 Jenkins 对 UWP 应用程序进行单元测试的最佳实践。

First, I created a Unit Test App for my main application and, on my development machine, I generated appx package using MSBuild command line tool.首先,我为我的主应用程序创建了一个单元测试应用程序,并在我的开发机器上使用 MSBuild 命令行工具生成了 appx 包。 It works well and I can also execute unit tests with the VS Test console.它运行良好,我还可以使用 VS Test 控制台执行单元测试。 Then I tried to automate it with Jenkins on my build server.然后我尝试在我的构建服务器上使用 Jenkins 自动化它。 But the MSBuild command does not work.但是 MSBuild 命令不起作用。 I have no issue but it produces no output.我没有问题,但它不产生任何输出。 After lot of research (without any success), my question is the following:经过大量研究(没有任何成功),我的问题如下:

What is the best way to make UWP unit testing with a result dashboard using Jenkins?使用 Jenkins 通过结果仪表板进行 UWP 单元测试的最佳方法是什么?

Thanks谢谢

In order to make MSBuild work correctly, I had to create two subsequent build steps, one with command line argument:为了使 MSBuild 正常工作,我必须创建两个后续构建步骤,一个带有命令行参数:

-t:restore -t:恢复

in order to make it restore all the nuget dependencies, and a second one with command line arguments:为了使其恢复所有 nuget 依赖项,以及带有命令行参数的第二个依赖项:

/t:Rebuild /p:Configuration=Release /p:UapAppxPackageBuildMode=StoreUpload /t:Rebuild /p:Configuration=Release /p:UapAppxPackageBuildMode=StoreUpload

for the real release compilation and the creation of both sideload and storeUpload msix files用于真正的发布编译以及 sideload 和 storeUpload msix 文件的创建

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

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