nunit-core team mailing list archive
-
nunit-core team
-
Mailing list archive
-
Message #00631
[Bug 603088] Re: NUnit Gui: Project Config Change from Menu Does Not Change AssemblyWatcher
Hi Petteri,
Congratulations! You now own the bug. :-)
Tests are in TestLoaderAssemblyTests.cs and are embarassingly scarce.
They are rather hign level and provide no verification that the
FileWatcher is set up - which probably explains why it doesn't work
correctly.
Two ways to go here - at your option:
1) Introduce some proper testing that the watcher is set up.
2) Just fix it, since we plan on rewriting this whole part of the app for 3.0.
Ideas/Suggestions...
A proper test would call for either injecting the watcher so it can be mocked
or changing it into a Service. This may be more effort than you want to put
in for a change that won't live beyond 2.x. (See why below)
I would see no problem with just giving TestLoader a Watcher property
with a getter only in order to test that the watcher changes on reload.
There are no tests _at_all_for reload, so I suggest adding them before
you refactor.
Future Implications...
This whole area around TestLoader needs a lot of restructuring, particularly
as we move to distributed testing.
File watching will probably be removed from this level and placed in what
is now called the core so we can work across machines. Alternatively,
it may go into a small stub - similar to the existing nunit-agent - that
controls execution on each machine. In any case, it will be separated
more cleanly from TestLoader.
Thanks for your help! I'd like to add you to the dev team. See
https//launchpad.net/~nunit-dev
Charlie
Alternatively, it may be
--
NUnit Gui: Project Config Change from Menu Does Not Change AssemblyWatcher
https://bugs.launchpad.net/bugs/603088
You received this bug notification because you are a member of NUnit
Developers, which is subscribed to NUnit V2.
Status in NUnit V2 Test Framework: Triaged
Bug description:
- NUnit 2.5.5.10112
- nunit-x86.exe
- Windows 7 64 Bit.
Create an nunit project with two configurations: Debug and Release. Set each config to load one assembly but from different paths, for example:
win32\debug\some_assembly.dll
win32\release\some_assembly.dll
Save the project, when config is set to debug. Close and re-start nunit-x86.exe, load the project. Then modify your debug dll and observe how it gets reloaded by nunit. Then change the config to release in nunit and modify your release dll so that it should get reloaded by nunit. It does not. Then change the debug dll version again and observe how nunit reloads the assembly even though the config is still release.
I had a look into the sources (2.5.5.10112) and I think the bug is in NUnit.UtilTestLoader class in method NUnit.Util.TestLoader.ReloadTest(), it does not call InstallWatcher() like NUnit.Util.TestLoader.LoadTest() does.
I think ReloadTest and LoadTest methods need refactoring as the code is almost the same.
If someone can advise me how and where to add a unit test for this case, then I could try to do the fix and refactoring myself and post the result.
References