Empty Results File Again :(

Empty Results File Again :(

I am unable to get the results in the results file.   Here is my command line.

NCover.Console.exe //a SolutionBuilder nunit-console.exe /nologo /xml=C:\work\SolutionBuilder\TestData\log\SolutionBuilder-nunit-results.xml C:\work\SolutionBuilder\TestData\SolutionBuilder\obj\debug\SolutionBuilder.dll

The tests are being run, but nothing is being written to the .xml file.

Any thoughts?


Re: Tests fail when run through NCover but not through nunit-con

Just a guess..

Are you sure that you are not using nunit-gui and nunit-console at the same time because of which the tests not running properly?


Re: Tests fail when run through NCover but not through nunit-con

Thanks for your reply, but no. I am using NUnit-Console in both.



Re: Tests fail when run through NCover but not through nunit-con

Perhaps it is some sort of AppDomain/path related issue. Do you have any app.config or other external configuration files? I see you are not specifying a working directory in your MSBuild task - any difference if you set this? Have you tried using /noshadow with nunit for instance?

You could also try NCover 1.5.7, along with the latest build of the NCover NAnt tasks from my site (1.3.6.11). Also try running from the command line both your unit tests and NCover with exactly the same command line arguments from the same directory (just missing the ncover.console and any // arguments).

You could try running NCover using the NCoverExplorer gui - does that also fail? From that you can generate command lines, msbuild tasks etc - any difference in what it suggests?

Perhaps it is possible that there genuinely is an issue with the code being tested with the way the connection is disposed etc and that nunit 2.2.9 is actually "hiding" the error when run standalone. Unlikely I know but straws and all that. You could try NUnit 2.4 for instance to see if you still get the same problem.


Re: Tests fail when run through NCover but not through nunit-con

Cheers KiwiDude,

I fixed this by including the Assemblies property to the test dll.

However the coverage summary files are no longer created correctly.

Here are my tasks

 <Target Name ="NCover" >
    <Message Text ="Running NUnit and NCover"></Message>
    <NCover ToolPath ="$(CCNetServerDirectory)"
            CommandLineExe ="C:\Program Files\NUnit-Net-2.0 2.2.9\bin\nunit-console.exe"
          CommandLineArgs="/xml:$(LogDirectory)\NUnitTestReport.xml $(TestDll)"
            CoverageFile ="$(LogDirectory)\$(CoverageFile)"
            Assemblies="$(TestDll)"
            WorkingDirectory="C:\Development\Projects\DotNet\Trunk\Swamp\Build"
            LogFile="$(LogDirectory)\NCoverLog.log">

    </NCover>
  </Target>

  <Target Name="NCoverExplorer" >
    <Message Text ="Doing NCover Explorer"></Message>
       <NCoverExplorer ProjectName="IntegrationTest"
    ToolPath="$(CCNetServerDirectory)"
    ReportType="4"
    OutputDir="Logs"
    XmlReportName="$(CoverageFile)"
    HtmlReportName="CoverageSummary.html"
    MergeFileName="CoverageMerge.xml"
    ShowExcluded="True"
    SatisfactoryCoverage="75"
    FailMinimum="False"
    CoverageFiles="$(LogDirectory)\$(CoverageFile)"
    Exclusions="Assembly=.Test;Namespace=.Test*"
    />
  </Target>


Do my tasks need to be different if I specifiy the assemblies?

Cheers

Ian


Re: Tests fail when run through NCover but not through nunit-con

Hi again,

I missunderstood what the Assemblies was for. I thought it was the test dll, not the dlls to be profiled.

I would like to profile all the dlls created in the solution I build.

  <Target Name ="Build" >
    <MSBuild
      Projects="$(SolutionDir)\$(SolutionName).sln" >
    </MSBuild>
  </Target>

Is there an easy way to achieve that?

Cheers

Ian


Re: Tests fail when run through NCover but not through nunit-con

Hi Ian,

What version of the NCoverExplorer.MSBuild.dll tasks assembly are you using - the latest off my site?

You shouldnt need to specify an <Assemblies> node or though I do vaguely remember a bug quite a while ago to do with this and certain NCover versions.

Without the node, what should happen is that NCover will profile every assembly loaded into memory for which it can find a .pdb file for it, which is "normally" the behaviour you are after.

Can you please try this with NCover 1.5.7 and the latest MSBuild tasks dll from my download page? If you still experience a problem I will take a look tonight.


Re: Tests fail when run through NCover but not through nunit-con

Hi there,
I have checked the version I have and they are the current versiosn.

My NCoverExplorer.MSBuildTasks.dll is version 1.3.6.11
Mmy NCover is 1.5.7

I have found that when I don't include the Assemblies property tests fail, when I ( incorrectly ) specfify the test assembly in the Assemblie property the tests pass.

Cheers

Ian


Re: Tests fail when run through NCover but not through nunit-con

Thanks Ian, I will take a look later. You started off with NCover 1.5.4 with your first post so wanted to be sure.

Incidentally, have you tried running NCover from the command line to see what happens? I'm curious whether this is a problem in the NCover task that is creating a .settings file that NCover doesnt like, or if its further inside NCover itself. Running NCover from the command line with or without the //a argument would be interesting.

Also if you run your MSBuild in verbose mode can you post the section around the running of the NCover task. It should display the command line as well as the contents of the settings file it passes to NCover. You could copy/paste from this if needed to play with the command line above.


Re: Tests fail when run through NCover but not through nunit-con

Hi Grant,

Thanks for replying so quickly.

I have done both without specifiying assemblies.

Here is daig results from NCover task
##
Microsoft (R) Build Engine Version 2.0.50727.42
[Microsoft .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

Build started 13/04/2007 17:48:17.
__________________________________________________
Project "C:\Development\Projects\DotNet\Trunk\Gateway\Build\build.proj" (NCover target(s)):

Initial Properties:
ALLUSERSPROFILE                = C:\Documents and Settings\All Users
APPDATA                        = C:\Documents and Settings\ian.wood\Application Data
APR_ICONV_PATH                 = C:\Program Files\Subversion\iconv
CCNetServerDirectory           = C:\Development\Projects\CI\Trunk\CruiseControl.NET\server
CLIENTNAME                     = Console
CommonProgramFiles             = C:\Program Files\Common Files
COMPUTERNAME                   = CZC6385VHJ
ComSpec                        = C:\WINDOWS\system32\cmd.exe
CoverageFile                   = CoverageSummary.xml
DevEnvDir                      = C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
DirectoriesToRemoveAndAdd      = ..\Code;Logs
FP_NO_HOST_CHECK               = NO
FrameworkDir                   = C:\WINDOWS\Microsoft.NET\Framework
FrameworkSDKDir                = C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0
FrameworkVersion               = v2.0.50727
HOMEDRIVE                      = C:
HOMEPATH                       = \Documents and Settings\ian.wood
INCLUDE                        = C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE;C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\include;
LIB                            = C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB;C:\Program Files\Microsoft Visual Studio 8\VC\LIB;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib;
LIBPATH                        = C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB
LogDirectory                   = Logs
LOGONSERVER                    = \58YMB1J
MSBuildBinPath                 = C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
MSBuildCommunityTasksLib       = C:\Program Files\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll
MSBuildCommunityTasksPath      = C:\Program Files\MSBuild\MSBuildCommunityTasks
MSBuildExtensionsPath          = C:\Program Files\MSBuild
MSBuildProjectDefaultTargets   = All
MSBuildProjectDirectory        = C:\Development\Projects\DotNet\Trunk\Gateway\Build
MSBuildProjectExtension        = .proj
MSBuildProjectFile             = build.proj
MSBuildProjectFullPath         = C:\Development\Projects\DotNet\Trunk\Gateway\Build\build.proj
MSBuildProjectName             = build
NUMBER_OF_PROCESSORS           = 2
NUnitEXE                       = "C:\Program Files\NUnit-Net-2.0 2.2.9\bin\nunit-console.exe"
OS                             = Windows_NT
Path                           = C:\Program Files\Microsoft Visual Studio 8\Common7\IDE;C:\Program Files\Microsoft Visual Studio 8\VC\BIN;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools;C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin;C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin;C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin;C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727;C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Subversion\bin\;C:\Program Files\NUnit-Net-2.0 2.2.9\bin
PATHEXT                        = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.VBS
PROCESSOR_ARCHITECTURE         = x86
PROCESSOR_IDENTIFIER           = x86 Family 15 Model 4 Stepping 7, GenuineIntel
PROCESSOR_LEVEL                = 15
PROCESSOR_REVISION             = 0407
ProgramFiles                   = C:\Program Files
PROMPT                         = $P$G
SESSIONNAME                    = Console
SolutionDir                    = ..\Code\Gateway
SolutionName                   = Gateway
SVN_ASP_DOT_NET_HACK           =
SVNRepositoryPath              = svn://duffman/DotNet/Trunk/Gateway/Code
SystemDrive                    = C:
SystemRoot                     = C:\WINDOWS
TEMP                           = C:\DOCUME~1\IAN~1.WOO\LOCALS~1\Temp
TestDirectory                  = ..\Code\GatewayTest\
TestDll                        = ..\Code\GatewayTest\bin\Debug\GatewayTest.dll
TMP                            = C:\DOCUME~1\IAN~1.WOO\LOCALS~1\Temp
ULTRAMON_LANGDIR               = C:\Program Files\UltraMon\Resources\en
USERDNSDOMAIN                  = SUCDEN.CO.UK
USERDOMAIN                     = SUCDEN
USERNAME                       = Ian.Wood
USERPROFILE                    = C:\Documents and Settings\ian.wood
VCINSTALLDIR                   = C:\Program Files\Microsoft Visual Studio 8\VC
VS80COMNTOOLS                  = C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\
VSINSTALLDIR                   = C:\Program Files\Microsoft Visual Studio 8
windir                         = C:\WINDOWS

Initial Items:
FxCopRuleAssemblies
    DesignRules.dll
    GlobalizationRules.dll
    InteroperabilityRules.dll
    MobilityRules.dll
    PerformanceRules.dll
    PortabilityRules.dll
    SecurityRules.dll
    UsageRules.dll

Target "NCover" in file "C:\Development\Projects\DotNet\Trunk\Gateway\Build\build.proj":
  Using "Message" task from assembly "Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
  Task "Message"
    Running NUnit and NCover
  Done executing task "Message".
  Using "NCover" task from assembly "C:\Development\Projects\CI\Trunk\CruiseControl.NET\server\NCoverExplorer.MSBuildTasks.dll".
  Task "NCover"
    Creating settings file: C:\Documents and Settings\ian.wood\Local Settings\Temp\tmp2F9.tmp.ncoversettings
    Arguments: //r "C:\Documents and Settings\ian.wood\Local Settings\Temp\tmp2F9.tmp.ncoversettings"
    Contents of config file:\r\n<?xml version="1.0" encoding="utf-8"?>
    <ProfilerSettings>
      <CommandLineExe>C:\Program Files\NUnit 2.4\bin\nunit-console.exe</CommandLineExe>
      <CommandLineArgs> /xml:Logs\NUnitTestReport.xml ..\Code\GatewayTest\bin\Debug\GatewayTest.dll</CommandLineArgs>
      <WorkingDirectory />
      <CoverageXml>Logs\CoverageSummary.xml</CoverageXml>
      <LogFile>Logs\NCoverLog.log</LogFile>
      <VerboseLog>false</VerboseLog>
      <NoLog>false</NoLog>
      <ProfileIIS>false</ProfileIIS>
      <DumpOnErrorNormal>false</DumpOnErrorNormal>
      <DumpOnErrorFull>false</DumpOnErrorFull>
    </ProfilerSettings>
    C:\Development\Projects\CI\Trunk\CruiseControl.NET\server\NCover.Console.exe //r "C:\Documents and Settings\ian.wood\Local Settings\Temp\tmp2F9.tmp.ncoversettings" 
    The "NCover" task is using "NCover.Console.exe" from "C:\Development\Projects\CI\Trunk\CruiseControl.NET\server\NCover.Console.exe".
    NCover.Console v1.5.4 - Code Coverage Analysis for .NET - http://ncover.org
    Copyright (c) 2004-2005 Peter Waldschmidt
   
   
    Command: C:\Program Files\NUnit 2.4\bin\nunit-console.exe
    Command Args:  /xml:Logs\NUnitTestReport.xml ..\Code\GatewayTest\bin\Debug\GatewayTest.dll
    Working Directory:
    Assemblies:
    Coverage Xml: Logs\CoverageSummary.xml
    Coverage Log: Logs\NCoverLog.log
   
    Waiting for profiled application to connect...
   
Program Output
    NUnit version 2.4.0
    Copyright (C) 2002-2007 Charlie Poole.
    Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
    Copyright (C) 2000-2002 Philip Craig.
    All Rights Reserved.
   
    Runtime Environment -
       OS Version: Microsoft Windows NT 5.1.2600 Service Pack 2
      CLR Version: 2.0.50727.42 ( Net 2.0.50727.42 )
   
    ..................N.....................N....N...N..................................F.F............F
    Tests run: 89, Failures: 3, Not run: 4, Time: 76.000 seconds
   
    Failures:
    1) GatewayTestFItoFII.TestTradePersist.TestPersistFuturesITrades_Insert : System.Data.SqlClient.SqlException : Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    The statement has been terminated.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at GatewayTestFItoFII.TestTradePersist.TestPersistFuturesITrades_Insert() in c:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\TestTradePersist.cs:line 96
   
    2) GatewayTestFItoFII.TestTradePersist.TestPersistFuturesITrades_Update : System.Data.SqlClient.SqlException : Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
       at GatewayTestFItoFII.TestTradePersist.InsertFuturesIITrades(CTrade trade) in c:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\TestTradePersist.cs:line 256
       at GatewayTestFItoFII.TestTradePersist.TestPersistFuturesITrades_Update() in c:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\TestTradePersist.cs:line 144
   
    3) GatewayTestFItoFII.TestVoucherPersist.TestPersistFuturesIVouchers_Update : System.InvalidOperationException : The connection was not closed. The connection's current state is open.
       at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at FuturesII.SQLTables.CSQLTable.RecordExists(Object[] ids) in C:\Development\Projects\DotNet\Trunk\FuturesII\Code\BusinessRules\SQLTables\CSQLTable.cs:line 343
       at FuturesII.SQLTables.CPersistenceFacade.Exists(Type objType, Object[] searchIds) in C:\Development\Projects\DotNet\Trunk\FuturesII\Code\BusinessRules\SQLTables\CPersistenceFacade.cs:line 857
       at FuturesII.BusinessObjects.CVoucherValidator.CheckVoucherType() in C:\Development\Projects\DotNet\Trunk\FuturesII\Code\BusinessRules\BusinessObjects\CVoucherValidator.cs:line 185
       at FuturesII.BusinessObjects.CVoucherValidator.Validate(CBusinessObject obj) in C:\Development\Projects\DotNet\Trunk\FuturesII\Code\BusinessRules\BusinessObjects\CVoucherValidator.cs:line 43
       at FuturesII.BusinessObjects.CBusinessObject.Validate() in C:\Development\Projects\DotNet\Trunk\FuturesII\Code\BusinessRules\BusinessObjects\CBusinessObject.cs:line 56
       at GatewayTestFItoFII.TestObjectCreator.CreateFuturesIVouchers(Char action) in c:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\TestObjectCreator.cs:line 267
       at GatewayTestFItoFII.TestVoucherPersist.TestPersistFuturesIVouchers_Update() in c:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\TestVoucherPersist.cs:line 84
   
    Tests not run:
    1) GatewayTestFItoFII.TestCheckObjectDetails2.TestCheckObjectDetailsII : Colonel FII.Gateway needs to be cleared
    2) GatewayTestFItoFII.TestFuturesIGetObjectDetails.TestRetrieveFuturesIPrice : Invalid Data - revisit
    3) GatewayTestFItoFII.TestFuturesIGetObjectDetails.TestRetrieveFuturesITrades : Invalid Data - revisit
    4) GatewayTestFItoFII.TestFuturesIGetObjectDetails.TestRetrieveFuturesIVouchers : Invalid Data - revisit
   
   
