Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate pack #3 of datasources and resources to terraform plugin framework #896

Merged
merged 4 commits into from
Jul 4, 2024

Conversation

cjgajard
Copy link
Contributor

@cjgajard cjgajard commented Jul 2, 2024

Includes migration to terraform plugin framework for:

  • data.pagerduty_license
  • data.pagerduty_licenses
  • data.pagerduty_priority
  • pagerduty_team

Acceptance tests results after migration

TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -count=1 -run TestAccDataSourcePagerDutyLicense -timeout 120m
?       github.com/PagerDuty/terraform-provider-pagerduty       [no test files]
?       github.com/PagerDuty/terraform-provider-pagerduty/util/apiutil  [no test files]
=== RUN   TestAccDataSourcePagerDutyLicense_Basic
    data_source_pagerduty_license_test.go:93: PAGERDUTY_ACC_LICENSE_NAME not set. Skipping tests requiring license names
--- SKIP: TestAccDataSourcePagerDutyLicense_Basic (0.00s)
=== RUN   TestAccDataSourcePagerDutyLicense_Empty
--- PASS: TestAccDataSourcePagerDutyLicense_Empty (6.04s)
=== RUN   TestAccDataSourcePagerDutyLicense_Error
--- PASS: TestAccDataSourcePagerDutyLicense_Error (1.90s)
=== RUN   TestAccDataSourcePagerDutyLicense_ErrorWithID
--- PASS: TestAccDataSourcePagerDutyLicense_ErrorWithID (1.54s)
=== RUN   TestAccDataSourcePagerDutyLicenses_Basic
--- PASS: TestAccDataSourcePagerDutyLicenses_Basic (4.72s)
=== RUN   TestAccDataSourcePagerDutyLicenses_WithID
--- PASS: TestAccDataSourcePagerDutyLicenses_WithID (4.65s)
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerduty     19.788s
testing: warning: no tests to run
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerdutyplugin       1.328s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/util  0.992s [no tests to run]
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -count=1 -run TestAccDataSourcePagerDutyLicenses -timeout 120m
?       github.com/PagerDuty/terraform-provider-pagerduty       [no test files]
?       github.com/PagerDuty/terraform-provider-pagerduty/util/apiutil  [no test files]
=== RUN   TestAccDataSourcePagerDutyLicenses_Basic
--- PASS: TestAccDataSourcePagerDutyLicenses_Basic (4.57s)
=== RUN   TestAccDataSourcePagerDutyLicenses_WithID
--- PASS: TestAccDataSourcePagerDutyLicenses_WithID (4.63s)
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerduty     9.577s
testing: warning: no tests to run
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerdutyplugin       0.752s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/util  0.471s [no tests to run]
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -count=1 -run TestAccDataSourcePagerDutyPriority -timeout 120m
?       github.com/PagerDuty/terraform-provider-pagerduty       [no test files]
?       github.com/PagerDuty/terraform-provider-pagerduty/util/apiutil  [no test files]
=== RUN   TestAccDataSourcePagerDutyPriority_Basic
--- PASS: TestAccDataSourcePagerDutyPriority_Basic (4.59s)
=== RUN   TestAccDataSourcePagerDutyPriority_P2
--- PASS: TestAccDataSourcePagerDutyPriority_P2 (4.65s)
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerduty     9.625s
testing: warning: no tests to run
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerdutyplugin       0.726s [no tests to run]
testing: warning: no tests to run
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/util  0.441s [no tests to run]
$ go test ./... -count=1 -run TestAccPagerDutyTeam -failfast -v
?       github.com/PagerDuty/terraform-provider-pagerduty       [no test files]
?       github.com/PagerDuty/terraform-provider-pagerduty/util/apiutil  [no test files]
=== RUN   TestAccPagerDutyTeamMembership_import
--- PASS: TestAccPagerDutyTeamMembership_import (13.20s)
=== RUN   TestAccPagerDutyTeamMembership_importWithRole
--- PASS: TestAccPagerDutyTeamMembership_importWithRole (12.19s)
=== RUN   TestAccPagerDutyTeamMembership_Basic
--- PASS: TestAccPagerDutyTeamMembership_Basic (12.05s)
=== RUN   TestAccPagerDutyTeamMembership_WithRole
--- PASS: TestAccPagerDutyTeamMembership_WithRole (11.90s)
=== RUN   TestAccPagerDutyTeamMembership_WithRoleConsistentlyAssigned
--- PASS: TestAccPagerDutyTeamMembership_WithRoleConsistentlyAssigned (20.66s)
=== RUN   TestAccPagerDutyTeamMembership_DestroyWithEscalationPolicyDependant
--- PASS: TestAccPagerDutyTeamMembership_DestroyWithEscalationPolicyDependant (20.01s)
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerduty     90.560s
=== RUN   TestAccPagerDutyTeam_import
--- PASS: TestAccPagerDutyTeam_import (10.98s)
=== RUN   TestAccPagerDutyTeam_Basic
--- PASS: TestAccPagerDutyTeam_Basic (22.23s)
=== RUN   TestAccPagerDutyTeam_DefaultRole
--- PASS: TestAccPagerDutyTeam_DefaultRole (14.99s)
=== RUN   TestAccPagerDutyTeam_Parent
--- PASS: TestAccPagerDutyTeam_Parent (12.19s)
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerdutyplugin       61.156s
testing: warning: no tests to run
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/util  0.884s [no tests to run]

Copy link
Contributor

@imjaroiswebdev imjaroiswebdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cjgajard as usual good job driving this migration of resources to TFPF, however there a couple of comments to address before merging this.

Plus, could you please make sure it's rebased onto master? After addressing the above We can move on with merging. Thanks!

pagerdutyplugin/data_source_pagerduty_licenses.go Outdated Show resolved Hide resolved
Copy link
Contributor

@imjaroiswebdev imjaroiswebdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Now We're ready to merge. Thank you for addressing the comments so quickly and migrating these resources 💪🏽 🥇

@imjaroiswebdev imjaroiswebdev merged commit 955eef9 into PagerDuty:master Jul 4, 2024
1 check passed
@cjgajard cjgajard deleted the tpf-team branch July 8, 2024 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants