Skip to content

Allure.NUnit preview: unexpected OneTimeSetUp in NUnit tests #374

Description

@delatrie

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

What is the current behavior?

A preview version of allure-nunit adds a OneTimeSetUp fixture for a test that doesn't have one.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

Given the following test (note, it doesn't have a one-time setup method or a setup fixture that affects it):

using NUnit.Allure.Core;
using NUnit.Framework;

namespace MyNamespace;

[AllureNUnit]
class MyTestFixture
{
    [Test]
    public void MyTest() { }
}

When we run the test, allure-nunit produces a *-container.json file with the following content:

{
  "uuid": "tc-0-1000",
  "name": "MyNamespace.MyTestFixture",
  "children": [
    "dcb2b701-ad1b-4071-ab73-d9253f85967d-tr-0-1001"
  ],
  "befores": [
    {
      "name": "OneTimeSetUp",
      "status": "passed",
      "statusDetails": {
        "known": false,
        "muted": false,
        "flaky": false
      },
      "stage": "finished",
      "steps": [],
      "attachments": [],
      "parameters": [],
      "start": 1691559272130,
      "stop": 1691559272132
    }
  ],
  "afters": [],
  "links": [],
  "start": 1691559272124,
  "stop": 1691559272167
}

It renders the OneTimeSetUp fixture in the Set up section of the report:

What is the expected behavior?

Only fixtures defined in the code are included in the report.

Please tell us about your environment:

  • Allure version: 2.23.0
  • Test framework: NUnit@3.13.3
  • Allure adaptor: allure-nunit (unpublished)

Other information

The fixture is started here regardless of whether a test contains a one-time setup or not.

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions