Skip to content

Commit

Permalink
Add Run Tasks entitlement for Organizations
Browse files Browse the repository at this point in the history
This commit adds the beta API changes for the Run Tasks
entitlement as per RFC TF-479:
* Add run-tasks to Organization entitlement set

This commit also adds tests for this beta feature.
  • Loading branch information
glennsarti committed Apr 19, 2022
1 parent fb2d82c commit 4941235
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions organization.go
Expand Up @@ -94,6 +94,7 @@ type Entitlements struct {
CostEstimation bool `jsonapi:"attr,cost-estimation"`
Operations bool `jsonapi:"attr,operations"`
PrivateModuleRegistry bool `jsonapi:"attr,private-module-registry"`
RunTasks bool `jsonapi:"attr,run-tasks"`
SSO bool `jsonapi:"attr,sso"`
Sentinel bool `jsonapi:"attr,sentinel"`
StateStorage bool `jsonapi:"attr,state-storage"`
Expand Down
20 changes: 20 additions & 0 deletions organization_integration_test.go
Expand Up @@ -482,3 +482,23 @@ func TestOrganizationsReadRunTasksPermission(t *testing.T) {
})
})
}

func TestOrganizationsReadRunTasksEntitlement(t *testing.T) {
skipIfEnterprise(t)
skipIfFreeOnly(t)
skipIfBeta(t)

client := testClient(t)
ctx := context.Background()

orgTest, orgTestCleanup := createOrganization(t, client)
defer orgTestCleanup()

t.Run("when the org exists", func(t *testing.T) {
entitlements, err := client.Organizations.ReadEntitlements(ctx, orgTest.Name)
require.NoError(t, err)

assert.NotEmpty(t, entitlements.ID)
assert.True(t, entitlements.RunTasks)
})
}

0 comments on commit 4941235

Please sign in to comment.