Skip to content

Commit

Permalink
Remove skipunlessbeta flag for terraform tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aaabdelgany committed Feb 15, 2024
1 parent 7e3754a commit f5dc4e6
Showing 1 changed file with 14 additions and 25 deletions.
39 changes: 14 additions & 25 deletions test_variables_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
)

func TestTestVariablesList(t *testing.T) {
skipUnlessBeta(t)

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

Expand Down Expand Up @@ -84,8 +82,6 @@ func TestTestVariablesList(t *testing.T) {
}

func TestTestVariablesCreate(t *testing.T) {
skipUnlessBeta(t)

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

Expand Down Expand Up @@ -221,8 +217,6 @@ func TestTestVariablesCreate(t *testing.T) {
}

func TestTestVariablesUpdate(t *testing.T) {
skipUnlessBeta(t)

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

Expand All @@ -244,6 +238,20 @@ func TestTestVariablesUpdate(t *testing.T) {

defer tvCleanup1()

t.Run("without any changes", func(t *testing.T) {
v, err := client.TestVariables.Update(ctx, id, vTest.ID, VariableUpdateOptions{})
require.NoError(t, err)

assert.Equal(t, vTest.ID, v.ID)
assert.Equal(t, vTest.Key, v.Key)
assert.Equal(t, vTest.Value, v.Value)
assert.Equal(t, vTest.Description, v.Description)
assert.Equal(t, vTest.Category, v.Category)
assert.Equal(t, vTest.HCL, v.HCL)
assert.Equal(t, vTest.Sensitive, v.Sensitive)
assert.NotEqual(t, vTest.VersionID, v.VersionID)
})

t.Run("with valid options", func(t *testing.T) {
options := VariableUpdateOptions{
Key: String("newname"),
Expand Down Expand Up @@ -287,32 +295,13 @@ func TestTestVariablesUpdate(t *testing.T) {
assert.NotEqual(t, vTest.VersionID, v.VersionID)
})

t.Run("without any changes", func(t *testing.T) {
vTest, vTestCleanup := createVariable(t, client, nil)
defer vTestCleanup()

v, err := client.TestVariables.Update(ctx, id, vTest.ID, VariableUpdateOptions{})
require.NoError(t, err)

assert.Equal(t, vTest.ID, v.ID)
assert.Equal(t, vTest.Key, v.Key)
assert.Equal(t, vTest.Value, v.Value)
assert.Equal(t, vTest.Description, v.Description)
assert.Equal(t, vTest.Category, v.Category)
assert.Equal(t, vTest.HCL, v.HCL)
assert.Equal(t, vTest.Sensitive, v.Sensitive)
assert.NotEqual(t, vTest.VersionID, v.VersionID)
})

t.Run("with invalid variable ID", func(t *testing.T) {
_, err := client.TestVariables.Update(ctx, id, badIdentifier, VariableUpdateOptions{})
assert.Equal(t, err, ErrInvalidVariableID)
})
}

func TestTestVariablesDelete(t *testing.T) {
skipUnlessBeta(t)

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

Expand Down

0 comments on commit f5dc4e6

Please sign in to comment.