Open GoogleCodeExporter opened 9 years ago
Hi,
just install the Visual Studio Test Agent 2010 package from here:
http://www.microsoft.com/en-us/download/details.aspx?id=1334
Original comment by fmarcel...@gmail.com
on 7 Dec 2012 at 3:29
[deleted comment]
Why installing the Agent is the agent used if you are running the test in
different computer ?
Original comment by argtonra...@gmail.com
on 13 Nov 2013 at 7:57
I installed Visual Studio Test Agent 2010 from the location, I still get the
same error message.
Visual Studio 2013 Ultimate
SONAR 3.7.3
Sonar-runner 2.2.2
OpenCover 4.5.1313
GallioBundle-3.4.14.0
Here is the error I get.
13:12:52.818 INFO - [error] Assembly *****.Tests
13:12:52.818 INFO - Cannot run tests because the MSTest executable was not
found
Original comment by kishornp...@gmail.com
on 29 Dec 2013 at 4:46
[deleted comment]
I could get the test case execution successful with this setup (I did see the
test case execution successful in gallio report), but I do not see the coverage
numbers in SONAR dashboard:
Visual Studio 2013 Ultimate
SONAR 3.7.3
Sonar-runner 2.2.2
OpenCover 4.5.1313
GallioBundle-3.4.14.0
Visual Studio Test Agent 2010
I had to add registry key "InstallDir"
I have following exception in the log file, I think that is preventing from
getting the coverage numbers in SONAR dashboard:
01:43:15.848 INFO - Internal error: An unhandled exception occurred in thread
'DataCollectionAgentObject.InitializeDataCollectorCache'.
01:43:15.848 INFO - The exception occurred while test step 'Employee.Tests'
was running.
01:43:15.848 INFO - System.Threading.ThreadAbortException: Thread was being
aborted.
01:43:15.848 INFO - HResult: -2146233040
01:43:15.848 INFO - at
Microsoft.VisualStudio.TestTools.Diagnostics.RemoteEqtTrace.set_TraceLevel(Trace
Level value)
01:43:15.848 INFO - at
Microsoft.VisualStudio.TestTools.Execution.DataCollectorCache.PerformDiscovery()
01:43:15.848 INFO - at
Microsoft.VisualStudio.TestTools.Execution.DataCollectorCache.ForceCacheUpdate()
01:43:15.848 INFO - at
Microsoft.VisualStudio.TestTools.Execution.DataCollectorCache.GetAllCollectorInf
ormation()
01:43:15.848 INFO - at
Microsoft.VisualStudio.TestTools.Agent.DataCollectionAgentObject.<InitializeData
CollectorCache>b__b(Object state)
01:43:15.848 INFO - at
System.Threading.ThreadHelper.ThreadStart_Context(Object state)
01:43:15.848 INFO - at
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
01:43:15.848 INFO - at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean preserveSyncCtx)
01:43:15.848 INFO - at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)
01:43:15.848 INFO - at System.Threading.ThreadHelper.ThreadStart(Object obj)
Original comment by kishornp...@gmail.com
on 30 Dec 2013 at 9:05
According some Galio's restrictions, it needed changing the machine.config
file, usually its being located at
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\". On that adding the
following change:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.CommandLine"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0"
newVersion="11.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Another step is modify the Window's Registry by adding for InstallDir a new
value. It has to be like this:
InstallDir => C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\
Finally, the last step is garanty compatibility with OpenCover 32bits into
Windows throw the command:
regsvr32 "C:\YourSonarInstalation\opencover\x86\OpenCover.Profiler.dll.
When I had completed all this step, Sonar has been work very fine.
I hope yours also work.
Thanks.
Original comment by rodrigost
on 30 Dec 2013 at 1:45
Can you share the Registry Key path?
Original comment by zacharia...@gmail.com
on 3 Jan 2014 at 12:29
Here we
are...\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0
InstallDir
Original comment by rodri...@ciandt.com
on 3 Jan 2014 at 12:41
I followed all the steps as per your instructions.
InstallDir -> C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE
Updated "machine.config" in two locations :
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.CommandLine"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="10.0.30319.1"
newVersion="12.0.25001.1"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
Registered :
C:\Users\a342228\AppData\Local\Apps\OpenCover\x86\OpenCover.Profiler.dll
I still get the exception I was getting before :
23:40:01.342 INFO - Internal error: An unhandled exception occurred in thread
'DataCollectionAgentObject.InitializeDataCollectorCache'.
23:40:01.342 INFO - The exception occurred while test step 'Employee.Tests'
was running.
23:40:01.342 INFO - System.Threading.ThreadAbortException: Thread was being
aborted.
23:40:01.342 INFO - HResult: -2146233040
23:40:01.342 INFO - at
Microsoft.VisualStudio.TestTools.Diagnostics.RemoteEqtTrace.set_TraceLevel(Trace
Level value)
23:40:01.342 INFO - at
Microsoft.VisualStudio.TestTools.Execution.DataCollectorCache.PerformDiscovery()
23:40:01.342 INFO - at
Microsoft.VisualStudio.TestTools.Execution.DataCollectorCache.ForceCacheUpdate()
23:40:01.342 INFO - at
Microsoft.VisualStudio.TestTools.Execution.DataCollectorCache.GetAllCollectorInf
ormation()
23:40:01.342 INFO - at
Microsoft.VisualStudio.TestTools.Agent.DataCollectionAgentObject.<InitializeData
CollectorCache>b__b(Object state)
23:40:01.342 INFO - at
System.Threading.ThreadHelper.ThreadStart_Context(Object state)
23:40:01.342 INFO - at
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
preserveSyncCtx)
23:40:01.342 INFO - at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state, Boolean preserveSyncCtx)
23:40:01.342 INFO - at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)
23:40:01.342 INFO - at System.Threading.ThreadHelper.ThreadStart(Object obj)
Here is Gallio command:
23:39:22.561 DEBUG - Executing Gallio program...
23:39:22.562 DEBUG - - Gallio executable : C:\Program
Files\Gallio\bin\Gallio.Echo.exe
23:39:22.562 DEBUG - - OpenCover executable:
C:\Users\a342228\AppData\Local\Apps\OpenCover\OpenCover.Console.exe
23:39:22.563 DEBUG - - Coverage tool : OpenCover
23:39:22.563 DEBUG - - Runner : ISOLATED_PROCESS
23:39:22.563 DEBUG - - Report directory : C:\Test\Company\.sonar
23:39:22.563 DEBUG - - Report file : gallio-report
23:39:22.563 DEBUG - - Test assemblies :
23:39:22.563 DEBUG - o
C:\Test\Company\Employee.Tests\bin\Debug\Employee.Tests.dll
23:39:22.563 DEBUG - - Working directory : C:\Test\Company\.sonar
23:39:22.563 DEBUG - - Opencover include : [Company]*
23:39:22.563 DEBUG - - Opencover include : [Employee]*
23:39:22.563 DEBUG - - Coverage report :
C:\Test\Company\.sonar\coverage-report.xml
23:39:22.563 INFO - Executing command:
C:\Users\a342228\AppData\Local\Apps\OpenCover\OpenCover.Console.exe
-register:user -target:C:\Program Files\Gallio\bin\Gallio.Echo.exe
-targetdir:C:\Test\Company\.sonar "-targetargs:\"/r:IsolatedProcess\"
\"/report-directory:C:\Test\Company\.sonar\"
\"/report-name-format:gallio-report\" \"/report-type:Xml\"
\"C:\Test\Company\Employee.Tests\bin\Debug\Employee.Tests.dll\""
"-filter:+[Company]* +[Employee]* " -mergebyhash
-output:C:\Test\Company\.sonar\coverage-report.xml
23:39:23.075 INFO - Executing: C:\Program Files\Gallio\bin\Gallio.Echo.exe
Original comment by kishornp...@gmail.com
on 3 Jan 2014 at 5:49
Finally it worked using the solution approach. Thanks "rodrigost" :)
Original comment by kishornp...@gmail.com
on 12 Feb 2014 at 4:58
Hi there
So I occured the same problem in first post. I followed all steps, but still
have
the same error log
08:37:15.070 INFO - Running the tests.
08:37:26.742 INFO - [error] Assembly *********
08:37:26.742 INFO - Cannot run tests because the MSTest executable was not foun
d
08:37:26.742 INFO -
08:37:27.039 INFO - Generating reports.
08:37:28.851 INFO - Disposing the test runner.
08:37:28.851 INFO - Stop time: 8:37 AM (Total execution time: 15.764 seconds)
08:37:28.851 INFO -
08:37:28.867 INFO - 1 run, 0 passed, 1 failed (1 error), 0 inconclusive, 0 skip
ped
it's only a test project but soon I'll need to do the same thing on a larger
one, so I need to know how it's done right.
Where in the config should I put this lines
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.VisualStudio.QualityTools.CommandLine"
publicKeyToken="b03f5f7f11d50a3a"
culture="neutral" />
<bindingRedirect oldVersion="10.0.0.0"
newVersion="11.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
In the end or mb in a some specific place?
Do I must put the changes in to
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config too?
I've installed Visual Studio Test Agent 2012 package or I need the 2010??
Will be w8 for your help ^^
Original comment by iiiiii...@gmail.com
on 25 Apr 2014 at 4:05
I believe this solution only works with Visual Studio 2010 Test agent only.
Original comment by kishornp...@gmail.com
on 4 May 2014 at 3:52
[deleted comment]
i am also getting same error "MSTest not found during call made from Sonar"
using gallio. Any other solutions ?
Original comment by g9848921...@gmail.com
on 16 Sep 2014 at 5:49
The latest version of Gallio was released back in 2012, and seems that it works
only with VS2010. If you have VS2012 or 2013 isntalled, you'd have to make it
think that VS2010 is installed instead.
One quick way is to patch the Windows Registry by creating one dummy.reg file
for example with following content:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0]
"InstallDir"="C:\\Program Files (x86)\\Microsoft Visual Studio
11.0\\Common7\\IDE\\"
@=""
"MsEnvLocation"="C:\\Program Files (x86)\\Microsoft Visual Studio
11.0\\Common7\\IDE\\msenv.dll"
"ApplicationID"="VisualStudio"
"StartMenuFolder"=""
"ShellFolder"="C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\"
"EnablePreloadCLR"=dword:00000001
"RestoreAppPath"=dword:00000001
"CLR Version"="v4.0.30319"
"SetupCommandLine"="/Setup"
Right-click the file in Windows Explorer to merge it with the registry, and
then any MSTEST calls from Gallio will be redirected to your VS2012/2013
version instead.
Original comment by happypup...@gmail.com
on 21 Oct 2014 at 6:05
Attachments:
If you are using VS2013, you just need to change the string "Microsoft Visual
Studio 11.0" to "Microsoft Visual Studio 12.0" instead.
Original comment by happypup...@gmail.com
on 21 Oct 2014 at 6:22
Here you go --- the whole story to make it work with VS2012 and 2013.
http://scissortools.wordpress.com/2014/10/21/how-to-make-sonar-runner-work-with-
visual-studio-2012-and-2013/
Original comment by happypup...@gmail.com
on 21 Oct 2014 at 9:59
Original issue reported on code.google.com by
rodrigost
on 13 Oct 2012 at 12:03Attachments: