@@ -2,19 +2,13 @@ package github
22
33import (
44 "fmt"
5- "os"
65 "testing"
76
87 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
98 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
109)
1110
1211func TestAccDataSourceGithubOrganizationRoleUsers (t * testing.T ) {
13- login := os .Getenv ("GITHUB_IN_ORG_USER" )
14- if len (login ) == 0 {
15- t .Skip ("set inOrgUser to unskip this test run" )
16- }
17-
1812 t .Run ("get the organization role users without error" , func (t * testing.T ) {
1913 roleId := 8134
2014 config := fmt .Sprintf (`
@@ -30,7 +24,7 @@ func TestAccDataSourceGithubOrganizationRoleUsers(t *testing.T) {
3024 github_organization_role_user.test
3125 ]
3226 }
33- ` , roleId , login )
27+ ` , roleId , testAccConf . testOrgUser )
3428
3529 resource .Test (t , resource.TestCase {
3630 PreCheck : func () { skipUnlessHasOrgs (t ) },
@@ -42,7 +36,7 @@ func TestAccDataSourceGithubOrganizationRoleUsers(t *testing.T) {
4236 resource .TestCheckResourceAttrSet ("data.github_organization_role_users.test" , "users.#" ),
4337 resource .TestCheckResourceAttr ("data.github_organization_role_users.test" , "users.#" , "1" ),
4438 resource .TestCheckResourceAttrSet ("data.github_organization_role_users.test" , "users.0.user_id" ),
45- resource .TestCheckResourceAttr ("data.github_organization_role_users.test" , "users.0.login" , login ),
39+ resource .TestCheckResourceAttr ("data.github_organization_role_users.test" , "users.0.login" , testAccConf . testOrgUser ),
4640 ),
4741 },
4842 },
@@ -76,7 +70,7 @@ func TestAccDataSourceGithubOrganizationRoleUsers(t *testing.T) {
7670 github_organization_role_team.test
7771 ]
7872 }
79- ` , teamName , login , roleId )
73+ ` , teamName , testAccConf . testOrgUser , roleId )
8074
8175 resource .Test (t , resource.TestCase {
8276 PreCheck : func () { skipUnlessHasOrgs (t ) },
@@ -88,7 +82,7 @@ func TestAccDataSourceGithubOrganizationRoleUsers(t *testing.T) {
8882 resource .TestCheckResourceAttrSet ("data.github_organization_role_users.test" , "users.#" ),
8983 resource .TestCheckResourceAttr ("data.github_organization_role_users.test" , "users.#" , "1" ),
9084 resource .TestCheckResourceAttrSet ("data.github_organization_role_users.test" , "users.0.user_id" ),
91- resource .TestCheckResourceAttr ("data.github_organization_role_users.test" , "users.0.login" , login ),
85+ resource .TestCheckResourceAttr ("data.github_organization_role_users.test" , "users.0.login" , testAccConf . testOrgUser ),
9286 ),
9387 },
9488 },
0 commit comments