Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actions/test-go-tfe/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ runs:
GITHUB_POLICY_SET_IDENTIFIER: "svc-team-tf-core-cloud/test-policy-set"
GITHUB_REGISTRY_MODULE_IDENTIFIER: "svc-team-tf-core-cloud/terraform-random-module"
GITHUB_REGISTRY_NO_CODE_MODULE_IDENTIFIER: "hashicorp/terraform-random-no-code-module"
GITHUB_STACK_IDENTIFIER: "svc-team-tf-core-cloud/tf-stacks-pet-nulls"
Comment thread
aaabdelgany marked this conversation as resolved.
OAUTH_CLIENT_GITHUB_TOKEN: "${{ inputs.oauth-client-github-token }}"
SKIP_HYOK_INTEGRATION_TESTS: "${{ inputs.skip-hyok-integration-tests }}"
HYOK_ORGANIZATION_NAME: "${{ inputs.hyok-organization-name }}"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
## Enhancements
* Adds the `Size` field to `StateVersion` by @shaunakone [#1280](https://github.com/hashicorp/go-tfe/pull/1280)
* Upgrade go version from `1.24` to `1.25` by @uk1288 [#1297](https://github.com/hashicorp/go-tfe/pull/1297)
* Unskip stacks integration tests and remove diagnostics#acknowledge in preparation for stacks tfe release by @aaabdelgany [#1298](https://github.com/hashicorp/go-tfe/pull/1298)

Comment thread
aaabdelgany marked this conversation as resolved.
# v1.101.0

Expand Down
2 changes: 2 additions & 0 deletions docs/TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Tests are run against an actual backend so they require a valid backend address
$ GITHUB_APP_INSTALLATION_ID=ghain-xxxx TFE_ADDRESS= https://tfe.local TFE_TOKEN=xxx GITHUB_POLICY_SET_IDENTIFIER=username/repository GITHUB_REGISTRY_MODULE_IDENTIFIER=username/repository go test -run "(GHA|GithubApp)" -v ./...
```
8. `GITHUB_REGISTRY_NO_CODE_MODULE_IDENTIFIER` - Required for running tests for workspaces using no-code modules.
9. `GITHUB_STACK_IDENTIFIER` - Required for running tests against vcs backed stacks.
10. `GITHUB_STACK_REPO_BRANCH` - Required for running tests against specific branches of vcs backed stacks.
Comment thread
aaabdelgany marked this conversation as resolved.

## 3. Make sure run queue settings are correct

Expand Down
12 changes: 3 additions & 9 deletions stack_configuration_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (

func TestStackConfigurationList(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -28,7 +27,7 @@ func TestStackConfigurationList(t *testing.T) {
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "test-stack-list",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
},
Project: &Project{
Expand Down Expand Up @@ -82,7 +81,6 @@ func TestStackConfigurationList(t *testing.T) {

func TestStackConfigurationCreateUploadAndRead(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand Down Expand Up @@ -127,7 +125,6 @@ func TestStackConfigurationCreateUploadAndRead(t *testing.T) {

func TestStackConfigurationDiagnostics(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -144,9 +141,9 @@ func TestStackConfigurationDiagnostics(t *testing.T) {
Name: "test-stack",

VCSRepo: &StackVCSRepoOptions{
Identifier: "ctrombley/linked-stacks-demo-network",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "diagnostics", // This branch will produce diagnostics
Branch: "diags",
},
Comment thread
aaabdelgany marked this conversation as resolved.
})
require.NoError(t, err)
Expand Down Expand Up @@ -174,13 +171,10 @@ func TestStackConfigurationDiagnostics(t *testing.T) {
assert.NotEmpty(t, diag.Summary)
assert.NotEmpty(t, diag.Detail)
assert.NotEmpty(t, diag.Diags)
assert.False(t, diag.Acknowledged)
assert.Nil(t, diag.AcknowledgedAt)
assert.NotZero(t, diag.CreatedAt)

assert.Nil(t, diag.StackDeploymentStep)
assert.NotNil(t, diag.StackConfiguration)
assert.Nil(t, diag.AcknowledgedBy)
})

t.Run("Diagnostics with invalid ID", func(t *testing.T) {
Expand Down
5 changes: 2 additions & 3 deletions stack_configuration_summary_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (

func TestStackConfigurationSummaryList(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -28,7 +27,7 @@ func TestStackConfigurationSummaryList(t *testing.T) {
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "aa-test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
},
Project: &Project{
Expand All @@ -40,7 +39,7 @@ func TestStackConfigurationSummaryList(t *testing.T) {
stack2, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "bb-test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
},
Project: &Project{
Expand Down
12 changes: 4 additions & 8 deletions stack_deployment_groups_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

func TestStackDeploymentGroupsList(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -27,7 +26,7 @@ func TestStackDeploymentGroupsList(t *testing.T) {
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
},
Project: &Project{
Expand Down Expand Up @@ -80,7 +79,6 @@ func TestStackDeploymentGroupsList(t *testing.T) {

func TestStackDeploymentGroupsRead(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -94,7 +92,7 @@ func TestStackDeploymentGroupsRead(t *testing.T) {
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
},
Project: &Project{
Expand Down Expand Up @@ -133,7 +131,6 @@ func TestStackDeploymentGroupsRead(t *testing.T) {

func TestStackDeploymentGroupsApproveAllPlans(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -147,7 +144,7 @@ func TestStackDeploymentGroupsApproveAllPlans(t *testing.T) {
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down Expand Up @@ -181,7 +178,6 @@ func TestStackDeploymentGroupsApproveAllPlans(t *testing.T) {

func TestStackDeploymentGroupsRerun(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -195,7 +191,7 @@ func TestStackDeploymentGroupsRerun(t *testing.T) {
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down
5 changes: 2 additions & 3 deletions stack_deployment_groups_summary_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

func TestStackDeploymentGroupSummaryList(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -27,7 +26,7 @@ func TestStackDeploymentGroupSummaryList(t *testing.T) {
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "aa-test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
},
Project: &Project{
Expand All @@ -39,7 +38,7 @@ func TestStackDeploymentGroupSummaryList(t *testing.T) {
stack2, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "bb-test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
},
Project: &Project{
Expand Down
3 changes: 1 addition & 2 deletions stack_deployment_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

func TestStackDeploymentsList(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -23,7 +22,7 @@ func TestStackDeploymentsList(t *testing.T) {
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "aa-test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
},
Project: &Project{
Expand Down
12 changes: 4 additions & 8 deletions stack_deployment_runs_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (

func TestStackDeploymentRunsList(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -28,7 +27,7 @@ func TestStackDeploymentRunsList(t *testing.T) {
stack, err := client.Stacks.Create(ctx, StackCreateOptions{
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down Expand Up @@ -99,7 +98,6 @@ func TestStackDeploymentRunsList(t *testing.T) {

func TestStackDeploymentRunsRead(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -114,7 +112,7 @@ func TestStackDeploymentRunsRead(t *testing.T) {
Project: orgTest.DefaultProject,
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down Expand Up @@ -171,7 +169,6 @@ func TestStackDeploymentRunsRead(t *testing.T) {

func TestStackDeploymentRunsApproveAllPlans(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -186,7 +183,7 @@ func TestStackDeploymentRunsApproveAllPlans(t *testing.T) {
Project: orgTest.DefaultProject,
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down Expand Up @@ -225,7 +222,6 @@ func TestStackDeploymentRunsApproveAllPlans(t *testing.T) {

func TestStackDeploymentRunsCancel(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -240,7 +236,7 @@ func TestStackDeploymentRunsCancel(t *testing.T) {
Project: orgTest.DefaultProject,
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down
14 changes: 5 additions & 9 deletions stack_deployment_steps_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (

func TestStackDeploymentStepsList(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -30,7 +29,7 @@ func TestStackDeploymentStepsList(t *testing.T) {
Project: orgTest.DefaultProject,
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down Expand Up @@ -106,7 +105,6 @@ func TestStackDeploymentStepsList(t *testing.T) {

func TestStackDeploymentStepsRead(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -121,7 +119,7 @@ func TestStackDeploymentStepsRead(t *testing.T) {
Project: orgTest.DefaultProject,
Name: "test-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down Expand Up @@ -170,7 +168,6 @@ func TestStackDeploymentStepsRead(t *testing.T) {

func TestStackDeploymentStepsAdvance(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -185,7 +182,7 @@ func TestStackDeploymentStepsAdvance(t *testing.T) {
Project: orgTest.DefaultProject,
Name: "testing-stack",
VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down Expand Up @@ -227,7 +224,7 @@ func TestStackDeploymentStepsAdvance(t *testing.T) {
// Verify that the step status has changed to "completed"
sds, err := client.StackDeploymentSteps.Read(ctx, step.ID)
assert.NoError(t, err)
assert.Equal(t, "completed", sds.Status)
assert.Equal(t, DeploymentStepStatusCompleted, sds.Status)
})

t.Run("Advance with invalid ID", func(t *testing.T) {
Expand Down Expand Up @@ -271,7 +268,6 @@ func pollStackDeploymentStepStatus(t *testing.T, ctx context.Context, client *Cl

func TestStackDeploymentStepsDiagnosticsArtifacts(t *testing.T) {
t.Parallel()
skipUnlessBeta(t)

client := testClient(t)
ctx := context.Background()
Expand All @@ -288,7 +284,7 @@ func TestStackDeploymentStepsDiagnosticsArtifacts(t *testing.T) {
Name: "test-stack",

VCSRepo: &StackVCSRepoOptions{
Identifier: "hashicorp-guides/pet-nulls-stack",
Identifier: stackVCSRepoIdentifier(t),
OAuthTokenID: oauthClient.OAuthTokens[0].ID,
Branch: "main",
},
Expand Down
Loading
Loading