-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix panic runtime error in terraform provider for page resources (#190)
* fix page permissions * handle case where the response from page creation doesn't return page object * fix user * add userName * add CI_USER_NAME to ci * added = --------- Co-authored-by: MatanGevaPort <[email protected]>
- Loading branch information
1 parent
2adee62
commit bfce1c8
Showing
3 changed files
with
18 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ package team_test | |
import ( | ||
"fmt" | ||
"github.com/port-labs/terraform-provider-port-labs/v2/internal/utils" | ||
"os" | ||
"testing" | ||
|
||
"github.com/hashicorp/terraform-plugin-testing/helper/resource" | ||
|
@@ -36,6 +37,7 @@ func TestAccPortTeam(t *testing.T) { | |
|
||
func TestAccPortTeamUpdate(t *testing.T) { | ||
teamName := utils.GenID() | ||
userName := os.Getenv("CI_USER_NAME") | ||
var testAccTeamConfigCreate = fmt.Sprintf(` | ||
resource "port_team" "team" { | ||
name = "%s" | ||
|
@@ -47,8 +49,8 @@ func TestAccPortTeamUpdate(t *testing.T) { | |
resource "port_team" "team" { | ||
name = "%s" | ||
description = "Test description2" | ||
users = ["[email protected]"] | ||
}`, teamName) | ||
users = ["%s"] | ||
}`, teamName, userName) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { acctest.TestAccPreCheck(t) }, | ||
|
@@ -68,7 +70,7 @@ func TestAccPortTeamUpdate(t *testing.T) { | |
resource.TestCheckResourceAttr("port_team.team", "name", teamName), | ||
resource.TestCheckResourceAttr("port_team.team", "description", "Test description2"), | ||
resource.TestCheckResourceAttr("port_team.team", "users.#", "1"), | ||
resource.TestCheckResourceAttr("port_team.team", "users.0", "[email protected]"), | ||
resource.TestCheckResourceAttr("port_team.team", "users.0", userName), | ||
), | ||
}, | ||
}, | ||
|
@@ -115,12 +117,13 @@ func TestAccPortTeamEmptyDescription(t *testing.T) { | |
|
||
func TestAccPortTeamImport(t *testing.T) { | ||
teamName := utils.GenID() | ||
userName := os.Getenv("CI_USER_NAME") | ||
var testAccTeamConfigCreate = fmt.Sprintf(` | ||
resource "port_team" "team" { | ||
name = "%s" | ||
description = "Test description" | ||
users = ["[email protected]"] | ||
}`, teamName) | ||
users = ["%s"] | ||
}`, teamName, userName) | ||
|
||
resource.Test(t, resource.TestCase{ | ||
PreCheck: func() { acctest.TestAccPreCheck(t) }, | ||
|
@@ -132,7 +135,7 @@ func TestAccPortTeamImport(t *testing.T) { | |
resource.TestCheckResourceAttr("port_team.team", "name", teamName), | ||
resource.TestCheckResourceAttr("port_team.team", "description", "Test description"), | ||
resource.TestCheckResourceAttr("port_team.team", "users.#", "1"), | ||
resource.TestCheckResourceAttr("port_team.team", "users.0", "[email protected]"), | ||
resource.TestCheckResourceAttr("port_team.team", "users.0", userName), | ||
), | ||
}, | ||
{ | ||
|