douba3943 2018-08-31 10:36
浏览 292

无法在GoLand IDE内的测试套件中运行单个测试?

Am using testify's test suite support to write unit tests. This results in my test file having a single TestFooBar(t *testing.T) that kicks of the suite.Run while all my individual tests become a part of my test suite struct with method signatures like - func (suite *myTestSuite) TestMyStuff().

I have observed that GoLand can identify all methods with a signature similar to TestFooBar(t *testing.T) and put a green play icon next to it. It will allow me to run/debug these methods individually. However, all the test methods that are a part of the test suite as described above, won't be identified and cannot be ran or debugged individually in the IDE.

Any way to tell GoLand that myTestSuite structure has many tests that will allow me to execute them individually inside the IDE?

(Similar question here but that is just talking about command line, while my question is specifically for the IDE.)

  • 写回答

2条回答 默认 最新

  • douyuan3842 2018-09-01 12:35
    关注

    At the moment, the IDE does not support recognizing tests from testify. There's an issue for that, https://youtrack.jetbrains.com/issue/GO-3066, and we hope we'll get it done soon.

    As a workaround, you can edit manually a Run Configuration via Run | Edit Configurations... | + | Go Test and pass the arguments to the Go Tool in order to pick up the test that you need to debug.

    评论

报告相同问题?

悬赏问题

  • ¥15 对于这个问题的代码运行
  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败