Skip to content

Commit 2b8eb30

Browse files
authored
Fix failing test TestAccGitlabProjectPushRules_import (#400)
1 parent f6fb6d3 commit 2b8eb30

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

gitlab/resource_gitlab_project_push_rules.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package gitlab
33
import (
44
"fmt"
55
"log"
6+
"strconv"
67

78
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
89
gitlab "github.com/xanzy/go-gitlab"
@@ -152,7 +153,7 @@ func resourceGitlabProjectPushRulesImporter(d *schema.ResourceData, meta interfa
152153
d.SetId(fmt.Sprintf("%d", pushRules.ID))
153154

154155
// Since project is used as a primary key in the Read function, we set that too.
155-
d.Set("project", project)
156+
d.Set("project", strconv.Itoa(pushRules.ProjectID))
156157

157158
return []*schema.ResourceData{d}, nil
158159
}

gitlab/resource_gitlab_project_push_rules_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func TestAccGitlabProjectPushRules_import(t *testing.T) {
9393
{
9494
SkipFunc: isRunningInCE,
9595
ResourceName: "gitlab_project_push_rules.foo",
96-
ImportStateId: fmt.Sprintf("foo-%d", rInt),
96+
ImportStateId: fmt.Sprintf("root/foo-%d", rInt),
9797
ImportState: true,
9898
ImportStateVerify: true,
9999
},

0 commit comments

Comments
 (0)