Environment
- Visual Studio 2012 Premium 3 Update
- Team Foundation Server 2012 Update 3
- edit: .NET Framework 4
- DefaultTemplate (DefaultTemplate.11.1.xaml)
Problem
I have 2 Unit-Test-Assemblies:
both use the Microsoft Fakes Framework (using Stubs and Shims).
Running unit tests locally works fine (tested on 4 different computers, even on Visual Studio installed on the build server), however, if we create using the build agent, some unit tests do not work except, for example:
Unable to create instance of class UserTests.ClientUserTest. Error: System.TypeLoadException: Could not load type 'WorldDirect.CCM.Shared.Backend.SmartClassic.Fakes.StubClient' from assembly 'WorldDirect.Smart.Backend.Fakes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
or the same for laying:
Test method ExtensionTests.ExtensionTests.UpdateExtensionValidate_NoGrnp_ChecksIpPbxDependencies threw exception: System.TypeLoadExceptio: Could not load type 'WorldDirect.CCM.Shared.Backend.SmartClassic.Fakes.ShimIpPbxRemoteDestination' from assembly 'WorldDirect.Smart.Backend.Fakes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
Interestingly, they fail sporadically; I tried to compile some statistics:
# | Outcome | Comment 19 | 64/64 passed | only 'UserTests'-UnitTests run, 'ExtensionTests' inactive 20 | 37/64 passed | same source code as #19 21 | 64/64 passed | same source code as #19 22 | 64/66 passed | all 'UserTests' run as well as 2 'ExtensionTests', others still inactive; the 2 ExtensionTests failed with ShimIpPbxRemoteDestination-TypeLoadException 23 | 38/65 passed | same source code as #22, notice NOTHING has changed, however 1 unit test was not even run in 'ExtensionTests'; however the second succeeds; all unit tests in 'UserTests' using MS Fakes fail with a StubClient-TypeLoadException 24 | 38/65 passed | same source code as #22 new day - no more luck :-( 1 | 37/64 passed | uncommented the 2 'ExtensionTests', so same code as #19 2 | 37/64 passed | so same code as #1 3 | 64/64 passed | so same code as #1; suddenly they all work again
Please note that in addition to these changes, no one has changed the source code.
All assemblies were made using a verbose log level; Shim Diagnostic = "true",
only explicitly needed gaskets / stubs are included in the .fakes file (otherwhise MSBUILD failed using exit code 1).
All this seems to me completely magical, maybe someone already had the same problems, or someone has a hint.
Thanks in advance
build-process visual-studio-2012 tfs2012 microsoft-fakes
shadowrunner
source share