英文:
'Cannot create temporary ouput file' while running tests
问题
这是我的配置:
当我尝试运行测试时,我收到错误消息“无法创建临时输出文件”。我看到这里没有设置“输出目录”。
我该如何在Gogland中运行测试?
英文:
Here is my configuration:
When I am trying to run the tests I get the error Cannot create temporary ouput file
. As I see the is no setting for Output directory
here.
How can I run the tests in Gogland ?
答案1
得分: 0
你确定你的工作目录是正确的吗?
D:
看起来像是 Windows
/development/gopath/
... 是 Linux
英文:
Are you sure your working directory is correct?
D:
looks like Windows
/development/gopath/
... is Linux
答案2
得分: 0
可能有多个问题导致这个情况,因此可能有多个解决方案可以解决相应的问题。但是这里有一个可以尝试的方法。
- 进入测试的运行/调试配置(即测试下拉菜单中的“编辑配置”行)。
- 在测试列表的底部/左侧,应该有一些可点击的文本,上面写着“编辑配置模板...”。点击它,会打开一个名为“运行/调试配置模板”的窗口,允许编辑各种测试库的通用测试模板配置。
- 在GoTest库的配置模板中,勾选“以sudo方式运行”,这样GoLand就有权限在测试期间创建所需的输出文件。
- 重新启动(退出并重新打开)GoLand程序。
- 尝试从头开始运行你的测试。(根据“运行/调试配置模板”中的提示,更改只会影响新的测试运行及其配置,不会影响现有的测试运行及其配置,所以不要只是尝试重新运行旧的配置)。
这个方法解决了我的测试问题,希望也能解决你的问题。
希望能帮到你。
英文:
There are likely multiple issues that can cause this, and thus multiple solutions that could solve the corresponding issue. But here is one more thing to try.
- Go to your test Run/Debug Configurations (ie: the "Edit Configurations" line in the tests dropdown).
- At the bottom/left of the list of tests, there should be some clickable text that says "Edit Configuration Templates...". Click that & it will open a window called "Run/Debug Configuration Templates" that allows editing of your general test template configurations for various testing libraries.
- In the GoTest library's configuration template, check the "Run with sudo", which should enable GoLand to have permissions to create the output file it needs during testing.
- Restart (quit & re-open) the GoLand program.
- Attempt to run your test from scratch. (Per the notice in the Run/Debug Configuration Templates, changes will only affect new test runs & their configurations, it does not affect existing test runs & their configurations, so don't just try to re-run an old configuration).
That fixed my testing woes, hope it fixes yours.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论