Skip to content

[BUG]: Pyproj created in VS 2022 with unittest and Using VSTest@2 task in yaml is not executing the test cases #19563

Closed
@ajeesashi

Description

New issue checklist

Task name

VSTest@2

Task version

2.0

Issue Description

I had created a python project in Visual studio 2022 community. In python scripts and project used unit test modules then linked the test scripts to the testcase which is in azure testplan from Test Explorer --> Associate to test case. Now in Yaml using when i try to execute its aborting and failing the pipeline and says No test source found.
image

In Visual Studio 2022 its working without any issues. but only when i use pipeline its failing.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows 11

Relevant log output

2024-02-16T16:36:26.6972967Z ##[section]Starting: Test run

2024-02-16T16:36:26.7072413Z ==============================================================================

2024-02-16T16:36:26.7072554Z Task : Visual Studio Test

2024-02-16T16:36:26.7072644Z Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2).

2024-02-16T16:36:26.7072932Z Version : 2.234.0

2024-02-16T16:36:26.7072990Z Author : Microsoft Corporation

2024-02-16T16:36:26.7073067Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/vstest

2024-02-16T16:36:26.7073158Z ==============================================================================

2024-02-16T16:36:27.9263696Z In distributed testing flow

2024-02-16T16:36:27.9263877Z ======================================================

2024-02-16T16:36:27.9264325Z Test selector : Test plan

2024-02-16T16:36:27.9264545Z Test plan Id : 58265

2024-02-16T16:36:27.9264748Z Test plan configuration Id : 29

2024-02-16T16:36:27.9264956Z Test suite Id selected: 59761

2024-02-16T16:36:27.9265171Z Search folder : C:\Users\Administrator\Documents\first_webhmi

2024-02-16T16:36:27.9466436Z Action when minimum tests threshold not met : donothing

2024-02-16T16:36:27.9466564Z Minimum tests expected to be run: 0

2024-02-16T16:36:28.0033555Z Distributed test execution, number of agents in job : 1

2024-02-16T16:36:28.0035033Z Run in parallel : true

2024-02-16T16:36:28.0035230Z Run in isolation : false

2024-02-16T16:36:28.0035430Z Path to custom adapters : undefined

2024-02-16T16:36:28.0035968Z Other console options : undefined

2024-02-16T16:36:28.0036168Z Code coverage enabled : false

2024-02-16T16:36:28.0036481Z Diagnostics enabled : false

2024-02-16T16:36:28.0300876Z ======================================================

2024-02-16T16:36:28.0301747Z Source filter: \bin***test.dll,\bin***tests.dll

2024-02-16T16:36:28.5265977Z ##[warning]Test Impact (Run only Impacted tests) and Code Coverage data collector will not work.

2024-02-16T16:36:28.5449210Z ##[warning]Test Impact (Run only Impacted tests) and Code Coverage data collector will not work.

2024-02-16T16:36:28.5854389Z ##[warning]Test Impact (Run only Impacted tests) and Code Coverage data collector will not work.

2024-02-16T16:36:28.5859860Z [command]C:\agent_work_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.234.0\Modules\DTAExecutionHost.exe --inputFile C:\agent_work_temp\input_888f19f0-cce9-11ee-8f45-fd257bee9248.json

2024-02-16T16:36:28.6045146Z ##########################################################################

2024-02-16T16:36:28.6045275Z DtaExecutionHost version 19.234.34524.1.

2024-02-16T16:36:29.1345438Z ===========================================

2024-02-16T16:36:29.1345899Z AgentName: DESKTOP-CQ5633A-EMT_TestAutomation_147-415

2024-02-16T16:36:29.1346903Z ServiceUrl: https://dev.azure.com/PG-CT/

2024-02-16T16:36:29.1347437Z TestPlatformVersion: 17.10.0-preview-24080-01

2024-02-16T16:36:29.1348628Z EnvironmentUri: vstest://env/first/_apis/build/679/146773/fc1827b2-8e49-58e0-8bba-ff205368c63b/2

2024-02-16T16:36:29.1349081Z QueryForTaskIntervalInMilliseconds: 3000

2024-02-16T16:36:29.1349437Z MaxQueryForTaskIntervalInMilliseconds: 10000

2024-02-16T16:36:29.1349721Z QueueNotFoundDelayTimeInMilliseconds: 3000

2024-02-16T16:36:29.1350027Z MaxQueueNotFoundDelayTimeInMilliseconds: 50000

2024-02-16T16:36:29.1350900Z ===========================================

2024-02-16T16:36:30.9736400Z Result Attachments will be stored in LogStore

2024-02-16T16:36:31.1354092Z Run Attachments will be stored in LogStore

2024-02-16T16:36:31.3337089Z TestExecutionHost.Execute: Registered TestAgent : 47 : DESKTOP-CQ5633A-EMT_TestAutomation_147-415

2024-02-16T16:36:31.3475727Z Updated Run Settings:

2024-02-16T16:36:31.3478253Z

2024-02-16T16:36:31.3681960Z Creating run for selected test plan with following parameters

2024-02-16T16:36:31.3682446Z Test plan ID: 58265

