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
Using nunit.console.exe (3.15.0) with .nunit input and --inprocess still doesn't work #1186
Comments
This is a bit hard to answer, primarily due to "I presume that the NUnit folder comes from a zip, since it's being copied into the build output folder by a post-build event..." It sounds as if your team has set up some non-standard way of installing NUnit... apologies if that's not the case. If that's what happening, it's certainly a valid approach, but not one I can help you with unless you can tell me precisely what is being done. Can you get info from whomever set this up? Alternatively, provide a full listing of all the files in each directory. The sub-problem you are having with an NUnit Project is easy to answer, however. You cannot use an NUnit project without installing the NUnit project loader extension. Similarly you cannot use output format But what really counts is to describe precisely which NUnit files are where! BTW, there's no evidence in your output that |
Hey @CharliePoole, I've asked the team responsible for the project, in the meanwhile I've generated the folder & file structure for the NUnit folder:
Hope this helps |
@CharliePoole |
@CharliePoole Since we're not really using NuGet to install & maintain NUnit, I was wondering if the changes i've made are sufficient or if there's something I can do differently. Right now I have:
With these changes, I was able to utilize the NUnit Project file and the dll was correctly loaded from the subfolder 😄 🙏 One question comes to mind: *Edit: |
Going to close this, as my issue is solved. Thanks for the swift response! |
Glad you have it fixed! Regarding the addins file, I think that it's generally a better practice to leave the addins file installed by NUnit untouched and add your own. However, in your case, you are not using the delivered addins file, which you copy, since it contains relative paths, which only work when both the engine and the extensions are installed via nuget. So, you may as well completely replace it using your own paths. |
Hey,
Either I'm extremely stupid, or using NUnit project files while defining --inprocess still doesn't work (although it is supposed to work, according to #386)
This is the first time ever I'm using NUnit though, and it's an existing code base and unit test setup.
I've only been moving dlls around and I'm now struggling with getting some tests to work that depend on a DLL thats no longer in its old location but else where.
Some (fictional) context
Let me first provide some context as to how the tests are being run and how the context looks like in which the tests are being run.
For sake of simplicity, I've simplified paths and filenames
My folder structure is as follows: (located in D:\sources\myproject\bin\release)
I presume that the
NUnit
folder comes from a zip, since it's being copied into the build output folder by a post-build event on some project which contains the NUnit folder and has it checked into source control with all its contentsThe
subfolder/my.dll
used to reside in the root, alongsidetest.dll
and everything worked great.The tests were being executed using the following command:
NUnit\tools\nunit3-console.exe test.dll /inprocess /work:"D:\sources\myproject\bin\release\UT_Results" /result:test.xml;format=nunit2 /out:TestResult_test.txt
The problem
Now with
my.dll
being moved intosubfolder
, I get a "System.IO.FileNotFoundException: Cannot load file or assembly" as expected.I look around and stumbled upon the NUnit Project, which seem to have a solution for my problem, namely the binpath setting
So I created the following NUnit project by hand and placed it in the root folder, along side
test.dll
, namedtest.nunit
:Then when attempting to run the test with the following command:
NUnit\tools\nunit3-console.exe test.nunit /inprocess /work:"D:\sources\myproject\bin\release\UT_Results" /result:test.xml;format=nunit2 /out:TestResult_test.txt
I get the following output:
I'm not able to execute the test assembly without the
/inprocess
, as i'm greeted with other errors.NUnit\tools\nunit3-console.exe test.dll /work:"D:\sources\myproject\UT_Results" /result:test.xml;format=nunit2 /out:TestResult_test.txt
, which is the same command that used to work but without the/inprocess
, will yield the following error:So I'm kind of starting to pull my hair out here.
I solved the issue with the dlls being moved for our executable by adding a probing element to its configuration file but I don't think such a thing is possible for the
nunit3-console.exe
?I hope you can shed some light onto this issue or if it's an error on my end.
Thanks!
The text was updated successfully, but these errors were encountered: