-
Notifications
You must be signed in to change notification settings - Fork 102
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
TF-20627: Add Waypoint entitlements for organizations #984
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like our CI instance does not support these entitlements; or we need an organization with the Plus
feature set, which to my knowledge can't be upgraded via the feature set API. In the meantime could you put these assertions under a new subtest t.Run("with HCP entitlements", func(t *testing.T) {})
and subsequently skip the substep with a skipUnlessAfterDate() until we investigate this. If you can also paste the test results from your own local testing that would be great ❤️
Let's also add a changelog entry, please 🙏 |
bc01550
to
efb6dc2
Compare
organization_integration_test.go
Outdated
@@ -456,7 +456,9 @@ func TestOrganizationsReadEntitlements(t *testing.T) { | |||
ctx := context.Background() | |||
|
|||
orgTest, orgTestCleanup := createOrganization(t, client) | |||
t.Cleanup(orgTestCleanup) | |||
defer orgTestCleanup() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding, are we trying to move from t.Cleanup(callback)
to defer callback
in general? I see examples of both in go-tfe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I prefer t.Cleanup()
for tests since there are subsequent helpers that receive a testing.T
object
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Cleanup
works better in two situations: using t.Run()
(they clean up after the Test function finishes), and after panics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(so we should just use it all the time)
These changes add to the organizational entitlement struct to be able to utilize the new Waypoint-based entitlements granted with HCP Terraform feature sets: - waypoint-actions - waypoint-templates-and-addons
2c5c46a
to
1593b8e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are passing:
PASS TestOrganizationsReadEntitlements/when_the_org_exists (0.09s)
PASS TestOrganizationsReadEntitlements/with_invalid_name (0.00s)
PASS TestOrganizationsReadEntitlements/when_the_org_does_not_exist (0.08s)
func (b *organizationSubscriptionUpdater) WithPlusEntitlementPlan() *organizationSubscriptionUpdater { | ||
b.planName = "Plus (entitlement)" | ||
|
||
start := time.Now() | ||
ceiling := 1 | ||
managedResourcesLimit := 1000 | ||
|
||
b.updateOpts.ContractStartAt = &start | ||
b.updateOpts.RunsCeiling = &ceiling | ||
b.updateOpts.ContractManagedResourcesLimit = &managedResourcesLimit | ||
return b | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes. |
Description
These changes add to the organizational entitlement struct to be able to
utilize the new Waypoint-based entitlements granted with HCP Terraform
feature sets:
Testing plan
PROVISION_LICENSES
External links
Output from tests