allure-framework / allure-csharp

Allure integrations for C# test frameworks
https://allurereport.org/
Apache License 2.0
104 stars 64 forks source link

Support SelectiveRun on ARM processors #496

Open Peyzzz opened 1 month ago

Peyzzz commented 1 month ago

[//]: # ( . Note: for support questions, please create a discussion at https://github.com/orgs/allure-framework/discussions. . This repository's issues are reserved for feature requests and bug reports. . . Make sure you have a clear name for your issue. The name should start with a capital . letter and no dot is required in the end of the sentence. An example of good issue names: . . - The report is broken in IE11 . - Add an ability to disable default plugins . - Support emoji in test descriptions )

I'm submitting a ...

What is the current behavior?

Selective Run doesn't work on Macs with M2 processors. dotnet test execute all test from my repo. This is not ok. My problem doesn't reproduce on Windows and MacBook with Intel processors. I attached latest projects Allure.Specflow and Allure.Net.Commons to my project to debug where is a problem.

Allure.SpecFlow.SelectiveRun.AllureSpecFlowPatcher.cs Line(29) try { InjectTestPlanSupport(unitTestRuntimeProvider); } catch (Exception e) { logError(e); }

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

System.NotImplementedException: The method or operation is not implemented. at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo) at HarmonyLib.PatchProcessor.Patch() at HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer) at Allure.SpecFlowPlugin.SelectiveRun.AllureSpecFlowPatcher.PatchRunnerFactory(Harmony patcher, MethodInfo factoryCandidate) in /Users/blabla/repo/allure-csharp/Allure.SpecFlow/SelectiveRun/AllureSpecFlowPatcher.cs:line 94 at Allure.SpecFlowPlugin.SelectiveRun.AllureSpecFlowPatcher.PatchRunnerFactories(Harmony patcher, IEnumerable1 factoryCandidates) in /Users/blabla/repo/allure-csharp/Allure.SpecFlow/SelectiveRun/AllureSpecFlowPatcher.cs:line 85 at Allure.SpecFlowPlugin.SelectiveRun.AllureSpecFlowPatcher.InjectTestPlanCheckToTestRunner(Harmony patcher) in /Users/blabla/repo/allure-csharp/Allure.SpecFlow/SelectiveRun/AllureSpecFlowPatcher.cs:line 48 at Allure.SpecFlowPlugin.SelectiveRun.AllureSpecFlowPatcher.InjectTestPlanSupport(IUnitTestRuntimeProvider unitTestRuntimeProvider) in /Users/blabla/repo/allure-csharp/Allure.SpecFlow/SelectiveRun/AllureSpecFlowPatcher.cs:line 43 at Allure.SpecFlowPlugin.SelectiveRun.AllureSpecFlowPatcher.EnsureTestPlanSupportInjected(IUnitTestRuntimeProvider unitTestRuntimeProvider, Action1 logError) in /Users/blabla/repo/allure-csharp/Allure.SpecFlow/SelectiveRun/AllureSpecFlowPatcher.cs:line 29

What is the expected behavior?

Tests included in testplan.json should be executed, and the rest skipped.

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

Maybe there is another way to enable SeleciveRun on MacBooks with ARM processors? It is unclear how long Lib.Harmony>MonoMod will be fixed.

Please tell us about your environment:

Other information

Related issues: PatchFunctions.UpdateWrapper NotImplementedException on MacOS - Closed Supporting Apple Silicon - Open

delatrie commented 1 month ago

Hi, @Peyzzz . Thank you for the report. Unfortunately, it's unlikely I will have enough time to address that in the near future, though.

Consider migrating to Reqnroll, the reboot of SpecFlow by its original author. Allure.Reqnroll doesn't use Harmony to implement Selective run and, thus, should work on ARM.

Peyzzz commented 1 month ago

Hi @delatrie,

thank you also for your feedback. It seems that the migration to Allure.Reqnroll solved my problem. Thank you for the hint ;)