lifecycle
The lifecycle meta-argument in Testform customizes the default lifecycle management of test resources, protecting them against accidental destruction and suppressing unwanted state drift.
Active lifecycle Directives
Section titled “Active lifecycle Directives”Testform implements two primary controls:
1. prevent_destroy
Section titled “1. prevent_destroy”Strictly halts any execution plan attempting to delete or archive critical test specifications during testform destroy or reconciliation plans:
@auth @critical@prevent_destroyScenario: High-value bank fund transfer Given user has sufficient account balance When user authorizes transfer with multi-factor authentication Then transaction receipt is generatedIf an operator or pipeline attempts to destroy this scenario:
[ERROR] Cannot destroy resource protected by prevent_destroy: auth/payment.feature.@transfer_funds The resource is configured with prevent_destroy = true.2. ignore_changes
Section titled “2. ignore_changes”Suppresses drift detection when external edits occur (e.g. labels, assignees, or priority fields modified in issue trackers):
@ignore_changes("labels", "assignees", "priority")Scenario: User profile inspection Given user navigates to settings dashboard Then personal information is displayedCentralized YAML Configuration
Section titled “Centralized YAML Configuration”Following Terraform conventions, the lifecycle meta-argument belongs strictly within the resource: block:
# main.yml or resource.ymlresource: testcase: match: "features/*.case.feature" lifecycle: prevent_destroy: true ignore_changes: - labels - assignees