Skip to content

Commit 9b3b1d8

Browse files
olhadotimofurrer
andauthored
Apply suggestions from code review
Remove unneeded checks, and make `analytics_access_level` change explicit, instead of assuming it starts not disabled. Co-authored-by: Timo Furrer <[email protected]>
1 parent f7509ab commit 9b3b1d8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

internal/provider/resource_gitlab_project_test.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,6 @@ func TestAccGitlabProject_templateMutualExclusiveNameAndID(t *testing.T) {
11421142
// Gitlab update project API call requires one from a subset of project fields to be set (See #1157)
11431143
// If only a non-blessed field is changed, this test checks that the provider ensures the code won't return an error.
11441144
func TestAccGitlabProject_UpdateAnalyticsAccessLevel(t *testing.T) {
1145-
var received gitlab.Project
11461145
rInt := acctest.RandInt()
11471146

11481147
resource.Test(t, resource.TestCase{
@@ -1154,11 +1153,9 @@ func TestAccGitlabProject_UpdateAnalyticsAccessLevel(t *testing.T) {
11541153
Config: fmt.Sprintf(`
11551154
resource "gitlab_project" "this" {
11561155
name = "foo-%d"
1157-
visibility_level = "public"
1156+
visibility_level = "public"
1157+
analytics_access_level = "private"
11581158
}`, rInt),
1159-
Check: resource.ComposeTestCheckFunc(
1160-
testAccCheckGitlabProjectExists("gitlab_project.this", &received),
1161-
),
11621159
},
11631160
// Verify Import
11641161
{
@@ -1175,7 +1172,6 @@ func TestAccGitlabProject_UpdateAnalyticsAccessLevel(t *testing.T) {
11751172
analytics_access_level = "disabled"
11761173
}`, rInt),
11771174
Check: resource.ComposeTestCheckFunc(
1178-
testAccCheckGitlabProjectExists("gitlab_project.this", &received),
11791175
resource.TestCheckResourceAttr("gitlab_project.this", "analytics_access_level", "disabled"),
11801176
),
11811177
},

0 commit comments

Comments
 (0)