【问题标题】:MEASURING MANUAL/AUTOMATED FUNCTIONAL TESTS CODE COVERAGE测量手动/自动功能测试代码覆盖率
【发布时间】:2018-06-01 13:51:15
【问题描述】:

我们正在尝试为 Azure 应用服务中托管的应用程序执行手动测试生成代码覆盖率。

我在 portal.azure.com 中有一个具有“用户”权限的跟踪帐户。

尝试了以下选项: A. 在 Azure 控制台和本地使用 VS 工具 B. 在 Azure 控制台中使用 OpenCover

上述使用 VS 工具和 Opencover 的选项都已在 localhost(IIS 服务器)中使用,以成功生成运行手动测试的代码覆盖率。

A.在 Azure 中使用 VS 工具进行代码覆盖的步骤: 1. cd D:\Program Files (x86)\Microsoft Visual Studio 15.0\Team Tools\Performance Tools 2. vsinstr /coverage D:\home\site\wwwroot\bin\abc.dll 3. vsperfcmd /start:coverage /output:D:\home\LogFiles\Testing123.coverage 4. vsperfcmd -shutdown

Issue1: The generated code coverage file has error: Empty results generated: No binaries were instrumented. Make sure the tests ran, required binaries were loaded, had matching symbol files, and were not excluded through custom settings. For more information see https://go.microsoft.com/fwlink/?LinkID=253731

However I'm able to generate code coverage on the same application which has been hosted in my local IIS server. The same 4 steps mentioned above is working. The issue is that the instrumented dll doesn't log the transactions performed on the hosted application.

Reference: https://gurunadhduvvuru.wordpress.com/2014/08/01/generating-functional-testing-code-coverage/

PS: We have tried starting the coverage process before and after publish the application.   

B.在 Azure 中使用 Open Cover 进行代码覆盖的步骤 1. OpenCover.Console.exe -target:C:\Windows\System32\inetsrv\w3wp.exe -targetargs:"-debug -s 1" -targetdir:C:\inetpub\wwwroot\bin\ -filter:+[] -register:user -output:C:\Users\coverage2.xml

Issue 2: Access denied is displayed when the application is not running.
Issue 3: The generated coverage file is empty and doesn't has the same error mentioned in Issue 1, on executing the opencover command when the application is running.

Reference: https://automationrhapsody.com/code-coverage-manual-automated-tests-opencover-net-applications/

Any help on the reason for the generated coverage file to be empty ? or any reference to suffice my requirement would be much appreciated?

【问题讨论】:

    标签: azure code-coverage test-coverage


    【解决方案1】:

    这似乎是 Azure WebApp 沙盒的限制,所有 Azure Web 应用程序都在称为沙盒的安全环境中运行。每个应用程序都在自己的沙箱内运行,将其执行与同一台机器上的其他实例隔离开来,并提供额外的安全性和隐私性,否则这些应用程序将无法使用。

    在 Azure 应用服务上运行时,您不能安装任意软件。通常,您不能进行任何机器级别的更改(例如注册表更改)。

    参考:https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox。如果您的要求符合要求,请在运行 IIS 的 Azure VM 上尝试此操作,您可以更好地控制管理 VM。

    【讨论】:

    • 我们已经在虚拟机中进行了尝试,并且能够使用 VS 工具生成代码覆盖率。但是即使在 VM 中,我们也无法使用 Open Cover 生成代码覆盖率。感谢阿杰的回复。非常感谢。
    猜你喜欢
    • 2017-10-09
    • 1970-01-01
    • 1970-01-01
    • 2017-02-21
    • 1970-01-01
    • 2018-03-24
    • 1970-01-01
    • 1970-01-01
    • 2011-10-13
    相关资源
    最近更新 更多