Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Unit testing 为什么unitest for sharpdx在Jenkins上失败,但在localy上失败,我如何修复它?_Unit Testing_Jenkins_Sharpdx - Fatal编程技术网

Unit testing 为什么unitest for sharpdx在Jenkins上失败,但在localy上失败,我如何修复它?

Unit testing 为什么unitest for sharpdx在Jenkins上失败,但在localy上失败,我如何修复它?,unit-testing,jenkins,sharpdx,Unit Testing,Jenkins,Sharpdx,我有两个单元测试,它们在本地运行良好,但在我的Jenkins服务器上失败。所有单元测试都失败,原因类似:SharpDX无法获取资源 SetUp : SharpDX.SharpDXException : HRESULT: [0x887A0022], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: A resource is not available at the time of the call. However, it may

我有两个单元测试,它们在本地运行良好,但在我的Jenkins服务器上失败。所有单元测试都失败,原因类似:SharpDX无法获取资源

 SetUp : SharpDX.SharpDXException : HRESULT: [0x887A0022], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: A resource is not available at the time of the call. However, it may be available at a later date.
 +++++++++++++++++++
                                                STACK TRACE:
                                                at SharpDX.Result.CheckError()
at SharpDX.Direct2D1.Factory.CreateHwndRenderTarget(RenderTargetProperties& renderTargetProperties, HwndRenderTargetProperties& hwndRenderTargetProperties, WindowRenderTarget hwndRenderTarget)

My Jenkins(2.190.1版)在本地系统帐户下运行。错误似乎与此相关(无屏幕会话)。我从@maQ at的答案中尝试了解决方案,并以本地用户身份运行jenkin,但没有成功。

您是否测试过从命令行或IDE运行代码? 如果尚未从命令行本地测试代码,则可以对其进行测试

生成节点和本地计算机相同吗?如果没有,请验证您的生成节点中是否安装了sharpdx

如果已经测试并运行,并且构建节点也配置了sharpdx,那么将环境变量point添加到jenkins slave配置中的sharpdx主目录应该可以工作。祝你一切顺利