2024-02-16T16:36:31.3682603Z Test suite ID: 59761

2024-02-16T16:36:31.3684198Z Test configuration ID: 29

2024-02-16T16:36:31.5009365Z IsValidServiceResponse: Received None command… Service Workflow is not active

2024-02-16T16:36:31.7137503Z test configuration mapping:

2024-02-16T16:36:31.7147122Z Run title: TestRun_first_tools_testautomation_I700_1.10.3.13_module_1.2.0

2024-02-16T16:36:31.7147250Z Build location: C:\Users\Administrator\Documents\first_webhmi

2024-02-16T16:36:31.7147335Z Build Id: 146773

2024-02-16T16:36:32.1340477Z Test run with Id 316152 associated

2024-02-16T16:36:42.6829525Z Received the command : Start

2024-02-16T16:36:42.6854302Z TestExecutionHost.ProcessCommand. Start Command handled

2024-02-16T16:36:42.8936909Z Slice with id = 42, of type = ‘Execution’ received.

**2024-02-16T16:36:43.1395222Z Count of test sources found: 0

2024-02-16T16:36:43.3067344Z ##[warning]No test sources found

2024-02-16T16:36:43.6454742Z [RunStatistics]This execution slice with id ‘42’, received ‘2’ testcases to execute out of which ‘0’ is discovered.

2024-02-16T16:36:43.6490871Z List of test cases in slice with id: 42

2024-02-16T16:36:43.6492596Z Source: first_webhmi, FullyQualifiedTestName: test_module700_module730_installation.py::Test_test_module700_module730_installation::test_57639_runtime_installation_in_moxa

2024-02-16T16:36:43.6493008Z Source: first_webhmi, FullyQualifiedTestName: test_module700_module730_installation.py::Test_test_module700_module730_installation::test_57640_secureFirmwareImport

2024-02-16T16:36:43.8225342Z ##[error]ExecutionAndPublish.Run : Microsoft.VisualStudio.TestService.VstestAdapter.TestsNotFoundException: No test assemblies found on the test machine matching the source filter criteria or no tests discovered matching test filter criteria. Verify that test assemblies are present on the machine and test filter criteria is correct.

2024-02-16T16:36:43.8226192Z at Microsoft.VisualStudio.TestService.VstestAdapter.Execution.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)

2024-02-16T16:36:43.8226371Z at Microsoft.VisualStudio.TestService.VstestAdapter.ExecutionAndPublish.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)

2024-02-16T16:36:43.8264907Z ##[error]The slice of type ‘Execution’ is ‘Aborted’ because of the error : Microsoft.VisualStudio.TestService.VstestAdapter.TestsNotFoundException: No test assemblies found on the test machine matching the source filter criteria or no tests discovered matching test filter criteria. Verify that test assemblies are present on the machine and test filter criteria is correct.

2024-02-16T16:36:43.8267748Z at Microsoft.VisualStudio.TestService.VstestAdapter.Execution.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)

2024-02-16T16:36:43.8268339Z at Microsoft.VisualStudio.TestService.VstestAdapter.ExecutionAndPublish.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)

2024-02-16T16:37:03.8879972Z Received the command : Stop

2024-02-16T16:37:03.8881198Z TestExecutionHost.ProcessCommand. Stop Command handled

2024-02-16T16:37:03.8884419Z SliceFetch Aborted. Moving to the TestHostEnd phase

2024-02-16T16:37:04.6489953Z Please use this link to analyze the test run : https://dev.azure.com/xxx/first/_TestManagement/Runs#_a=resultQuery&runId=316152&queryPath=Recent+Run%2FRun316152

2024-02-16T16:37:04.6492820Z Test run ‘316152’ is in ‘Aborted’ state with ‘Total Tests’ : 2 and ‘Passed Tests’ : 0.

2024-02-16T16:37:04.6532472Z ##[error]Test run is aborted. Logging details of the run logs.

2024-02-16T16:37:04.6538547Z ##[error]System.Exception: The test run was aborted, failing the task.**

2024-02-16T16:37:04.9962631Z ##########################################################################

Full task logs with system.debug enabled

logs_147171.zip

Repro steps

- stage: IED_Install
  jobs:
  - job: IED7xx_Installation
    workspace:
      clean: all
    steps:
    - task: 6d15af64-176c-496d-b583-fd2ae21d4df4@1
      inputs:
        repository: self
        lfs: true
        persistCredentials: true
    - task: VisualStudioTestPlatformInstaller@1
      displayName: 'Visual Studio Test Platform Installer'
    - task: VSTest@2
      displayName: 'test execute'
      inputs:
        testSelector: 'testAssemblies'
        testAssemblyVer2: |
          **\*test*.py
        resultsFolder: 'E:\I700\07_TestResults'
    - task: VSTest@2
      displayName: 'Test run'
      inputs:
        testSelector: 'testPlan'
        testPlan: 'xxxxx'
        testSuite: 'xxxxx'
        testConfiguration: '29'
        searchFolder: 'C:\Users\Administrator\Documents\xxxx_webhmi'
        vsTestVersion: 'toolsInstaller'
        runInParallel: true
        codeCoverageEnabled: false

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions