Skip to content

test: read-back failure tests must prove state was saved #986

Closed

Description

@SebTardif

Problem

Several create read-back tests only match the diagnostic text partial Terraform state was saved. That sentence is a constant. The test stays green if Create stops calling resp.State.Set before the refresh error, which leaves the Coolify object untracked.

TestProjectResource_CreateReadBackFailurePreservesState now requires the next apply to DELETE the tainted project once (commit 8fc4661). Zero deletes fails the test.

Remaining tests

These still only match the error string:

  • internal/service/privatekey/resource_test.go
  • internal/service/database/backup/resource_test.go
  • internal/service/database/redis/resource_test.go
  • internal/service/digitalocean/resource_test.go
  • internal/service/environment/resource_test.go
  • internal/service/hetzner/resource_test.go
  • internal/service/database/mariadb/resource_test.go
  • internal/service/database/keydb/resource_test.go
  • internal/service/vultr/resource_test.go
  • internal/service/database/dragonfly/resource_test.go
  • internal/service/database/mysql/resource_test.go
  • internal/service/cloudtoken/resource_test.go
  • internal/service/server/resource_test.go
  • internal/service/database/postgresql/resource_test.go
  • internal/service/database/clickhouse/resource_test.go
  • internal/service/application/resource_dockerfile_test.go
  • internal/service/application/resource_private_git_test.go
  • internal/service/database/mongodb/resource_test.go
  • internal/service/application/resource_github_app_test.go
  • internal/service/s3storage/resource_test.go
  • internal/service/application/resource_docker_test.go
  • internal/service/application/resource_test.go
  • internal/service/service/resource_test.go

Done when

Each test has a follow-up apply that must destroy the tainted object (one DELETE, and a second create). A run with resp.State.Set removed fails that test.

Activity

  1. added
    tech-debtTechnical debt to address in future sessions
    readyReady to implement
    on Oct 12, 2026
  2. SebTardif commented on Oct 12, 2026

    @SebTardif
    MemberAuthor

    The read-back tests now require a second apply that deletes the tainted object once and creates it again. That landed on PR #987, and CI passed on 931c830.

    Each listed test checks for two creates and one delete. Removing the state save before the refresh error fails that test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    readyReady to implementtech-debtTechnical debt to address in future sessions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions