Error: Multiple files are matching the pattern
AnsweredI 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-9b4b59432ffa\0.6.961\index.js:172:3)
If I check bin folder in my computer, there is just one Axis.Tests.dll file
Anyway, Axis.Tests.dll is in both /bin and /obj folders. Is this a problem ?
-
I think the issue here is your relative path and the matching pattern -
tests/Axis.Tests/**/Axis.Tests.dll
It is looking for this .dll in any file after Axis.Tests.
If you extend the path to be more specific you should be ok :)
Let me know.
0 -
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
I also rised a question on StackOverflow: https://stackoverflow.com/questions/69102229/specflow-living-docs-generator-error-multiple-files-are-matching-the-pattern
0 -
Hi Samuel Janek,
The recent error you provided regarding the webdriver is not related to SpecFlow or the LivingDoc plugin.
This issue must be happening in your test execution?
0 -
Hello, the issue is not probably in my code. Right now I tried to execute the tests and generate living docs using LivingDocs CLI and everything works. I followed this tutorial: https://docs.specflow.org/projects/getting-started/en/latest/GettingStarted/Step9.html. So the issue can not be in code.
0 -
The webdriver timeout is unrelated to LivingDoc.
The issue in your original error is with your relative path matching multiple files with the same name.
0
Please sign in to leave a comment.
Comments
5 comments