Closed atbe-crowe closed 5 years ago
To add, when I switch my test runner to be MSTest
, my tests run successfully. I can't find any documentation on whether specrunner is compatible with linux or not.
We got the same issue today from another user. I will have a look at it next week. No idea what is going wrong here. We have no COM stuff in SpecFlow+Runner.
@SabotageAndi yes, it's very odd. I'll try to exclude all of my application code and create a fresh new project that contains the simple out of the box calculator tests and see if I can reproduce the issue.
@SabotageAndi I have created a reproducible sample project here. You can try to build and run the tests on that project in a linux container and it will fail consistently with the error described at the top of this post.
@SabotageAndi in addition, I have pushed a Dockerfile
that you can build and run to see the issue.
Output:
PS C:\Data\Projects\git\Reproduce-COM-Bug-Specrun> docker run -it repro-specrun-issue
Build started, please wait...
-> Using default config
Build completed.
Test run for /src/CroweTaxConnectTests/bin/Debug/netcoreapp2.2/CroweTaxConnectTests.dll(.NETCoreApp,Version=v2.2)
Microsoft (R) Test Execution Command Line Tool Version 15.9.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
An exception occurred while invoking executor 'executor://specrun/executorV3.0.352': COM interop is not supported on this platform.
Test Run Failed.
Additionally, path to test adapters can be specified using /TestAdapterPath command. Example /TestAdapterPath:<pathToCustomAdapters>.
Thanks for it. We are currently looking into it. When we know more, I will inform you.
@SabotageAndi - Can we get this fix quickly please as this has blocked our CI/CD pipeline.
@david1995 and I are working on it. Interesting is, that we don't get this COM Error in WSL or in a complete VM. We get it only in the Docker container.
@atbe-crowe We found a workaround to get the tests executed in Docker container.
We adjusted your srProfile to this:
<?xml version="1.0" encoding="utf-8"?>
<TestProfile xmlns="http://www.specflow.org/schemas/plus/TestProfile/1.5">
<Settings
projectName="CroweTaxConnectTests" />
<Execution
stopAfterFailures="0"
testThreadCount="1"
testSchedulingMode="Random"
retryFor="Failing"
retryCount="1" />
<Environment testThreadIsolation="SharedAppDomain" />
<Report disable="true" />
<!-- For collecting by a SpecRun server update and enable the following element. For using the
collected statistics, set testSchedulingMode="Adaptive" attribute on the <Execution> element.
<Server serverUrl="http://specrunserver:6365" publishResults="true" />
-->
<TestAssemblyPaths>
<TestAssemblyPath>CroweTaxConnectTests.dll</TestAssemblyPath>
</TestAssemblyPaths>
<DeploymentTransformation>
<Steps>
<!-- sample config transform to change the connection string-->
<!--<ConfigFileTransformation configFile="App.config">
<Transformation>
<![CDATA[<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyDatabase" connectionString="Data Source=.;Initial Catalog=MyDatabaseForTesting;Integrated Security=True"
xdt:Locator="Match(name)" xdt:Transform="SetAttributes(connectionString)" />
</connectionStrings>
</configuration>
]]>
</Transformation>
</ConfigFileTransformation>-->
</Steps>
</DeploymentTransformation>
</TestProfile>
What this does is:
The reason for the first and second point is, that we used .NET Standard/Core APIs that are not working on Linux and Mac OS, but in the documentation nothing was mentioning this. :-/ We only found out of this, as we added the API Analyzer. See https://docs.microsoft.com/en-us/dotnet/standard/analyzers/api-analyzer for more information. I can highly recommend to use it.
The report generation needed to be disabled, because this works currently on .NET Framework.
Some of the stuff is quicker to fix, some will take a little time. We will work on this as fast as possible.
@SabotageAndi - We are using SpecRun for parallel execution and for genrating the report. Can you suggest a Unit test provider which can be used by the time this issue is fixed. Unit test provider which works fine with Specflow 3 on .NetCore + Support parallelization + Generate report + Run inside Docker container. Looking forward to hearing from you.
We fixed the first issue and with the next version parallel execution in the SharedAppDomain mode should be possible again. Report generation is the next thing we will have a look at.
The new version should be out tomorrow or next Monday.
@SabotageAndi - Any new build version expected today?
I hope so. The release pipelines are running.
@SabotageAndi - with new Version - Test cases are not getting executed. And no error is being displayed either while running it in Docker Linux machine. Here is what I am seeing on the screen:
Command to execute test - dotnet vstest project.dll
The current user does not have a license assigned. This version can be used for evaluation purposes only. For obtaining a registered license please visit http://www.specflow.org/plus. ! Test1 [8ms] ! Test2 [< 1ms] ! Test3 [< 1ms] ! Test4 [< 1ms] Attachments:
You have so less output, because dotnet test
standard loglevel is really low. If you execute it with normal, you get more output.
The 3.0.373 version is not yet the version that enables parallel execution in SharedAppDomain again. 3.0.377 will be the version. We found another issue that needed to be fixed for the parallel execution.
Okay. Lets wait for the next version then. Let me know when can we expect next version
The release pipeline is still running. So it will take until tomorrow morning until the version is on NuGet.org
3.0.377 is now uploaded to NuGet.org.
@zeeshankhan0330 Did you able to run your tests successfully on Linux ? I am also trying to run the specflow tests using Specflow+Runner 3.0.377.
But first issue is I am not able to register my License on linux!
@SabotageAndi @zeeshankhan0330 Any solution to make it work! I am new to Linux world. Tests are running fine on Windows 10.
Hi @SabotageAndi and Team,
May I know when will parallel execution and report generation solution is expected to be out? As we have disabled this to work in Docker
Hi @SabotageAndi
My Tests were running fine on docker with the above settings until last week. But today its crashing.
12:54:48 Status: Image is up to date for docker-registry:5000/solar_webshop_automation:staging-latest
12:54:49 Microsoft (R) Test Execution Command Line Tool Version 16.2.0-preview-20190606-02
12:54:49 Copyright (c) Microsoft Corporation. All rights reserved.
12:54:49
12:54:49 Starting test execution, please wait...
12:54:51 *****
12:54:51 * Evaluation mode *
12:54:51 *****
12:54:51
12:54:51 The current user does not have a license assigned.
12:54:51 This version can be used for evaluation purposes only.
12:54:51 For obtaining a registered license please visit http://www.specflow.org/plus.
12:55:35 The active test run was aborted. Reason: Test host process crashed : Unhandled Exception: System.Net.Sockets.SocketException: Operation canceled
12:55:35 at System.IO.Pipes.NamedPipeServerStream.
Has anyone else reported the same error.
Nothing has been changes but keeps on reporting the same error.
Default.srprofile:
<?xml version="1.0" encoding="utf-8"?>
<TestProfile xmlns="http://www.specflow.org/schemas/plus/TestProfile/1.5">
<Settings projectName="WebShopTestAutomation" />
<Execution testThreadCount="1" retryCount="1"/>
<!-- For collecting by a SpecRun server update and enable the following element. For using the
collected statistics, set testSchedulingMode="Adaptive" attribute on the <Execution> element.
-->
<Environment testThreadIsolation="SharedAppDomain" />
<Report disable="true" />
<TestAssemblyPaths>
<TestAssemblyPath>WebShopTestAutomation.dll</TestAssemblyPath>
</TestAssemblyPaths>
<Targets>
<Target name="Headless_Chrome">
<Filter>Headless_Chrome</Filter>
<DeploymentTransformationSteps>
<EnvironmentVariable variable="Test_Browser" value="Headless_Chrome" />
</DeploymentTransformationSteps>
</Target>
</Targets>
</TestProfile>
Can you please help urgently...
@SavitaMaurya You get the error, because the SpecFlow+Runner can't communicate with it's child processes. If you set the testThreadIsolation
to SharedAppDomain
the error should go away.
@SabotageAndi Thanks for the reply. Its already done and was behaving fine on Linux containter till friday. I have updated the comment by attaching the file.
Ah, the Markdown was broken. It's fixed now.
Can you check the Default.srProfile file in your bin\debug folder if it has the correct content?
Ya.. its same in debug folder..
The Markdown was broken. It's fixed now. >> Can you explain this.. Do I need to take any update?
As I am still facing the same error
The Markdown was broken. It's fixed now. >> Can you explain this..
If you paste xml directly into a textfield, it will not displayed correctly. You have to surround them with triple ticks ```
@SavitaMaurya did anything else changed in your project? Your config looks good. With the given information, I have currently no idea what could be the cause of the error.
@SabotageAndi Ya.. to keep the code repository upto standards I removed the bin, obj,.vs folder and that broked everything. I realized after trying many things the SpecflowPlusRunner folder in bin has to be there to make things work.
So I checked in that again and now everything is working fine.
Thanks for helping.
Hello @SabotageAndi,
I had the same issue with test execution and reports on Mac OS using SpecRunner 3.0.391. I used SharedAppDomain to be able to run tests as suggested in previous comments - this fixed test execution but is there any progress with report generation issue?
When I try to generate reports (JSON and HTML) it shows this error:
"Could not generate test run result reports. An error occurred in the generator.
External program returned exit code '254'
Failed generating reports"
@MatejStraka
Sorry, we forgot to update the issue. Reporting in Docker- Containers is working now. But you need to install mono
in them.
See https://specflow.org/plus/documentation/Reports/ - "Additional Requirements for Non-Windows Users"
Hi Andy,
Is the report available for community version as well?
On Mon, Oct 21, 2019, 8:00 PM Andreas Willich notifications@github.com wrote:
@MatejStraka https://github.com/MatejStraka Sorry, we forgot to update the issue. Reporting in Docker- Containers is working now. But you need to install mono in them. See https://specflow.org/plus/documentation/Reports/ - "Additional Requirements for Non-Windows Users"
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/techtalk/SpecFlow/issues/1662?email_source=notifications&email_token=AEOYUKI5OR7TQEDPYQXDBUTQPW4H7A5CNFSM4ICLOK3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB2QWKY#issuecomment-544541483, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEOYUKIT2YEVBNYSPJTMAV3QPW4H7ANCNFSM4ICLOK3A .
@zeeshankhan0330 There are no reports in the open source project currently. See details: https://github.com/techtalk/SpecFlow/issues/1036
So, it took longer than we wanted, but the SpecFlow+Runner is now working in Docker with Reports and Parallel Execution in different processes.
You have to update to 3.1.21-beta
.
You can find an example for it here: https://github.com/techtalk/SpecFlow.Plus.Examples/tree/master/DockerExample Be aware that you need mono installed in your Docker image that you can generate reports.
The documentation is now yet fully there.
Please open new issues if you find issues with the Docker support.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm unable to execute my specflow tests on a linux machine with dotnet and am encountering the following error:
SpecFlow Version:
Used Test Runner
Version number:
3.0.352
Project Format of the SpecFlow project
packages.config
<PackageReference>
tags.feature.cs files are generated using
SpecFlow.Tools.MsBuild.Generation
NuGet packageSpecFlowSingleFileGenerator
custom toolVisual Studio Version
Enable SpecFlowSingleFileGenerator Custom Tool
option in Visual Studio extension settingsAre the latest Visual Studio updates installed?
<Major>.<Minor>.<Patch>
.NET Framework:
Test Execution Method:
Command used:
dotnet test --filter "(TestCategory=tc:48193)" CroweTaxConnectTests/CroweTaxConnectTests.csproj
<SpecFlow> Section in app.config or content of specflow.json
Repro Project
Issue Description
Here is the entire output of the test execution:
Steps to Reproduce