Skip to content

Incorrect type for Test Fixtures when using running explore with a filter #3171

@cjconrad2

Description

@cjconrad2

Running nunit.framework v 3.11

Related to nunit/nunit-console/issues/409, and introduced by #2094, test fixtures are improperly marked with type="TestSuite" when running explore with a filter.

This is an example of an explore output with no filter:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-run id="2" testcasecount="219">
  <test-suite type="Assembly" id="0-1269" name="My.Tests.dll" fullname="My.Tests.Tests.dll" runstate="Runnable" testcasecount="219">
    <properties>
      <property name="Category" value="SmokeTest" />
      <property name="ParallelScope" value="Fixtures" />
      <property name="_PID" value="7132" />
      <property name="_APPDOMAIN" value="domain-" />
    </properties>
    <test-suite type="TestSuite" id="0-1270" name="My" fullname="Apt" runstate="Runnable" testcasecount="219">
          <test-suite type="TestSuite" id="0-1273" name="Tests" fullname="My.Tests" runstate="Runnable" testcasecount="219">
            <test-suite type="TestFixture" id="0-1000" name="ResxTest" fullname="My.Tests.ResxTest" classname="My.Tests.ResxTest" runstate="Runnable" testcasecount="2">
              <properties>
                <property name="Category" value="Resources" />
              </properties>
...

Where as this is an example with a filter 'cat == Resources'

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<test-run id="2" testcasecount="219">
  <test-suite type="Assembly" id="0-1269" name="My.Tests.dll" fullname="My.Tests.Tests.dll" runstate="Runnable" testcasecount="219">
    <test-suite type="TestSuite" id="0-1270" name="My" fullname="Apt" runstate="Runnable" testcasecount="219">
          <test-suite type="TestSuite" id="0-1273" name="Tests" fullname="My.Tests" runstate="Runnable" testcasecount="219">
            <test-suite type="TestSuite" id="0-1000" name="ResxTest" fullname="My.Tests.ResxTest" runstate="Runnable" testcasecount="2">
              <properties>
                <property name="Category" value="Resources" />
              </properties>
...

The linked issue also mentions that properties are missing which is true, but I want to limit the scope of this issue since it seems like a simpler fix.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions