Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
Tests are broken because we merged a contributor PR bypassing tests.
  • Loading branch information
eliecharra committed Jan 24, 2025
1 parent b252356 commit de32abf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions spacelift/resource_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestContextResource(t *testing.T) {
t.Run("creates and updates contexts without an error", func(t *testing.T) {
randomID := acctest.RandStringFromCharSet(5, acctest.CharSetAlphaNum)

config := func(description string) string {
config := func(name, description string) string {
return fmt.Sprintf(`
resource "spacelift_context" "test" {
name = "Provider test context %s"
Expand All @@ -34,16 +34,16 @@ func TestContextResource(t *testing.T) {
before_perform = ["before_perform"]
before_plan = ["before_plan"]
}
`, randomID, description)
`, name+randomID, description)
}

testSteps(t, []resource.TestStep{
{
Config: config("old description"),
Config: config("foo", "old description"),
Check: Resource(
resourceName,
Attribute("id", Equals("provider-test-context-old-description")),
Attribute("name", Equals("Provider test context old description")),
Attribute("id", StartsWith("provider-test-context-foo")),
Attribute("name", StartsWith("Provider test context foo")),
Attribute("description", Equals("old description")),
SetEquals("labels", "one", "two"),
Attribute("after_apply.#", Equals("1")),
Expand Down Expand Up @@ -76,11 +76,11 @@ func TestContextResource(t *testing.T) {
ImportStateVerify: true,
},
{
Config: config("new description"),
Config: config("bar", "new description"),
Check: Resource(
resourceName,
Attribute("id", Equals("provider-test-context-old-description")), // ID shouldn't change on rename
Attribute("name", Equals("Provider test context new description")), // but the name should
Attribute("id", StartsWith("provider-test-context-foo")), // ID shouldn't change on rename
Attribute("name", StartsWith("Provider test context bar")), // but the name should
Attribute("description", Equals("new description")),
),
},
Expand Down

0 comments on commit de32abf

Please sign in to comment.