Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .github/actions/test-go-tfe/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ 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"
GITHUB_STACK_REPO_BRANCH: "diags"
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 @@ -21,6 +21,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)

# 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.

## 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: stackVCSRepoBranch(t),
},
})
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
29 changes: 29 additions & 0 deletions stack_test_helpers_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright IBM Corp. 2018, 2025
// SPDX-License-Identifier: MPL-2.0

package tfe

import (
"os"
"testing"
)

func stackVCSRepoIdentifier(t *testing.T) string {
t.Helper()

githubIdentifier := os.Getenv("GITHUB_STACK_IDENTIFIER")
if githubIdentifier == "" {
t.Skip("Export a valid GITHUB_STACK_IDENTIFIER before running this test")
}

return githubIdentifier
}

func stackVCSRepoBranch(t *testing.T) string {
githubBranch := os.Getenv("GITHUB_STACK_REPO_BRANCH")
if githubBranch == "" {
return "main"
}

return githubBranch
}
Loading