For the sake of testing a visual WPF control library which uses DirectX, I have created a few Unit Tests which create a DirectX scene, screenshot, then compare vs. expected image.
I'm aware that this is a fragile unit testing technique (visual comparison) however it helps us to cover a large number of possible combinations.
The problem I have is the tests run locally just fine, but fail on the build server with error:
SharpDX.SharpDXException : HRESULT: [0x8876086A], Module:
[SharpDX.Direct3D9], ApiCode: [D3DERR_NOTAVAILABLE/NotAvailable], Message: Unknown
at SharpDX.Result.CheckError()
at SharpDX.Direct3D9.D3D9.Create9Ex(Int32 sDKVersion, Direct3DEx arg1)
at SharpDX.Direct3D9.Direct3DEx..ctor()
However, if I log in to the build server and run the tests, they pass! (See below)
The build server is Windows Server 2012 R2 and has DirectX10 Warp (software) drivers.
I suspect that related to this issue here that the user profile of the team city build agent does not allow getting a DirectX device. I have changed the Teamcity service, and TeamCity build agents to log on as user but still no luck.
Any ideas?