NUnit Gui: Project Config Change from Menu Does Not Change AssemblyWatcher

Bug #603088 reported by Petteri Salo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit V2
Fix Released
High
Cvetomir Todorov

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.

Tags: gui

Related branches

Changed in nunitv2:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Petteri Salo (petteri-salo)
Revision history for this message
Charlie Poole (charlie.poole) wrote :

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

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Any progress on this?

Revision history for this message
Petteri Salo (petteri-salo) wrote :

Hi Charlie,

It seems I messed up something with launchpad, email, or something ... . I got your "Congratulations..." post (2010-07-09) in my email and responded to it on July the 17th ( see below). I suppose I should respond from the same email account as the one in my launchpad account. The mail on the launchpad account are forwarded to the account that I use at home ... and that is the one I responded from ...

The progress will be slow as I have to survive not being at work, but watching the kids .... :-)

-Petteri

On July the 17th I said :
Hi Charlie,

I just started my 4 week summer holiday and am not sure how much time I'll spend at the computer. Anyway, I'll see about fixing the bug though.

Petteri

Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 603088] Re: NUnit Gui: Project Config Change from Menu Does Not Change AssemblyWatcher

Hi Petteri,

Not a problem... I was glad to have you volunteer and was just worried
that I hadn't yet
heard from you.

Each bug creates a mini-mailing list about it and anything entered on
the bug goes
out to that list. Similarly, your responses post to the bug, but you
do have to use the
email account that is registered with launchpad. Alternatively, just
follow the link
in each email to use the web interface - which is simpler for some purposes.

You can mark the bug "In Progress" once you get going and if it takes a while
to work on it, then it will be helpful if you add a comment once in a
while. If the
particular bug became urgent, then I would let you know.

Let me know if any questions come up. Meanwhile, I'm marking this bug as
not part of the immediate release.

Charlie

On Wed, Jul 21, 2010 at 11:44 AM, Petteri Salo
<email address hidden> wrote:
> Hi Charlie,
>
> It seems I messed up something with launchpad, email, or something ... .
> I got your "Congratulations..." post (2010-07-09) in my email and
> responded to it on July the 17th ( see below). I suppose I should
> respond from the same email account as the one in my launchpad account.
> The mail on the launchpad account are forwarded to the account that I
> use at home ... and that is the one I responded from ...
>
> The progress will be slow as I have to survive not being at work, but
> watching the kids .... :-)
>
> -Petteri
>
> On July the 17th I said :
> Hi Charlie,
>
> I just started my 4 week summer holiday and am not sure how much time
> I'll spend at the computer. Anyway, I'll see about fixing the bug
> though.
>
> Petteri
>
> --
> 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.
>

tags: added: gui
Revision history for this message
Charlie Poole (charlie.poole) wrote :

Any progress? I have a guy available to do some work so I could give this to him
but if you prefer and are able to make some progress on it I will leave it with you.

Charlie

Revision history for this message
Petteri Salo (petteri-salo) wrote :

I have to be a realist here and say that it is best to give it to him. Assuming he has time to do it. My involvement with nunit at work is now zero and free time is being taken up by the upcoming hunting season and two screaming kids. I had hoped to fix the bug as a "self education/interesting study"-thingy while on holiday but that went and passed.

I'm sorry it didn't work. I did learn one thing though. Next time around with an OSS project I'll do a fix first and then suggest to someone to include it.

Best,

Petteri

Revision history for this message
Charlie Poole (charlie.poole) wrote :

Hey, no problem. When somebody volunteers, I try to give them something to do right away! But we all have conflicting priorities and it doesn't always work out.

Changed in nunitv2:
assignee: Petteri Salo (petteri-salo) → Cvetomir Todorov (cvetomir-todorov)
Changed in nunitv2:
status: Triaged → Confirmed
status: Confirmed → In Progress
status: In Progress → Fix Committed
Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 603088] Re: NUnit Gui: Project Config Change from Menu Does Not Change AssemblyWatcher

Looks good at a glance. My usual Windows machine is in the shop so the
review and
merge will have to wait till I finish setting up a VM.

Charlie

On Thu, Sep 9, 2010 at 11:45 AM, Cvetomir Todorov
<email address hidden> wrote:
> ** Changed in: nunitv2
>       Status: Triaged => Confirmed
>
> ** Changed in: nunitv2
>       Status: Confirmed => In Progress
>
> ** Changed in: nunitv2
>       Status: In Progress => Fix Committed
>
> --
> 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.
>

Changed in nunitv2:
milestone: none → 2.5.8
Changed in nunitv2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.