Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in AllureDisplayIgnoredAttribute if a test with cases marked with [Ignore] #518

Open
1 of 3 tasks
gamerka opened this issue Jun 4, 2024 · 0 comments
Open
1 of 3 tasks

Comments

@gamerka
Copy link

gamerka commented Jun 4, 2024

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?

If test class have test method with test cases with Ignore attribute.

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

Add test with cases to a test class with AllureDisplayIgnored attribute and mark the whole test method with Ignore attribute.
Run this test from IDE or with dotnet test - no results file for this test in allure-results directory.
Run debug of test from IDE, set breakpoint inside AllureDisplayIgnoredAttribute class in EmitResultForIgnoredTestInTestPlan method executing by steps you will catch an exception in AllureNUnitHelper.CreateTestResult(test).
Sample project: https://github.com/gamerka/allure-nunit-ignore-bug

What is the expected behavior?

Result files for this test appear in allure-results directory.

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

Currently I have not found any workaround, my ignored tests are just missing from reports.

Please tell us about your environment:

Other information

Exception:

System.InvalidCastException: 'Unable to cast object of type 'NUnit.Framework.Internal.ParameterizedMethodSuite' to type 'NUnit.Framework.Internal.TestFixture'.'
This exception was originally thrown at this call stack:
    Allure.NUnit.Core.AllureNUnitHelper.GetTestFixture(NUnit.Framework.Interfaces.ITest) in AllureNUnitHelper.cs
    Allure.NUnit.Core.AllureNUnitHelper.IterateAllAllureAttribites(NUnit.Framework.Interfaces.ITest) in AllureNUnitHelper.cs
    Allure.NUnit.Core.AllureNUnitHelper.UpdateTestDataFromAllureAttributes(NUnit.Framework.Interfaces.ITest, Allure.Net.Commons.TestResult) in AllureNUnitHelper.cs
    Allure.NUnit.Core.AllureNUnitHelper.CreateTestResult(NUnit.Framework.Interfaces.ITest) in AllureNUnitHelper.cs
    Allure.NUnit.Attributes.AllureDisplayIgnoredAttribute.EmitResultForIgnoredTestInTestPlan(NUnit.Framework.Interfaces.ITest) in AllureDisplayIgnoredAttribute.cs
    Allure.NUnit.Attributes.AllureDisplayIgnoredAttribute.AfterTest(NUnit.Framework.Interfaces.ITest) in AllureDisplayIgnoredAttribute.cs
    NUnit.Framework.Internal.Commands.TestActionItem.AfterTest(NUnit.Framework.Interfaces.ITest) in TestActionItem.cs
    NUnit.Framework.Internal.Commands.AfterTestActionCommand..ctor.AnonymousMethod__0(NUnit.Framework.Internal.TestExecutionContext) in AfterTestActionCommand.cs
    NUnit.Framework.Internal.Commands.AfterTestCommand.Execute(NUnit.Framework.Internal.TestExecutionContext) in AfterTestCommand.cs
    NUnit.Framework.Internal.Commands.AfterTestCommand.Execute.AnonymousMethod__0() in AfterTestCommand.cs
    ...
    [Call Stack Truncated]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants