allure-framework / allure-framework/allure-csharp

Support NUnit's test classes out-of-box

Open
#365 0 comments 1 reaction 0 assignees View on GitHub
task:improvement theme:nunit
Dominant language
C#
Stars
125
Forks
76
Avg merge
1d 2h
Merged PRs (30d)
18

Description

Currently, one has to apply the `[AllureNUnit]` attribute to all their NUnit test classes (test fixtures in NUnit's terminology) in order for them to appear in the report.

The goal is to make this step unnecessary, picking all test fixtures up automatically.

### Motivation
It's a part of a larger goal to make allure-nunit usable completely out-of-box. See also #344, where a similar task related to allure-xunit is formulated.

### Example
The following usage:

```csharp
using NUnit.Framework;

namespace MyNamespace;

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

should produce the same result, as one with the attribute:

```csharp
using NUnit.Framework;
using NUnit.Allure.Core;

namespace MyNamespace;

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

### Notes
Research is needed on whether it can be achieved and how. Currently, a framework extension mechanism is used to listen test execution events. We should take a closer look at engine extension mechanisms: [Creating Engine Extensions](https://docs.nunit.org/articles/nunit-engine/extensions/creating-extensions/Index.html). Chances are, one of them (or some combination of them) will suite out needs.

### Backward compatibility
The `[AllureNUnit]` attribute should still be supported, although, obsoleted (it will become a noop basically).

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the current framework extension mechanism and NUnit's “Creating Engine Extensions” documentation linked in the issue. Determine whether an engine extension can discover NUnit test fixtures without [AllureNUnit], while preserving the attribute as a no-op for compatibility. Done means the example without the attribute produces the same report as the attributed example.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.