End Program Output
    C:\Development\Projects\DotNet\Trunk\Gateway\Build\build.proj(55,5): error MSB6006: "NCover.Console.exe" exited with code 1.
    Deleting settings file: C:\Documents and Settings\ian.wood\Local Settings\Temp\tmp2F9.tmp.ncoversettings
  Done executing task "NCover" -- FAILED.
Done building target "NCover" in project "build.proj" -- FAILED.

Done building project "build.proj" -- FAILED.

Project Performance Summary:
    87078 ms  C:\Development\Projects\DotNet\Trunk\Gateway\Build\build.proj   1 calls

Target Performance Summary:
    87062 ms  NCover                                     1 calls

Task Performance Summary:
        0 ms  Message                                    1 calls
    87046 ms  NCover                                     1 calls

Build FAILED.
C:\Development\Projects\DotNet\Trunk\Gateway\Build\build.proj(55,5): error MSB6006: "NCover.Console.exe" exited with code 1.
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:01:27.07

##

Here is the response from doing the same in the console
##
C:\Development\Projects\CI\Trunk\CruiseControl.NET\server>ncover.console.exe "C:
\Program Files\NUnit 2.4\bin\nunit-console.exe" /xml:C:\Development\Projects\Dot
Net\Trunk\Gateway\Build\Logs\NUnitTestReport.xml C:\Development\Projects\DotNet\
Trunk\Gateway\Code\GatewayTest\bin\Debug\GatewayTest.dll
NCover.Console v1.5.4 - Code Coverage Analysis for .NET - http://ncover.org
Copyright (c) 2004-2005 Peter Waldschmidt


