using vstest.console runner

Hi

I'm trying to get my coded UI test to work, however I keep getting errors when running from teamcity.

I have a project configuration with two steps - first a build - working fine, then a vstest.console runner.

The vstest keeps failing with this error:


19:09:34][Step 2/3] Starting: C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit

  • Agent time: 19:09:38
  • [19:09:34][Step 2/3] in directory: C:\BuildAgent\work\ed700148fa382707
  • Agent time: 19:09:38
  • [19:09:35][Step 2/3] 2015-01-04 19:09:39,447 [1744] WARN  JetBrains.BuildServer.NAntLoggers.NUnitLauncher2 - Failed to parse arguments
  • Agent time: 19:09:39
  • [19:09:35][Step 2/3] Failed to parse parameters from TeamCity, please check it was running under TeamCity
  • Agent time: 19:09:39
  • [19:09:35][Step 2/3] Process exited with code -1
  • Agent time: 19:09:39
  • [19:09:35][Step 2/3] Step vstest (VSTest.Console Tests) failed





    If I go to the build agent machine (Azure VM Windows 8 with VS2013) and issue the vstest.console command with the dll as parameter, the test executes correctly


    Can somebody please help me interpreting this error message?


    Thanks, Lars
    11 comments
    Comment actions Permalink

    Hi,

    Could you please try setting teamcity.agent.dotnet.debug environment variable in Build Parameters section of build configuration with value true and run a build. Please attach produced logs and NUnit build runner settings screenshot.

    0
    Comment actions Permalink

    It seems I am unable to set the correct parameter for debugging. I go to build configuration, goto Parameters, and enter "Add a new parameter"
    If I choose environment parameter the string is prefixed with "env."
    If I delete env it is changed to a configuration parameter.

    Either way, I'm not getting any debug information in the agent or build log on the build server - so I didn't attach any

    Also no NUnit build runner is configured. Only the vstest.console witch I have included as screenshot.

    Hope this makes sense, how can I move on please?



    Attachment(s):
    Untitled2.png
    Untitled.png
    0
    Comment actions Permalink

    Hi Lars,

    Sorry for delay in replying.
    1. Which version of TeamCity and VSTest runner do you use? Please check that versions are compatible. If not try to install new plugin.
    2. Please collect additional logs. To enable logging open the <agent home>/plugins/dotnetPlugin/bin folder. Make a backup copy of teamcity-log4net.xml. Replace teamcity-log4net.xml with the content of teamcity-log4net-debug.xml. Run the build. (After a debug log is created, it is recommended to roll back the change). Logs will be written to <Build_Agent_Root>/temp/buildTmp/TeamCity.NET. Please attach them and full build log.
    3. Also please attach the related for this build configuration .xml file, which is located in <TeamCity Data Directory>/config/projects/<projectName>/buildTypes/<buildConfName>.xml

    0
    Comment actions Permalink

    Thank you, I have tried to gather the neccesary information here.

    Vstest.console version: 30168
    Teamcity version 9.0.1 (32116)

    This made me read the requirements for the plugin. It seems that 30168 is not even supposed to work on version 9. If this is the case, I'll just try tp update the plugin and see how that goes.


    Lars



    Attachment(s):
    CodedUITest_52.log.zip
    debuglogs.zip.zip
    LmsDevelopment_Guide2work.zip
    0
    Comment actions Permalink

    Indeed.

    Upgrading to latest vstest.console Runner helped a lot.

    But seeing the documentationpage, I have one follow-up question, maybe you know the answer.


    The doc says:
    "To enable real time test reporting, go to VSTest.Console step in your build  configuration and enable Use real-time  test reporting option"

    How do I enable this option? Is it some secret commands that we have to write in "parameters" or something? The UI does not reveal anything.

    Thanks again

    Lars

    0
    Comment actions Permalink

    I am glad it works!

    Firstly you need to install the custom logger as described in the documentation. Use real-time test reporting option is an advanced option (press "Show advanced options" in the bottom of VSTest.Console step).

    0
    Comment actions Permalink

    Yes, I have installed the custom logger, and the build agent confirm this when i try to run vstest.console /listloggers

    Now, The plugin must be updated by most recent version by now, since the build is running fine, but the option you mention is not available in advanced section.
    Not in the existing build step, and not in a new step either.

    The runner type is vstest.console Tests, and version is VS2013.

    The configuration itself was uploaded previoiusly.

    0
    Comment actions Permalink

    Please see attached screenshot. Do you have this option?



    Attachment(s):
    Screen Shot 2015-01-16 at 16.24.12.png
    0
    Comment actions Permalink

    Unfortunately not. If it was only so easy :(



    Attachment(s):
    Untitled.png
    0
    Comment actions Permalink

    Please stop TeamCity server and delete the following files:

    • <TC Install dir>/webapps/ROOT/plugins/vstest
    • <TC Data Dir>/plugins/.unpacked/vstest
    0
    Comment actions Permalink

    Thanks - that worked !

    0

    Please sign in to leave a comment.