Skip to content

Release v2.0.0: cleanup, bug fixes, and packaging/CI modernization - #95

Merged
ludoo merged 4 commits into
masterfrom
ludo/v2-cleanup
Nov 20, 2026
Merged

ludoo merged 4 commits into
masterfrom
ludo/v2-cleanup

Conversation

@ludoo

@ludoo ludoo commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prepares v2.0.0 of tftest:

  • Drop experimental method caching (_cache, enable_cache, use_cache, cache_dir) and legacy dead code (TerraformStateResource, __bytes__).
  • Standardize tf.tfdir as pathlib.Path across all initialization modes while accepting str | os.PathLike for all path arguments.
  • Deterministic cleanup & context manager: support with TerraformTest(...) as tf: and tf.cleanup(), clean up terraform.tfstate.d/, preserve pre-existing .terraform.lock.hcl files, and support directory linking in setup(extra_files=...).
  • Saved plan workflow & /tmp leak fix: add plan_out to plan() and plan_file to apply(), and unlink internal temporary plan files in finally when output=True and plan_out is omitted.
  • Core bug fixes:
    • Stringify kv_flags values in parse_args() so integer parallelism does not crash subprocess.Popen.
    • Serialize booleans (and tuples) via json.dumps in tf_vars so type = bool variables receive valid lowercase HCL booleans.
    • Fix disable_prevent_destroy backup restoration (with_suffix('') instead of str.strip('.bkp')), support compact prevent_destroy=true, skip .terraform/, and avoid overwriting existing .bkp backups on repeated setup().
    • Drain stderr concurrently in execute_command() to avoid OS pipe deadlocks and populate cmd_error consistently, and raise TerraformTestError on all unexpected non-zero exit codes (allowing 2 for plan -detailed-exitcode).
    • Raise AttributeError instead of KeyError in TerraformPlanOutput.__getattr__ and TerraformState.__getattr__, guard prior_state: null, and fix root-module and data. resource keys in TerraformState.resources.
  • Packaging & CI: replace setup.py (nose>=1.3) with pyproject.toml (requires-python = ">=3.10"), update GitHub Actions workflows to test Python 3.10 and 3.13 against both Terraform and OpenTofu, and expand regression test coverage.
Requires Python 3.10+, removes `enable_cache`/`use_cache` method caching, and standardizes `TerraformTest.tfdir` as a `pathlib.Path` object.

Comment thread .github/workflows/tests.yml Fixed
@ludoo
ludoo merged commit cc5f35b into master Nov 20, 2026
16 checks passed
@ludoo
ludoo deleted the ludo/v2-cleanup branch November 20, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants