Bug 12481 - Running unit tests does not automatically build test assembly
Summary: Running unit tests does not automatically build test assembly
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: NUnit ()
Version: unspecified
Hardware: Macintosh Mac OS
: Low enhancement
Target Milestone: master
Assignee: Mike Krüger
URL:
Depends on:
Blocks:
 
Reported: 2013-05-30 19:07 UTC by Jen Savage
Modified: 2013-08-09 14:42 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Jen Savage 2013-05-30 19:07:21 UTC
Steps to reproduce:

1) Create a simple test case along the lines of:

		[Test()]
		public void NunitWorking() {
			Assert.IsTrue(true);
		}

2) Run the test, see it pass

3) Modify the test case so that it should fail:

		[Test()]
		public void NunitWorking() {
			Assert.IsTrue(false);
		}

4) Run the test, see it pass.

---

I am finding that I have to actually restart Xamarin Studio after modifying my code in order for nunit to see the code changes.
Comment 1 Mike Krüger 2013-05-31 00:39:41 UTC
You need to recompile the test project - you don't need to restart.
Comment 2 Jen Savage 2013-05-31 09:37:06 UTC
OK building tests works, but I did not need to do that previously.
Comment 3 Mike Krüger 2013-08-02 03:58:30 UTC
fixed
Comment 4 Alan McGovern 2013-08-09 13:04:10 UTC
The fix is incorrect. Executing a unit test now ignores the 'Build before execute' option in Xamarin Studio which means large projects have a significant delay when trying to execute a test.

http://screencast.com/t/ZusalVOGk

We need to respect the 'Build before execute' option. If this option is unchecked then executing a unit test should not build.
Comment 5 Mike Krüger 2013-08-09 14:42:46 UTC
The option is labeled 'Build before execute' and not 'Build before run tests'.

IMO the tests built in a former version even if build before execute wasn't set. 

I checked VS.NET and in their IDE this setting doesn't change that unit tests are built before they run. I even didn't find any option to turn that off.

We may add another option for that - reusing that doesn't make sense in all cases. 

For example it's against my workflow - I need to rebuild before I re-run tests anyways, running them once is enough (for me). But working on md with build before execute is a no go (I think you know why) ... building is terrible slow.

But really writing/changing tests requires frequent rebuilds, therefore it's annoying in that case to do it manually.

Anyways the original 'bug' is fixed - but I'll think about adding an option for turning it off for unit tests independently.