SpecFlowOSS / SpecFlow

#1 .NET BDD Framework. SpecFlow automates your testing & works with your existing code. Find Bugs before they happen. Behavior Driven Development helps developers, testers, and business representatives to get a better understanding of their collaboration
https://www.specflow.org/
Other
2.23k stars 752 forks source link

addNonParallelizableMarkerForTags feature is not working as expected #2562

Closed go-green closed 2 years ago

go-green commented 2 years ago

SpecFlow Version

3.9.52

Which test runner are you using?

SpecFlow+ Runner

Test Runner Version Number

3.9.31

.NET Implementation

equal or greater .NET Framework 4.6.1

Project Format of the SpecFlow project

Classic project format using packages.config

.feature.cs files are generated using

SpecFlow.Tools.MsBuild.Generation NuGet package

Test Execution Method

Visual Studio Test Explorer

SpecFlow Section in app.config or content of specflow.json

{
    "bindingCulture": {
        "language": "en-us"
    },
    "language": {
        "feature": "en-us"
    },
    "stepAssemblies": [
        {
            "assembly": "xxxxxxxx"
        },
        {
            "assembly": "yyyyyy"
        }
    ],
    "generator": {
        "addNonParallelizableMarkerForTags": [
            "NotParallel"
        ],
        "allowDebugGeneratedFiles": true
    }
}

Issue Description

I have some features tagged with @NotParallel at the feature level and as per the documentation, my understanding is that those features will not run in parallel with other features. However, when I execute two feature files (one tagged with @NotParallel & another not tagged ), I noted that specflow runs tests from both feature files at the same time. I tried both testSchedulingMode = Random and Sequential. My specflow.json file was copied to the output directory. I could not see any special attributes in the generated *.feature.cs files to run tests in parallel. All I want is to run some tests sequentially in the same run without having to add another build configuration dedicated for sequential tests.

<?xml version="1.0" encoding="utf-8"?>
<TestProfile xmlns="http://www.specflow.org/schemas/plus/TestProfile/1.5">
    <Settings projectName="xxxxxx.Tests" projectId="{8d209dac-b1b6-49e6-808e-3b35aa454976}" />
    <Execution stopAfterFailures="0" testThreadCount="6" testSchedulingMode="Sequential" retryCount="0" apartmentState="MTA" />
    <Environment testThreadIsolation="SharedAppDomain"/>
    <TestAssemblyPaths>
        <TestAssemblyPath>xxxxxx.Tests.dll</TestAssemblyPath>
    </TestAssemblyPaths>
    <Report>
        <Template name="Reports\xxxReport.cshtml" outputName="xxxReport.html" />
    </Report>
    <Filter>!@Manual &amp; !@Deprecated</Filter>
</TestProfile>

Steps to Reproduce

Link to Repro Project

No response

SabotageAndi commented 2 years ago

The SpecFlow+ Runner doesn't support this option.

Also be aware, that we stopped the development of the SpecFlow+ Runner. More details at: https://specflow.org/using-specflow/the-retirement-of-specflow-runner/

github-actions[bot] commented 2 years ago

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.