I have a project that can be compiled to target either .NET 2.0 or .NET 4.0. Recently, I integrated PartCover 4.0.10801 in my build scripts and it's working absolutely fine on Windows 7 x64.
If the same script is run on my Build Agent, a virtual machine running Windows XP SP3 x64, only the .NET 2.0 build records any coverage results. This happens consistently across three projects - the .NET 2.0 builds record coverage, the .NET 4.0 don't.
There are no warnings of any kind being printed to the console, though the .NET 2.0 builds, despite generating coverage results, do print tons of warnings to the console, eg.
[exec] [11537] [01660] GetClassIDInfo failed for ..ctor
[exec] [11547] [01660] GetClassIDInfo failed for ..ctor
[exec] [11547] [01660] GetClassIDInfo failed for .get_MaximumBatchSize
[exec] [11547] [01660] GetClassIDInfo failed for .Begin
[exec] [11547] [01660] GetClassIDInfo failed for .reset
[exec] [11557] [01660] GetClassIDInfo failed for .End
[exec] [11557] [01660] GetClassIDInfo failed for .End
[exec] [11557] [01660] GetClassIDInfo failed for .flush
[exec] [11567] [01660] GetClassIDInfo failed for .Dispose
[exec] [11567] [01660] GetClassIDInfo failed for .Dispose
[exec] [11677] [01660] GetClassIDInfo failed for .Draw
[exec] [11677] [01660] GetClassIDInfo failed for .Queue
Hi
Unfortunately I don't have a 64 bit OS of any type to test on.
What is the command line you are actually running? Are the methods above part of your code that you are trying to cover? Are the PDB files on the machine with your DLLs?
Sorry for all the questions.
You don't need a 64 bit OS, as I said, it's working fine there. The code actually is 32 bit code I run with nunit-console-x86.exe.
It simply fails for all .NET 4.0 projects on Windows XP SP3.
- All methods I'm gathering coverage on are part of my code, compiled on the same machine immediately before calling PartCover.
- The PDB files are in the same directory as the DLLs, guaranteed to be up-to-date and in the same directory they were compiled in
The command line is this:
--target "References/nunit/net-2.0/nunit-console-x86.exe" --target-args "/nologo /nodots /noshadow \"E:\\framework\\Nuclex.Testing.Xna\\bin\\xna-3.1-x86\\Release\\Nuclex.Testing.Xna.dll\" \"E:\\framework\\Nuclex.Geometry\\bin\\xna-3.1-x86\\Release\\Nuclex.Geometry.dll\" \"E:\\framework\\Nuclex.Fonts.Content.TrueTypeImporter\\bin\\xna-3.1-x86\\Release\\Nuclex.Fonts.Content.TrueTypeImporter.dll\" \"E:\\framework\\Nuclex.Fonts\\bin\\xna-3.1-x86\\Release\\Nuclex.Fonts.dll\" \"E:\\framework\\Nuclex.Graphics\\bin\\xna-3.1-x86\\Release\\Nuclex.Graphics.dll\" \"E:\\framework\\Nuclex.Game.ContentCompressor\\bin\\net-2.0\\Release\\Nuclex.Game.ContentCompressor.exe\" \"E:\\framework\\Nuclex.Game\\bin\\xna-3.1-x86\\Release\\Nuclex.Game.dll\" \"E:\\framework\\Nuclex.Graphics.SpecialEffects\\bin\\xna-3.1-x86\\Release\\Nuclex.Graphics.SpecialEffects.dll\" \"E:\\framework\\Nuclex.UserInterface\\bin\\xna-3.1-x86\\Release\\Nuclex.UserInterface.dll\"" --output "artifacts\coverage.partcover.xml" --include [Nuclex.Testing.Xna]* --include [Nuclex.Geometry]* --include [Nuclex.Fonts.Content.TrueTypeImporter]* --include [Nuclex.Fonts]* --include [Nuclex.Graphics]* --include [Nuclex.Game.ContentCompressor]* --include [Nuclex.Game]* --include [Nuclex.Graphics.SpecialEffects]* --include [Nuclex.UserInterface]*
Maybe the initial description was a bit confusing. The results I'm seeing are:
Windows XP, .NET 2.0: Works (with tons of warnings)
Windows XP, .NET 4.0: Fails
Windows 7, .NET 2.0: Works
Windows 7, .NET 4.0: Works
Tested with 3 different solutions, one also containing a C++/CLI project.
What version of nunit are you running? have you tried the /framework switch or modified the application.config to make nunit run under .NET 4 rather than it's default of .NET 2?
The quoted command line is passed to a a pure .NET 4.0 build of NUnit 2.5.5. It executes all unit tests successfully.
I also have an environment where I run those tests through the TeamCity NUnit test runner using these parameters: "v4.0 x86 NUnit-2.5.5 <assemblies>".
Both cases run all the tests but generate no coverage data. If I may compile another table: ;-)
Windows XP, .NET 2.0, NUnit 2.5.5 (official .NET 2.0 build) = works, warnings
Windows XP, :NET 2.0, TeamCity NUnit runner (x86 v2.0) = works, warnings
Windows XP, .NET 4.0, NUnit 2.5.5 (custom .NET 4.0 build) = empty coverage
Windows XP, :NET 4.0, TeamCity NUnit runner (x86 v4.0) = empty coverage
Windows 7, .NET 2.0, NUnit 2.5.5 (official .NET 2.0 build) = works
Windows 7, .NET 4.0, NUnit 2.5.5 (custom .NET 4.0 build) = works
----------------
I don't think it helps, but you can view the build logs on my CI server:
.NET 2.0 build (working, tons of warnings):
https://devel.nuclex.org/teamcity/viewLog.html?guest=true&tab=buildLog&buildTypeId=bt7&buildId=lastSuccessful&all=true
.NET 4.0 build (no coverage data):
https://devel.nuclex.org/teamcity/viewLog.html?guest=true&tab=buildLog&buildTypeId=bt5&buildId=lastSuccessful&all=true
In both cases, search for "[partcover]" to get to the interesting part. The PartCover output comes after the unit tests due to some weirdness in how TeamCity captures console output. Just use the time stamps on the left to see what happened when.
By the way, thank you very much for all your engagement. It's really great to be able to get test coverage on a budget!
It's working very well for the .NET 2.0 build. I have an XSLT to convert PartCover to NCover (as long as it's necessary, I've seen that you are planning to integrate the NCover format output from another PartCover fork) and then I use NCoverExploer 1.4.0.7 to generate this report:
https://devel.nuclex.org/teamcity/viewLog.html?guest=true&buildId=lastSuccessful&tab=Code_Coverage&buildTypeId=bt7
The only reason I haven't upgraded my build agent to Windows 7 yet is that I had a spare Windows XP license and that Windows XP is a bit smaller (the build agent is a virtual machine). Otherwise I don't think Windows XP is that important anymore...
Not tried the latest partcover on teamcity - glad to see it (nearly) works.
The unusual output is probably due to piping the partcover output into a file and then displaying that after the test run.
If possible could you run the partcover on the command line with a single test assembly that you do not get cover for and post the full output.
Why do you have a custom nunit build? I use version 2.5.7 the /framework=4.0.30319 switch to run the code to under .NET4.0.
It is odd that it works under windows 7 but not XP. Hard to diagnose until I can repeat it.
The custom NUnit build is just some sillyness on my behalf. Because .NET 4.0 can be installed without having any other .NET version on a system, I wanted a pure .NET 4.0 environment.
To be on the safe side, I repeated all the tests with the official NUnit 2.5.5 distribution using the /framework parameter, but the results were the same: empty overage on Windows XP, all fine on Windows 7.
I have written a small test consisting of a single assembly with a single class and its unit test. I'll attach the code to this issue, also including my NUnit and PartCover binaries so that it compiles out of the box.
Here's the output:
===============================================================================
PartCover on .NET 2.0 assembly
===============================================================================
open driver pipe
modify target environment variables
create target process
wait for driver connection
[00010] [03156] Options dump:
[00020] [03156] VerboseLevel: 0
[00020] [03156] Log file: C:\Documents and Sett
[00020] [03156] Log pipe: yes
[00020] [03156] Count Coverage - ON
[00020] [03156] Count Call Tree - OFF
[00020] [03156] Exclude [mscorlib]*
[00030] [03156] Exclude [System*]*
[00030] [03156] Include [SimpleTest]*
ProcessModel: Default DomainUsage: Single
Execution Runtime: net-2.0
Tests run: 12, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0.050072 seconds
Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
[01011] [02236] CorProfiler is turned off
Target PageFaultCount: 6813
Target PagefileUsage: 16961536
Target PeakPagefileUsage: 18841600
Target PeakWorkingSetSize: 21893120
Target QuotaNonPagedPoolUsage: 7500
Target QuotaPagedPoolUsage: 156188
Target QuotaPeakNonPagedPoolUsage: 38884
Target QuotaPeakPagedPoolUsage: 243324
Target WorkingSetSize: 20979712
Total 0 bytes
===============================================================================
PartCover on .NET 4.0 assembly
===============================================================================
open driver pipe
modify target environment variables
create target process
wait for driver connection
[00010] [03740] Options dump:
[00010] [03740] VerboseLevel: 0
[00010] [03740] Log file: C:\Documents and Sett
[00020] [03740] Log pipe: yes
[00020] [03740] Count Coverage - ON
[00020] [03740] Count Call Tree - OFF
[00020] [03740] Exclude [mscorlib]*
[00030] [03740] Exclude [System*]*
[00030] [03740] Include [SimpleTest]*
ProcessModel: Default DomainUsage: Single
Execution Runtime: v4.0.30319
Tests run: 12, Errors: 0, Failures: 0, Inconclusive: 0, Time: 0.1201728 seconds
Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
[01943] [03664] CorProfiler is turned off
Target PageFaultCount: 5532
Target PagefileUsage: 18255872
Target PeakPagefileUsage: 24223744
Target PeakWorkingSetSize: 21860352
Target QuotaNonPagedPoolUsage: 37516
Target QuotaPagedPoolUsage: 157788
Target QuotaPeakNonPagedPoolUsage: 39132
Target QuotaPeakPagedPoolUsage: 163076
Target WorkingSetSize: 21856256
Total 0 bytes
Single Assembly Reproduction Case, NUnit & PartCover binaries not included
SourceForge won't let me attach files larger than 256 KiB, so I attached just the test project without NUnit & PartCover.
I've uploaded the complete package with all libraries here:
https://devel.nuclex.org/SimpleTest.7z
Outch, I just now noticed that I wrote "Windows XP SP3 x64" in the original issue description. That's wrong. I'm running a plain Windows XP SP3 (32 bits) system on my virtual machine.