Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Continuous integration for Windows 8 Store Application with Jenkins

I'm trying to make a continuous integration on a Windows Store Application with Jenkins. Jenkins is installed on a Linux machine (due to other project like iOS and Android). In order to manage Windows project I installed a build machine on Windows 8 64 bits Pro (WP8 project are build on this machine). I want to use this machine for my WIndows Store Application.

At the beginning, I built my project with msbuild (used to generate the AppPackages folder). Then I accept the certificate (.cer) with

CertUtil -addstore root <FILE.cer>

After that, I tried to use vstest.console.exe on the application (.appx). This executable needs to run in an interactive service, so I launched it with another exe, which get access on the interactive session and launch vstest.console.exe (I made this executable with this article http://www.codeproject.com/Articles/110568/Alternative-way-for-Window-services-to-interact-wi ).

Despite that, vstest.console.exe failed with that message:

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.

When I run my script, without using the Jenkins service (or a service built by me) it works perfectly. Used for a Windows 8 Phone, the script for testing the project works perfectly, but doesn’t when used for Windows 8 Metro application.

Has anyone managed to run unit tests from a service?

like image 201
Colas Pomiès Avatar asked Jul 19 '13 14:07

Colas Pomiès


1 Answers

We also use Jenkins for Windows Store App CI by launching and MSBuild job. Maybe this snippet will help you?

<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>
like image 62
Jon Rea Avatar answered Sep 28 '22 09:09

Jon Rea