-
Notifications
You must be signed in to change notification settings - Fork 646
Testify suite tests not running #1968
Comments
Thanks for reporting @MathiasGr! And fixing it too :) I have pushed your fix to master. Can you try out the beta version of this extension and confirm that the fix works? |
Thank you for your responsiveness! I can confirm it works again in the beta. |
This is fixed in the latest update to the Go extension (0.6.91) |
Still having a problem with this, even with 0.6.91, does the fix only work with module-based projects or something like that? (also, AFAICT this broke after updating vscode itself, not the extension) |
@mhr3 did you set the option If you did, one issue might be that your suite is defined in another file, and var _ = suite.TestingSuite(nil) |
@MathiasGr No, didn't change the default of that setting. My test files generally have this in them:
So, it is imported directly |
Well I'm afraid setting this setting |
@mhr3 Does setting |
Sorry, missed that it's now required to set |
@mhr It is not required to have that setting to have this feature to work. Its an unfortunate side effect of a refactoring I had done last week. I have pushed a fix to master to take care of this. Can you try the latest beta version of this extension? |
How do I get the beta? The link you posted points to this issue... |
@mhr3 Sorry about that! The link is updated. |
Thanks, and yep, works fine with the beta, even without |
The fix is now out in the latest update to the Go extension (0.6.92) |
Starting from at least 0.6.90, tests bound to testify suites aren't detected by the vscode-go extension. Thus neither codelens or the "Test function at cursor" work anymore for this kind of test.
I also found a second issue while debugging the extension, which drove me crazy because it made the example suite from the testify github page work and show codelenses. The
testFuncRegex
is missing a^
in front ofExample
, which makes the extension treat(suite *ExampleTestSuite) TestExample()
like a regular test function, because it includesExample
Last, it should be documented somewhere that even with the fix in #1969 , users need to include
"go.gotoSymbol.includeImports": true
in their settings for testify to be properly detected.Steps to Reproduce:
Edit: fix for both issues in #1969
The text was updated successfully, but these errors were encountered: