代码之家  ›  专栏  ›  技术社区  ›  PixelPlex

在vstest控制台上进行的有序测试失败

  •  0
  • PixelPlex  · 技术社区  · 8 年前

    使用vs2017进行有序测试。

    我使用tfsversion15.117.27414.0,在这里我有一个构建和发布定义来将测试部署到测试环境中的一台机器上。 包含我的有序测试的UItest项目由生成服务器上的生成代理生成。生成服务器使用Visual Studio Enterprise 2017版本15.7.6。

    版本定义仅包含Visual Studio测试任务:

    • 已选择版本2
    • 使用路径指向my.orderedtest文件的测试程序集。
    • 测试平台版本为vs 2017

    运行此测试的测试代理安装在我的测试环境中的计算机上,并配置为运行UI测试。

    以下是部署版本后TFS的日志:

    ##[section]Starting: VSTest - Test assemblies
    ==============================================================================
    Task         : Visual Studio Test
    Description  : Run tests with Visual Studio test runner
    Version      : 2.0.55
    Author       : Microsoft Corporation
    Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=835764)
    ==============================================================================
    Run the tests locally using vstest.console.exe
    ========================================================
    Test selector : Test assemblies
    Test assemblies : Deploy and Distributed Test-CI\drop\completeRun.orderedtest
    Test filter criteria : null
    Search folder : C:\agent\_work\r1\a
    Run settings file : C:\agent\_work\r1\a
    Run in parallel : false
    Run in isolation : false
    Path to custom adapters : null
    Other console options : null
    Code coverage enabled : false
    VisualStudio version selected for test execution : 15.0
    [command]powershell -NonInteractive -ExecutionPolicy Unrestricted -file C:\agent\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.0.55\vs15Helper.ps1
    <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
      <S>C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent</S>
    </Objs>
    [command]wmic datafile where "name='C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\TestAgent\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe'" get Version /Value
    
    Version=15.0.27924.0 
    
    
    Version=15.0.27924.0
    
    ========================================================
    [command]"C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "C:\agent\_work\r1\a\Deploy and Distributed Test-CI\drop\completeRun.orderedtest" /logger:trx "/TestAdapterPath:\"C:\agent\_work\r1\a\""
    Microsoft (R) Test Execution Command Line Tool Version 15.8.0
    Copyright (c) Microsoft Corporation.  All rights reserved.
    
    Starting test execution, please wait...
    An exception occurred while invoking executor 'executor://orderedtestadapter/v1': Method not found: 'Void Microsoft.VisualStudio.TestTools.Common.TestRunConfiguration.AddTestSettingsProperties(System.Collections.Generic.Dictionary`2<System.String,System.Object>)'.
    
    Test Run Failed.
    ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests.
    ##[error]Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe failed with return code: 1
    ##[warning]No results found to publish.
    ##[error]Vstest exited with return code: 1.
    ##[section]Finishing: VSTest - Test assemblies
    ##[section]Finishing: Release
    

    我在网上搜索过这个例外,但到目前为止没有找到任何有用的东西。我尝试在测试机器上使用vstest控制台直接在该机器上运行有序的测试,但是它给出了相同的结果。所以我认为我的构建和发布定义是可以的。

    我将目标.net framework更改为.net 4.5,因为vstest.console.exe没有将.net framework 4.6.1作为目标框架的参数。这没用。 我发现我能够通过我的开发人员机器上的vstest控制台运行有序的测试,所以我在考虑测试机器上缺少dll的问题。请注意,vs2017未安装在测试机器上。

    1 回复  |  直到 8 年前
        1
  •  0
  •   PixelPlex    7 年前

    在卸载它之后,vstest控制台能够回放我的命令测试。 应使用最新版本的远程调试器解决此问题。

    Microsoft开发人员社区论坛上的这篇文章介绍了以下解决方案: https://developercommunity.visualstudio.com/content/problem/169183/coded-ui-cant-run-test-in-vs-enterprise-2017-1552.html

    推荐文章