Goland Subtests are not recognized
已完成
I'm using tableTests and expect my goland to identify them and give the possiblity to run single tests then. This is my IDE:

This one is collegue's one:

Same file/repository/branch...
We both using latest version of goland and (should) have same settings.
So, anyone can tell to enable single tests here?
I can start whole suite without any problem.
请先登录再写评论。
Hi,
Can you reproduce it with default IDE settings (File | Manage IDE Settings | Restore Default Settings)?
If so, may I ask you to share a code snippet?
Just restored defaults. Error is persistent.
type testCase struct {
name string
status int
expectErr bool
retryable bool
}
func TestPost(t *testing.T) {
a := setupTest(t)
testCases := []testCase{
{name: "success", status: 201, expectErr: false, retryable: false},
{name: "badRequest", status: 400, expectErr: true, retryable: false},
{name: "unauthorized", status: 401, expectErr: true, retryable: false},
{name: "forbidden", status: 403, expectErr: true, retryable: false},
{name: "notFound", status: 404, expectErr: true, retryable: false},
{name: "internalServerError", status: 500, expectErr: true, retryable: true},
}
for _, tt := range testCases {
t.Run(tt.name, func(t *testing.T) {
retryableErr, err := a.Post(context.Background(), buildBody(tt.name))
checkResponse(t, tt, retryableErr, err)
})
}
}
What version of GoLand are you using (Help | Find Action | About)? I'm unable to reproduce it on 2023.1 version.
Build #GO-231.8109.199, built on March 29, 2023
on Windows 11 gWSL Ubuntu 22.04
We're using build constrains (//go:build integration) for this file. Removing this constrain enables the functionality.
Is it possible to combine both (functionality and constrain)?
Yes, you can add integration to Settings | Go | Build Tags & Vendoring | Custom tags.
Please see: https://www.jetbrains.com/help/go/configuring-build-constraints-and-vendoring.html
Thanks a lot! Works as a charm!
Appreciated for your help...