0

I have a solution with multiple feature files in one project called Axis.Tests
I am trying to integrate these tests into Azure pipelines.
Current state: I am able to build the project and run tests without any problem, but generating test results using living docs in Azure DevOps always fails.

Pipeline looks like this:

trigger: none
pool: "Default"
variables:
  pathToSolution: tests/Axis.Tests.sln
  solutionDisplayName: Axis.Tests.sln
  testsFolder: "tests/Axis.Tests"
  environment: "QA"

steps:
  - template: templates/build-template.yml
    parameters:
      pathToSolutionOrCsproj: $(pathToSolution)
      displayName: $(solutionDisplayName)

  - task: DotNetCoreCLI@2
    displayName: "Run Test"
    env:
      ENV: $(environment)
    inputs:
      command: "test"
      projects: "$(testsFolder)/Axis.Tests.csproj"
      arguments: '--filter "Category=pipelineTesting"'

  - task: SpecFlowPlus@0
    displayName: "LivingDoc with TestAssembly generatorSource"
    inputs:
      generatorSource: "FeatureFolder"
      projectFilePath: $(testsFolder)
      projectName: "Axis"
      projectLanguage: en
      testExecutionJson: "$(testsFolder)/**/TestExecution.json"
      bindingAssemblies: |
        $(testsFolder)/**/Axis.Tests.dll
    continueOnError: true
    condition: always()
    timeoutInMinutes: 15

Output from LivingDocs generator:

Starting: LivingDoc with TestAssembly generatorSource 
==============================================================================
Task : SpecFlow+LivingDoc
Description : Generate living documentation from your feature files or test assembly.
Version : 0.6.961
Author : techtalk
Help : https://docs.specflow.org/projects/specflow-livingdoc/en/latest/Generating/Adding-a-Build-Step.html
==============================================================================
Error: Multiple files are matching the pattern: tests/Axis.Tests/**/Axis.Tests.dll
##[error]Error: Command failed: dotnet "C:\agent\_work\_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.961\CLI\LivingDoc.CLI.dll" feature-folder "C:\agent\_work\34\s\tests\Axis.Tests" --output-type JSON --test-execution-json "tests/Axis.Tests/**/TestExecution.json" --binding-assemblies "tests/Axis.Tests/**/Axis.Tests.dll" --include-test-output "All" --output "C:\agent\_work\34\s\10117\FeatureData.json" --project-name "Axis" --project-language "en"
Error: Multiple files are matching the pattern: tests/Axis.Tests/**/Axis.Tests.dll

at checkExecSyncError (child_process.js:629:11)
at Object.execSync (child_process.js:666:13)
at C:\agent\_work\_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.961\index.js:138:46
at step (C:\agent\_work\_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.961\index.js:44:23)
at Object.next (C:\agent\_work\_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.961\index.js:25:53)
at C:\agent\_work\_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.961\index.js:19:71
at new Promise (<anonymous>)
at __awaiter (C:\agent\_work\_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.961\index.js:15:12)
at C:\agent\_work\_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b59432ffa\0.6.961\index.js:77:12
at Object.<anonymous> (C:\agent\_work\_tasks\SpecFlowPlus_32f3fe66-8bfc-476e-8e2c-9b4b5943

I checked bin folder in my computer and there is just one Axis.Tests.dll file
Anyway, Axis.Tests.dll is in both /bin and /obj folders. Is this a problem ?

Update:
I tried to specify bindingAssembly in this ways:

  • $(testsFolder)/bin/**/Axis.Tests.dll
  • $(testsFolder)/bin/Debug/netcoreapp3.1/Axis.Tests.dll
    Both of them cause me following error:
 Error Message:
   System.AggregateException : One or more errors occurred. (The HTTP request to the remote WebDriver server for URL http://localhost:57379/session timed out after 60 seconds.) (The given key 'driver' was not present in the dictionary.)
---- OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:57379/session timed out after 60 seconds.
-------- System.Threading.Tasks.TaskCanceledException : The operation was canceled.
------------ System.IO.IOException : Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
---------------- System.Net.Sockets.SocketException : The I/O operation has been aborted because of either a thread exit or an application request.
---- System.Collections.Generic.KeyNotFoundException : The given key 'driver' was not present in the dictionary.

Stack trace omitted for brevity

SamJ26
  • 154
  • 2
  • 10
  • Maybe the duplicate is in `obj` folder. In this case, you can specify the bin folder like `$(testsFolder)/bin/**/Axis.Tests.dll` – vernou Sep 08 '21 at 11:37
  • In this case my tests fail. I also tried to specify complete path $(testsFolder)/bin/Debug/netcoreapp3.1/Axis.Tests.dll but result is the same (tests fail). From this, I think $(testsFolder)/**/Axis.Tests.dll is ok, if tests run without problem – SamJ26 Sep 08 '21 at 11:52
  • Is it the same error message? – vernou Sep 08 '21 at 11:53
  • This is new exception: "The HTTP request to the remote WebDriver server for URL http://localhost:57379/session timed out after 60 seconds. The given key 'driver' was not present in the dictionary." – SamJ26 Sep 08 '21 at 11:55
  • Can you show the error message? – vernou Sep 08 '21 at 11:58
  • I updated post with main exception. – SamJ26 Sep 08 '21 at 12:03

0 Answers0