Command: C:\Program Files\NUnit 2.4\bin\nunit-console.exe
Command Args: /xml:C:\Development\Projects\DotNet\Trunk\Gateway\Build\Logs\NUnit
TestReport.xml C:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\bin
\Debug\GatewayTest.dll
Working Directory:
Assemblies:
Coverage Xml: Coverage.Xml
Coverage Log: Coverage.Log

Waiting for profiled application to connect...
Program Output *
NUnit version 2.4.0
Copyright (C) 2002-2007 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment -
   OS Version: Microsoft Windows NT 5.1.2600 Service Pack 2
  CLR Version: 2.0.50727.42 ( Net 2.0.50727.42 )

..................N.....................N....N...N..............................
....F.F............
Tests run: 89, Failures: 2, Not run: 4, Time: 77.845 seconds

Failures:
1) GatewayTestFItoFII.TestTradePersist.TestPersistFuturesITrades_Insert : System
.Data.SqlClient.SqlException : Timeout expired.  The timeout period elapsed prio
r to completion of the operation or the server is not responding.
The statement has been terminated.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception
, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cm
dHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, Tds
ParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName,
Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult res
ult, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at GatewayTestFItoFII.TestTradePersist.TestPersistFuturesITrades_Insert() in
c:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\TestTradePersist.c
s:line 96

