github.com/opentofu/opentofu@v1.7.1/internal/configs/testdata/valid-modules/with-tests/test_case_two.tftest.hcl (about)

     1  # test_run_one does a complete apply
     2  run "test_run_one" {
     3    variables {
     4      input = "test_run_one"
     5    }
     6  
     7    assert {
     8      condition = foo_resource.a.value == "test_run_one"
     9      error_message = "invalid value"
    10    }
    11  }
    12  
    13  # test_run_two does a refresh only apply
    14  run "test_run_two" {
    15    plan_options {
    16      mode = refresh-only
    17    }
    18  
    19    variables {
    20      input = "test_run_two"
    21    }
    22  
    23    assert {
    24      # value shouldn't change, as we're doing a refresh-only apply.
    25      condition = foo_resource.a.value == "test_run_one"
    26      error_message = "invalid value"
    27    }
    28  }
    29  
    30  # test_run_three does an apply with a replace operation
    31  run "test_run_three" {
    32    variables {
    33      input = "test_run_three"
    34    }
    35  
    36    plan_options {
    37      replace = [
    38        bar_resource.c
    39      ]
    40    }
    41  
    42    assert {
    43      condition = foo_resource.a.value == "test_run_three"
    44      error_message = "invalid value"
    45    }
    46  }