xUnitRevit
xUnitRevit copied to clipboard
No test show up after loading a test assembly
Prerequisites
- [x] I read the contribution guidelines
- [x] I checked the documentation and found no answer.
- [x] I checked existing issues and found no similar issue.
- [x] I checked the community forum for related discussions and found no answer.
- [x] I'm reporting the issue to the correct repository (see also speckle-server, speckle-sharp, specklepy, speckle-docs, and others)
What package are you referring to?
xUnitRevit
Describe the bug
I was hoping that you could help me with this issue: I cloned and built xUnitRevit the add-in for Revit 2022 I tried to create a sample test assembly to load on the plug in and run.
The bug is: I can load the .dll inside xUniRevit but I see no test cases.
I tried with the SampleLibrary provided in the repo, as well with creating a new project tagetting .NET Framework 4.8 and basically copying one test inside a class.
To Reproduce
Launch Revit
(No document is open)
Go to Add-ins tab, launch Test Runner
Assembly -> Open -> Go to \xUnitRevit\SampleLibrary\bin\Debug\SampleLibrary.dll
Expected behavior
Some test cases would show on the window.
Screenshots
System Info
If applicable, please fill in the below details - they help a lot!
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Additional context
Proposed Solution (if any)
Optional: Affected Projects
me too, but nobody support it
This usually happens if some unnecessary dlls end up in the library folder (eg the RevitAPI.dll) @connorivy might have more insights!
This could also be due to the newest nuget version of xunit. I experienced the same behaviour when using the nuget package 2.5.3 of xunit.
There is probably some bug while discovering tests by the xunitRevitRunner with the newer versions.
Switching back to 2.4.2 solves the problem.
Thanks, @agnBIM, for the helpful tip! Upon further investigation, I delved deeper into resolving the compatibility issue with the latest version of xUnit. It turned out that the problem didn't lie in the newest xUnit version itself. Instead, it occur when different versions of xUnit were utilized within both the Addin and the user tests library.
To overcome this, I updated all xUnit package references to the latest version (2.7.0 as of today) in my local repository (all projects/solutions has to be updated!), which I cloned from here. After updating the references, I rebuilt the solutions to ensure the copy of the new Addin files.
Since implementing these changes, everything has been functioning seamlessly. The addin now successfully discovers and displays custom tests libraries referencing xUnit 2.7.0
Additionally, I've forked the repository and made the necessary updates to xUnit 2.7.0. Anyone can feel free to clone it and build your addin with if you don't want to do the change yourself : https://github.com/Mehdi-Lucas/xUnitRevit For the rest just follow the same instructions as usual.
I'm relatively new to using this tool, and it's possible that the Speckle team hasn't upgraded to a newer version for a specific reason, possibly due to a bug unknow to me so proceed with caution. I just hope this tool is still supported, it seems pretty usefull.