2) GatewayTestFItoFII.TestTradePersist.TestPersistFuturesITrades_Update : System
.Data.SqlClient.SqlException : Timeout expired.  The timeout period elapsed prio
r to completion of the operation or the server is not responding.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception
, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cm
dHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, Tds
ParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName,
Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult res
ult, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at GatewayTestFItoFII.TestTradePersist.InsertFuturesIITrades(CTrade trade) in
 c:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\TestTradePersist.
cs:line 256
   at GatewayTestFItoFII.TestTradePersist.TestPersistFuturesITrades_Update() in
c:\Development\Projects\DotNet\Trunk\Gateway\Code\GatewayTest\TestTradePersist.c
s:line 144

Tests not run:
1) GatewayTestFItoFII.TestCheckObjectDetails2.TestCheckObjectDetailsII : Colonel
 FII.Gateway needs to be cleared
2) GatewayTestFItoFII.TestFuturesIGetObjectDetails.TestRetrieveFuturesIPrice : I
nvalid Data - revisit
3) GatewayTestFItoFII.TestFuturesIGetObjectDetails.TestRetrieveFuturesITrades :
Invalid Data - revisit
4) GatewayTestFItoFII.TestFuturesIGetObjectDetails.TestRetrieveFuturesIVouchers
: Invalid Data - revisit

