Skip to content

Commit

Permalink
Fix tests for protocol v6
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgajard committed Apr 4, 2024
1 parent 15e0050 commit eb3b1f3
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions pagerduty/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func handleNotFoundError(err error, d *schema.ResourceData) error {
return genError(err, d)
}

func providerConfigureContextFunc(ctx context.Context, data *schema.ResourceData, terraformVersion string) (interface{}, diag.Diagnostics) {
func providerConfigureContextFunc(_ context.Context, data *schema.ResourceData, terraformVersion string) (interface{}, diag.Diagnostics) {
var diags diag.Diagnostics
serviceRegion := strings.ToLower(data.Get("service_region").(string))

Expand Down Expand Up @@ -225,7 +225,7 @@ func providerConfigureContextFunc(ctx context.Context, data *schema.ResourceData
if err := validateAuthMethodConfig(data); err != nil {
diag := diag.Diagnostic{
Severity: diag.Warning,
Summary: fmt.Sprint("`token` and `use_app_oauth_scoped_token` are both configured at the same time"),
Summary: "`token` and `use_app_oauth_scoped_token` are both configured at the same time",
Detail: err.Error(),
}
diags = append(diags, diag)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
func TestAccDataSourcePagerDutyExtensionSchema_Basic(t *testing.T) {
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyScheduleDestroy,
Steps: []resource.TestStep{
{
Expand Down
2 changes: 1 addition & 1 deletion pagerdutyplugin/data_source_pagerduty_tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestAccDataSourcePagerDutyTag_Basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
Steps: []resource.TestStep{
{
Config: testAccDataSourcePagerDutyTagConfig(tag),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestAccPagerDutyExtensionServiceNow_import(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyExtensionServiceNowDestroy,
Steps: []resource.TestStep{
{
Expand Down
2 changes: 1 addition & 1 deletion pagerdutyplugin/import_pagerduty_extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func TestAccPagerDutyExtension_import(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyExtensionDestroy,
Steps: []resource.TestStep{
{
Expand Down
6 changes: 3 additions & 3 deletions pagerdutyplugin/import_pagerduty_tag_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func TestAccPagerDutyTagAssignment_import(t *testing.T) {
team := fmt.Sprintf("tf-%s", acctest.RandString(5))

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckPagerDutyTagAssignmentDestroy,
PreCheck: func() { testAccPreCheck(t) },
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyTagAssignmentDestroy,
Steps: []resource.TestStep{
{
Config: testAccCheckPagerDutyTagAssignmentTeamConfig(tag, team),
Expand Down
2 changes: 1 addition & 1 deletion pagerdutyplugin/import_pagerduty_tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func TestAccPagerDutyTag_import(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyTagDestroy,
Steps: []resource.TestStep{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestAccPagerDutyExtensionServiceNow_Basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyExtensionServiceNowDestroy,
Steps: []resource.TestStep{
{
Expand Down
2 changes: 1 addition & 1 deletion pagerdutyplugin/resource_pagerduty_extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestAccPagerDutyExtension_Basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyExtensionDestroy,
Steps: []resource.TestStep{
{
Expand Down
4 changes: 2 additions & 2 deletions pagerdutyplugin/resource_pagerduty_tag_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (r *resourceTagAssignment) requestGetTagAssignents(ctx context.Context, mod
})
if err != nil {
diags.AddError(
fmt.Sprintf("Error reading tags for %d entity with ID %s", assign.EntityType, assign.EntityID),
fmt.Sprintf("Error reading tags for %s entity with ID %s", assign.EntityType, assign.EntityID),
err.Error(),
)
}
Expand Down Expand Up @@ -187,7 +187,7 @@ func (r *resourceTagAssignment) isFoundTagAssignment(ctx context.Context, entity
})
if err != nil {
diags.AddError(
fmt.Sprintf("Error finding %s entity with ID %d", entityType, entityID),
fmt.Sprintf("Error finding %s entity with ID %s", entityType, entityID),
err.Error(),
)
isFound = false
Expand Down
6 changes: 3 additions & 3 deletions pagerdutyplugin/resource_pagerduty_tag_assignment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestAccPagerDutyTagAssignment_User(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyTagAssignmentDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -70,7 +70,7 @@ func TestAccPagerDutyTagAssignment_Team(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyTagAssignmentDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -121,7 +121,7 @@ func TestAccPagerDutyTagAssignment_EP(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyTagAssignmentDestroy,
Steps: []resource.TestStep{
{
Expand Down
2 changes: 1 addition & 1 deletion pagerdutyplugin/resource_pagerduty_tag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func TestAccPagerDutyTag_Basic(t *testing.T) {

resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProtoV5ProviderFactories: testAccProtoV5ProviderFactories(),
ProtoV6ProviderFactories: testAccProtoV6ProviderFactories(),
CheckDestroy: testAccCheckPagerDutyTagDestroy,
Steps: []resource.TestStep{
{
Expand Down

0 comments on commit eb3b1f3

Please sign in to comment.