shekharpro / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Add VSTT integration for NUnit. #373

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create "normal" test project in VS 2008
2. Add link to nunit.framework
3. Write an nunit test
4. Try to run it from within visual studio by selecting "run all tests in
solution"

What is the expected output? What do you see instead?
Instead of an error message tell me what to do, I receive this:

[error] Could not resolve the location of an NUnit test assembly.
    Location: C:\Documents and Settings\*****\My
Documents\Web-Eval\htdocs\messweb.test\bin\Debug\Messweb.Test.dll
    Reference: Messweb.Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
    Details: Gallio.Reflection.ReflectionWrapperResolveException: Could not
resolve Assembly 'Messweb.Test, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'.
   bei
Gallio.Reflection.Impl.ReflectorResolveUtils.ResolveAssembly(IAssemblyInfo
assembly, Boolean fallbackOnPartialName, Boolean throwOnError) in
c:\RelEng\Projects\MbUnit
v3\Work\src\Gallio\Gallio\Reflection\Impl\ReflectorResolveUtils.cs:Zeile 68.
   bei Gallio.Reflection.Impl.StaticAssemblyWrapper.Resolve(Boolean
throwOnError) in c:\RelEng\Projects\MbUnit
v3\Work\src\Gallio\Gallio\Reflection\Impl\StaticAssemblyWrapper.cs:Zeile 111.
   bei
Gallio.NUnitAdapter.Model.NUnitTestExplorer.CreateAssemblyTest(IAssemblyInfo 
assembly)

What version of the product are you using? On what operating system?
Visual Studio 2008, Windows XP SP3, Gallio 3.0.5. build 546

Please provide any additional information below.
http://groups.google.com/group/MbUnitUser/browse_thread/thread/957b79c41588c6f4/
7eaceef0d2777c20?lnk=gst

PS: This is my first issue around here, please be patient with me ;)

Original issue reported on code.google.com by straufl@gmail.com on 26 Jan 2009 at 2:36

GoogleCodeExporter commented 8 years ago
I first thought that it might have to do with a not existing assembly. Turns 
out that
it doesn't matter, whether the assembly exists or not.

Original comment by straufl@gmail.com on 26 Jan 2009 at 2:39

GoogleCodeExporter commented 8 years ago
I'll check it out as soon as I can.

Original comment by jeff.br...@gmail.com on 7 Feb 2009 at 10:10

GoogleCodeExporter commented 8 years ago
Looks like it mainly appears with NUnit-Tests

Original comment by straufl@gmail.com on 19 Mar 2009 at 7:31

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I'm getting a similar problem using XP-SP3, VS 2008-SP1, Nant .086 and Gallio 
3.0.6. 
I traced the code back through RunWithRuntime() the following line:

            IReportManager reportManager = 
RuntimeAccessor.Instance.Resolve<IReportManager>();

Folowing this to the IRuntime interface, I found a typo in the Resolve(string 
componentId) overload of the definition. My error is actually calling the <T> 
version, but it may be relevant. I've attached my build log with the error.

I found the relevant call in the WindsorRuntime, and it looks like it just 
passes 
the resolve request through to the container, at which time it's out of my 
sight.

As far as I can tell, I've got all my dll's together, but I bet there's 
something 
I'm missing. I post here b/c of the definite problem in the interface 
definition.

Original comment by jazmatic...@gmail.com on 1 Apr 2009 at 3:23

Attachments:

GoogleCodeExporter commented 8 years ago
The NUnit issue is caused because Gallio does not support running NUnit tests 
in VSTS
using the VSTS Test View.  That's because when VSTS asks Gallio to populate 
tests, we
load up the test assembly using Mono.Cecil instead of standard .Net reflection 
(which
would require us to create a new AppDomain to avoid locking assemblies inside 
Visual
Studio).  Unfortunately NUnit needs .Net reflection to work so test population 
fails.

A similar problem exists when Gallio attempts to populate NUnit tests in 
ReSharper
(although ReSharper provides its own NUnit emulation so it is moot.)

I can try to work around the issue to enable VSTS support for NUnit via Gallio 
if you
like although it's a bit of work and I should warn you that the performance 
would be
a bit poor (due to the overhead of spawning a new AppDomain).  Would that still 
be of
value to you?

Original comment by jeff.br...@gmail.com on 27 Apr 2009 at 5:58

GoogleCodeExporter commented 8 years ago
The build log issue is something completely different.  Here it looks like some
Gallio components have not been installer correctly.  Perhaps you copied part 
of it
into the source tree but missed some important bits.  In particular, the
Gallio.Reports.plugin file and related files are likely missing.

Original comment by jeff.br...@gmail.com on 27 Apr 2009 at 6:00

GoogleCodeExporter commented 8 years ago
Thanks for investigating. The thing is: We don't have VSTS only VS08 Pro ...

Original comment by straufl@gmail.com on 28 Apr 2009 at 6:12

GoogleCodeExporter commented 8 years ago
Sorry, I'm being sloppy in my use of Microsoft SKUs.  I should say Visual 
Studio Test
Tools which is partially bundled with Visual Studio 2008 Pro.

Original comment by jeff.br...@gmail.com on 28 Apr 2009 at 7:26

GoogleCodeExporter commented 8 years ago
Thanks for clarification ;)

Since I'm quite used to Icarus, it's not really necessary to invest that effort 
to
make it work. A better error message would be great, though.

Original comment by straufl@gmail.com on 4 May 2009 at 6:00

GoogleCodeExporter commented 8 years ago

Original comment by jeff.br...@gmail.com on 23 May 2009 at 1:53

GoogleCodeExporter commented 8 years ago
We are expiriencing a problem with Resharper 4.5.1231.7, nunit 2.5 and Gallio
3.0.6.787 that is possibly related to this. When we disable the Resharper NUnit
runner, Reharper does not recognise our NUnit test through the Gallio plugin. We
would prefer to use the same test runner in our IDE's than on our build server, 
where
we are using the Gallio Echo command line runner. Is there an effort to enable 
this,
our should we explore other workarounds?

P.S. thanks for a great test automation platform

Original comment by kobus...@gmail.com on 15 Jun 2009 at 12:37

GoogleCodeExporter commented 8 years ago
That is correct.  Due to how Gallio integrates with NUnit it is unable to 
recognize
NUnit tests natively inside ReSharper for the same reason we do not offer VSTT
support for NUnit.  For Gallio to support NUnit in those environments we would 
need
to create a partial emulation of how NUnit explores its tests.  It's pretty
straightforward but not on the plan just now.

For now I would recommend that you consider using TestDriven.Net to run your 
tests in
the IDE.  If you disable the built-in NUnit test runner then you will be able 
to use
Gallio to run your NUnit tests within the IDE by way of TestDriven.Net.

Original comment by jeff.br...@gmail.com on 15 Jun 2009 at 6:25

GoogleCodeExporter commented 8 years ago
Implemented in Gallio v3.1.  Most of the basic NUnit features should work 
including
some NUnit addins.

Original comment by jeff.br...@gmail.com on 11 Aug 2009 at 10:16

GoogleCodeExporter commented 8 years ago
Issue 488 has been merged into this issue.

Original comment by jeff.br...@gmail.com on 11 Aug 2009 at 10:16