Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17833] Run ti-mocha tests as part of Jenkins build

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-03-11T16:58:32.000+0000
Affected Version/sn/a
Fix Version/sRelease 4.1.0
ComponentsTooling, Windows
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2014-10-09T18:57:01.000+0000
Updated2017-03-14T20:08:13.000+0000

Description

Tools/Scripts/generate_vs_project.sh Mocha
cygstart.exe Mocha.WindowsPhone.Win32/Mocha.sln
http://social.technet.microsoft.com/wiki/contents/articles/18173.how-to-launch-windows-phone-8-emulator-without-using-visual-studio-2012.aspx http://msdn.microsoft.com/en-us/library/windows/apps/dn632395.aspx#BKMK_commandline

Comments

  1. Christopher Williams 2014-11-11

    There are a few hurdles here. One is generating the solution then building it. I've been able to do that, though it reports errors related to google test. Here's what I run:
       cmake  -G "Visual Studio 12 2013 ARM" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.1 "C:\Program Files (x86)\Jenkins\jobs\titanium_mobile_windows\workspace\Examples\Mocha" 
       cmd.exe /C " "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" build/Mocha.sln " && exit %%ERRORLEVEL%%
       
    and what I get:
       "C:\Program Files (x86)\Jenkins\jobs\titanium_mobile_windows\workspace\build\Mocha.sln" (default target) (1) ->
       "C:\Program Files (x86)\Jenkins\jobs\titanium_mobile_windows\workspace\build\Util\test\virtual_enable_shared_from_this_base_tests.vcxproj.metaproj" (default target) (11) ->
       "C:\Program Files (x86)\Jenkins\jobs\titanium_mobile_windows\workspace\build\Util\test\virtual_enable_shared_from_this_base_tests.vcxproj" (default target) (12) ->
         C:\Users\Chris Williams\gtest-1.7.0-windows\include\gtest/internal/gtest-port.h(1770): error C3861: 'chdir': identifier not found [C:\Program Files (x86)\Jenkins\jobs\titanium_mobile_windows\workspace\build\Util\test\virtual_enable_shared_from_this_base_tests.vcxproj]
         C:\Users\Chris Williams\gtest-1.7.0-windows\include\gtest/internal/gtest-port.h(1802): error C3861: 'getenv': identifier not found [C:\Program Files (x86)\Jenkins\jobs\titanium_mobile_windows\workspace\build\Util\test\virtual_enable_shared_from_this_base_tests.vcxproj]
       
           271 Warning(s)
           4 Error(s)
       
    The next is trying to launch the app in an emulator. That seems to be done by:
       "C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\AppDepl
       oyCmd.exe" /installlaunch "C:\Program Files (x86)\Jenkins\jobs\titanium_mobile_wi
       ndows\workspace\build\AppPackages\Mocha\Mocha_1.1.0.0_Win32_Debug_Test\Mocha_1.1.0
       .0_Win32_Debug.appx" /targetdevice:xd
       
    The first time I run that it starts the emulator but doesn't seem to actually launch the app. If I keep the emulator open and run it again, it launches the app. But now, the issue is that our logger only outputs to an attached debugger, not stdout/stderr or a file. So we can see output when run through VS 2013, but not through this AppDeployCmd.exe. I'm trying to generate a quick branch that actually logs to stdout to see if we can then get the output of running the app/tests.
  2. Christopher Williams 2014-11-11

    Highly related: http://justinangel.net/WindowsPhone7EmulatorAutomation
  3. Christopher Williams 2014-11-11

    OK, so the way to do this is to log to a file inside the actual app's local storage and then grab that file out of the emulator. I have to modify our logging code to generate the log.txt file and append to it as we go. Then I can do:
       "C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\IsolatedStorageExplorerTool\ISETool.exe" ts xd f8ce6878-0aeb-497f-bcf4-65be961d4bba "C:\Program Files (x86)\Jenkins\jobs\titanium_mobile_windows\workspace\build"
       
    The guid there is our app's guid, which I'll have to grab out of the mocha project, I suppose. We should then have the logfile at "C:\Program Files (x86)\Jenkins\jobs\titanium_mobile_windows\workspace\build\IsolatedStorage\log.txt"
  4. Chris Barber 2014-11-11

    [~cwilliams] How will you know when the tests have completed and you can pull the log from isolated storage?
  5. Christopher Williams 2015-03-11

    Finally! See http://studio-jenkins.appcelerator.org/job/titanium_mobile_windows/lastCompletedBuild/testReport/
  6. Lee Morris 2017-03-14

    Closing ticket as fixed.

JSON Source