allure-csharp icon indicating copy to clipboard operation
allure-csharp copied to clipboard

Exceptions in setup methods do not generate results

Open vladdex opened this issue 1 year ago • 2 comments

I'm submitting a ...

  • [x] 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?

If something fails in a OneTimeSetup or Setup decorated method there are no results generated for the tests inside the class

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

Code Example

using NUnit.Allure.Core;

namespace allure;

[TestFixture]
[AllureNUnit]
public class SetupError
{
    [OneTimeSetUp]
    public void Setup()
    {
        Console.Out.WriteLine("SetupStep");
        throw new Exception("Exception");
    }

    [Test]
    public void Test1()
    {
        Console.Out.WriteLine("Test1");
    }
}

What is the expected behavior?

Test should be logged as skipped

What is the motivation / use case for changing the behavior?

Tests that are failed because of failed setup steps are completely missing from the report which can cause them to be missed completely

Please tell us about your environment:

  • Allure version: 2.1.0
  • Test framework: NUnit 3.13.3, Nunit3TestAdapter 4.4.2
  • Allure adaptor: Allure.NUnit 2.9.5-preview1
  • Generate report using: Allure CLI

Other information

This happens probably because of #325

vladdex avatar Apr 06 '23 08:04 vladdex

Fixing now.

neparij avatar Apr 11 '23 09:04 neparij

@neparij do you have an ETA for this ?

vladdex avatar May 10 '23 07:05 vladdex