Unable to establish communications with the profiler. (0x2)

C:\Development\Projects\CI\Trunk\CruiseControl.NET\server>
##

When ran from the Task a test fails due to a connectin being open.

It seems that a work around is if I specify the assemblies I want to profile. Is there an easy way to get the produced assemblies from a solution build?

Cheers

Ian





Re: Tests fail when run through NCover but not through nunit-con

Hi Ian,

I have no idea why at this point specifying the assemblies would make a difference, but in answer to your other question, take a look at the last example for my MSBuild NCover task on this page:

http://www.kiwidude.com/dotnet/doc/NCoverExplorer.MSBuildTasks/index.html

   <ItemGroup>
       <Assembly Include="$(MSBuildProjectDirectory)\MyApp.MyCode.dll" />
   </ItemGroup>

   <NCover  ToolPath="Tool\NCover\"
            CommandLineExe="$(nunit.path)\nunit-console.exe" 
            CommandLineArgs="myapp.tests.dll"
            CoverageFile="myapp.coverage.xml"
            LogLevel="Verbose"
            LogFile="myapp.coverage.log"
            WorkingDirectory="$(MSBuildProjectDirectory)"
            ExcludeAttributes="CoverageExcludeAttribute"
            Assemblies="@(Assembly)" />

You can use any pattern match you like in the <Assembly> node above, like MyApp*.dll etc.


Re: Tests fail when run through NCover but not through nunit-con

Also, your console output above still indicates you are using NCover 1.5.4, not NCover 1.5.7?