visual-studio - 与 Jenkins 持续集成 Windows 8 Store 应用程序

标签 visual-studio unit-testing service jenkins windows-store-apps

我正在尝试使用 Jenkins 在 Windows 应用商店应用程序上进行持续集成。 Jenkins 安装在 Linux 机器上(由于其他项目,如 iOS 和 Android)。为了管理 Windows 项目,我在 Windows 8 64 位专业版上安装了一台构建机器(WP8 项目是在这台机器上构建的)。我想将这台机器用于我的 WINdows Store 应用程序。

一开始,我用 msbuild 构建了我的项目(用于生成 AppPackages 文件夹)。然后我接受证书(.cer)

CertUtil -addstore root <FILE.cer>

之后,我尝试在应用程序 (.appx) 上使用 vstest.console.exe。这个可执行文件需要在交互式服务中运行,所以我用另一个 exe 启动它,它可以访问交互式 session 并启动 vstest.console.exe(我用这篇文章 http://www.codeproject.com/Articles/110568/Alternative-way-for-Window-services-to-interact-wi 制作了这个可执行文件)。

尽管如此,vstest.console.exe 失败并显示以下消息:
Microsoft (R) Test Execution Command Line Tool Version 11.0.60315.1
Copyright (c) Microsoft Corporation.  All rights reserved.

Starting test execution, please wait...
Error: Failed to launch test executor for the Windows Store app with error code 0.

当我运行我的脚本时,不使用 Jenkins 服务(或我构建的服务),它运行完美。用于 Windows 8 Phone,用于测试项目的脚本完美运行,但用于 Windows 8 Metro 应用程序时则不行。

有没有人设法从服务运行单元测试?

最佳答案

我们还通过启动和 MSBuild 作业将 Jenkins 用于 Windows Store App CI。也许这个片段会帮助你?

<Target Name="UnitTest" DependsOnTargets="PreTest;Compile" Condition="'$(SkipTests)'=='' and '$(Platform)'=='x86'" >
    <ItemGroup>
        <TestAppx Include="$(SolutionDir)\**\*x86*\**\*Tests*.appx" />
        </ItemGroup>

    <Message Importance="high" Text="Running tests for %(TestAppx.Identity)" />
            <Exec Command='"C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" %(TestAppx.Identity) /InIsolation /platform:x86 /Logger:trx /UseVsixExtensions:true'
                  WorkingDirectory="$(SolutionDir)"/>
</Target>

关于visual-studio - 与 Jenkins 持续集成 Windows 8 Store 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17749176/

相关文章:

Android服务在应用程序被杀死时重新启动

c# - 如何在 C# 中从 sql 中检索特定数据?

c# - 如何调试代码分析自定义规则?

java - 使用封闭类运行 PowerMock

java - 使用 mockito 抛出运行时异常时测试是否抛出自定义异常

始终监听特定端口号的 Python 应用程序

java - Azure/qpid-proton-j-extensions maxframesize 将消息大小限制为 4KB

c# - 尝试在带有 Visual Studio 2010 的 C# 中创建自动版本控制系统

visual-studio - 断点未突出显示 Visual Studio 2013 中的整行

javascript - 在 React 中,如何测试组件内的渲染方法