@@ -37,7 +37,7 @@ func TestApply(t *testing.T) {
37
37
// Create a temporary working directory that is empty
38
38
td := t .TempDir ()
39
39
testCopyDir (t , testFixturePath ("apply" ), td )
40
- t .Cleanup ( testChdir ( t , td ) )
40
+ t .Chdir ( td )
41
41
42
42
statePath := testTempFile (t )
43
43
@@ -75,7 +75,7 @@ func TestApply_path(t *testing.T) {
75
75
// Create a temporary working directory that is empty
76
76
td := t .TempDir ()
77
77
testCopyDir (t , testFixturePath ("apply" ), td )
78
- t .Cleanup ( testChdir ( t , td ) )
78
+ t .Chdir ( td )
79
79
80
80
p := applyFixtureProvider ()
81
81
@@ -105,7 +105,7 @@ func TestApply_approveNo(t *testing.T) {
105
105
// Create a temporary working directory that is empty
106
106
td := t .TempDir ()
107
107
testCopyDir (t , testFixturePath ("apply" ), td )
108
- t .Cleanup ( testChdir ( t , td ) )
108
+ t .Chdir ( td )
109
109
110
110
statePath := testTempFile (t )
111
111
@@ -148,7 +148,7 @@ func TestApply_approveYes(t *testing.T) {
148
148
// Create a temporary working directory that is empty
149
149
td := t .TempDir ()
150
150
testCopyDir (t , testFixturePath ("apply" ), td )
151
- t .Cleanup ( testChdir ( t , td ) )
151
+ t .Chdir ( td )
152
152
153
153
statePath := testTempFile (t )
154
154
@@ -195,7 +195,7 @@ func TestApply_lockedState(t *testing.T) {
195
195
// Create a temporary working directory that is empty
196
196
td := t .TempDir ()
197
197
testCopyDir (t , testFixturePath ("apply" ), td )
198
- t .Cleanup ( testChdir ( t , td ) )
198
+ t .Chdir ( td )
199
199
200
200
statePath := testTempFile (t )
201
201
@@ -234,7 +234,7 @@ func TestApply_lockedStateWait(t *testing.T) {
234
234
// Create a temporary working directory that is empty
235
235
td := t .TempDir ()
236
236
testCopyDir (t , testFixturePath ("apply" ), td )
237
- t .Cleanup ( testChdir ( t , td ) )
237
+ t .Chdir ( td )
238
238
239
239
statePath := testTempFile (t )
240
240
@@ -278,7 +278,7 @@ func TestApply_parallelism(t *testing.T) {
278
278
// Create a temporary working directory that is empty
279
279
td := t .TempDir ()
280
280
testCopyDir (t , testFixturePath ("parallelism" ), td )
281
- t .Cleanup ( testChdir ( t , td ) )
281
+ t .Chdir ( td )
282
282
283
283
statePath := testTempFile (t )
284
284
@@ -376,7 +376,7 @@ func TestApply_configInvalid(t *testing.T) {
376
376
// Create a temporary working directory that is empty
377
377
td := t .TempDir ()
378
378
testCopyDir (t , testFixturePath ("apply-config-invalid" ), td )
379
- t .Cleanup ( testChdir ( t , td ) )
379
+ t .Chdir ( td )
380
380
381
381
p := testProvider ()
382
382
view , done := testView (t )
@@ -402,7 +402,7 @@ func TestApply_defaultState(t *testing.T) {
402
402
// Create a temporary working directory that is empty
403
403
td := t .TempDir ()
404
404
testCopyDir (t , testFixturePath ("apply" ), td )
405
- t .Cleanup ( testChdir ( t , td ) )
405
+ t .Chdir ( td )
406
406
407
407
statePath := filepath .Join (td , DefaultStateFilename )
408
408
@@ -454,7 +454,7 @@ func TestApply_error(t *testing.T) {
454
454
// Create a temporary working directory that is empty
455
455
td := t .TempDir ()
456
456
testCopyDir (t , testFixturePath ("apply-error" ), td )
457
- t .Cleanup ( testChdir ( t , td ) )
457
+ t .Chdir ( td )
458
458
459
459
statePath := testTempFile (t )
460
460
@@ -531,7 +531,7 @@ func TestApply_input(t *testing.T) {
531
531
// Create a temporary working directory that is empty
532
532
td := t .TempDir ()
533
533
testCopyDir (t , testFixturePath ("apply-input" ), td )
534
- t .Cleanup ( testChdir ( t , td ) )
534
+ t .Chdir ( td )
535
535
536
536
// Disable test mode so input would be asked
537
537
test = false
@@ -581,7 +581,7 @@ func TestApply_inputPartial(t *testing.T) {
581
581
// Create a temporary working directory that is empty
582
582
td := t .TempDir ()
583
583
testCopyDir (t , testFixturePath ("apply-input-partial" ), td )
584
- t .Cleanup ( testChdir ( t , td ) )
584
+ t .Chdir ( td )
585
585
586
586
// Disable test mode so input would be asked
587
587
test = false
@@ -627,7 +627,7 @@ func TestApply_noArgs(t *testing.T) {
627
627
// Create a temporary working directory that is empty
628
628
td := t .TempDir ()
629
629
testCopyDir (t , testFixturePath ("apply" ), td )
630
- t .Cleanup ( testChdir ( t , td ) )
630
+ t .Chdir ( td )
631
631
632
632
statePath := testTempFile (t )
633
633
@@ -1250,7 +1250,7 @@ foo = "bar"
1250
1250
t .Run (name , func (t * testing.T ) {
1251
1251
td := t .TempDir ()
1252
1252
testCopyDir (t , testFixturePath ("apply-ephemeral-variable" ), td )
1253
- t .Cleanup ( testChdir ( t , td ) )
1253
+ t .Chdir ( td )
1254
1254
1255
1255
_ , snap := testModuleWithSnapshot (t , "apply-ephemeral-variable" )
1256
1256
plannedVal := cty .ObjectVal (map [string ]cty.Value {
@@ -1424,7 +1424,7 @@ func TestApply_changedVars_applyTime(t *testing.T) {
1424
1424
// var files.
1425
1425
td := t .TempDir ()
1426
1426
testCopyDir (t , testFixturePath ("apply-vars-auto" ), td )
1427
- t .Cleanup ( testChdir ( t , td ) )
1427
+ t .Chdir ( td )
1428
1428
1429
1429
p := planVarsFixtureProvider ()
1430
1430
view , done := testView (t )
@@ -1470,7 +1470,7 @@ func TestApply_planNoModuleFiles(t *testing.T) {
1470
1470
td := testTempDir (t )
1471
1471
defer os .RemoveAll (td )
1472
1472
1473
- t .Cleanup ( testChdir ( t , td ) )
1473
+ t .Chdir ( td )
1474
1474
1475
1475
p := applyFixtureProvider ()
1476
1476
planPath := applyFixturePlanFile (t )
@@ -1493,7 +1493,7 @@ func TestApply_refresh(t *testing.T) {
1493
1493
// Create a temporary working directory that is empty
1494
1494
td := t .TempDir ()
1495
1495
testCopyDir (t , testFixturePath ("apply" ), td )
1496
- t .Cleanup ( testChdir ( t , td ) )
1496
+ t .Chdir ( td )
1497
1497
1498
1498
originalState := states .BuildState (func (s * states.SyncState ) {
1499
1499
s .SetResourceInstanceCurrent (
@@ -1560,7 +1560,7 @@ func TestApply_refreshFalse(t *testing.T) {
1560
1560
// Create a temporary working directory that is empty
1561
1561
td := t .TempDir ()
1562
1562
testCopyDir (t , testFixturePath ("apply" ), td )
1563
- t .Cleanup ( testChdir ( t , td ) )
1563
+ t .Chdir ( td )
1564
1564
1565
1565
originalState := states .BuildState (func (s * states.SyncState ) {
1566
1566
s .SetResourceInstanceCurrent (
@@ -1609,7 +1609,7 @@ func TestApply_shutdown(t *testing.T) {
1609
1609
// Create a temporary working directory that is empty
1610
1610
td := t .TempDir ()
1611
1611
testCopyDir (t , testFixturePath ("apply-shutdown" ), td )
1612
- t .Cleanup ( testChdir ( t , td ) )
1612
+ t .Chdir ( td )
1613
1613
1614
1614
cancelled := make (chan struct {})
1615
1615
shutdownCh := make (chan struct {})
@@ -1697,7 +1697,7 @@ func TestApply_state(t *testing.T) {
1697
1697
// Create a temporary working directory that is empty
1698
1698
td := t .TempDir ()
1699
1699
testCopyDir (t , testFixturePath ("apply" ), td )
1700
- t .Cleanup ( testChdir ( t , td ) )
1700
+ t .Chdir ( td )
1701
1701
1702
1702
originalState := states .BuildState (func (s * states.SyncState ) {
1703
1703
s .SetResourceInstanceCurrent (
@@ -1791,7 +1791,7 @@ func TestApply_stateNoExist(t *testing.T) {
1791
1791
// Create a temporary working directory that is empty
1792
1792
td := t .TempDir ()
1793
1793
testCopyDir (t , testFixturePath ("apply" ), td )
1794
- t .Cleanup ( testChdir ( t , td ) )
1794
+ t .Chdir ( td )
1795
1795
1796
1796
p := applyFixtureProvider ()
1797
1797
view , done := testView (t )
@@ -1816,7 +1816,7 @@ func TestApply_sensitiveOutput(t *testing.T) {
1816
1816
// Create a temporary working directory that is empty
1817
1817
td := t .TempDir ()
1818
1818
testCopyDir (t , testFixturePath ("apply-sensitive-output" ), td )
1819
- t .Cleanup ( testChdir ( t , td ) )
1819
+ t .Chdir ( td )
1820
1820
1821
1821
p := testProvider ()
1822
1822
view , done := testView (t )
@@ -1853,7 +1853,7 @@ func TestApply_vars(t *testing.T) {
1853
1853
// Create a temporary working directory that is empty
1854
1854
td := t .TempDir ()
1855
1855
testCopyDir (t , testFixturePath ("apply-vars" ), td )
1856
- t .Cleanup ( testChdir ( t , td ) )
1856
+ t .Chdir ( td )
1857
1857
1858
1858
statePath := testTempFile (t )
1859
1859
@@ -1910,7 +1910,7 @@ func TestApply_varFile(t *testing.T) {
1910
1910
// Create a temporary working directory that is empty
1911
1911
td := t .TempDir ()
1912
1912
testCopyDir (t , testFixturePath ("apply-vars" ), td )
1913
- t .Cleanup ( testChdir ( t , td ) )
1913
+ t .Chdir ( td )
1914
1914
1915
1915
varFilePath := testTempFile (t )
1916
1916
if err := ioutil .WriteFile (varFilePath , []byte (applyVarFile ), 0644 ); err != nil {
@@ -1972,7 +1972,7 @@ func TestApply_varFileDefault(t *testing.T) {
1972
1972
// Create a temporary working directory that is empty
1973
1973
td := t .TempDir ()
1974
1974
testCopyDir (t , testFixturePath ("apply-vars" ), td )
1975
- t .Cleanup ( testChdir ( t , td ) )
1975
+ t .Chdir ( td )
1976
1976
1977
1977
varFilePath := filepath .Join (td , "terraform.tfvars" )
1978
1978
if err := os .WriteFile (varFilePath , []byte (applyVarFile ), 0644 ); err != nil {
@@ -2033,7 +2033,7 @@ func TestApply_varFileDefaultJSON(t *testing.T) {
2033
2033
// Create a temporary working directory that is empty
2034
2034
td := t .TempDir ()
2035
2035
testCopyDir (t , testFixturePath ("apply-vars" ), td )
2036
- t .Cleanup ( testChdir ( t , td ) )
2036
+ t .Chdir ( td )
2037
2037
2038
2038
varFilePath := filepath .Join (td , "terraform.tfvars.json" )
2039
2039
if err := ioutil .WriteFile (varFilePath , []byte (applyVarFileJSON ), 0644 ); err != nil {
@@ -2094,7 +2094,7 @@ func TestApply_backup(t *testing.T) {
2094
2094
// Create a temporary working directory that is empty
2095
2095
td := t .TempDir ()
2096
2096
testCopyDir (t , testFixturePath ("apply" ), td )
2097
- t .Cleanup ( testChdir ( t , td ) )
2097
+ t .Chdir ( td )
2098
2098
2099
2099
originalState := states .BuildState (func (s * states.SyncState ) {
2100
2100
s .SetResourceInstanceCurrent (
@@ -2171,7 +2171,7 @@ func TestApply_disableBackup(t *testing.T) {
2171
2171
// Create a temporary working directory that is empty
2172
2172
td := t .TempDir ()
2173
2173
testCopyDir (t , testFixturePath ("apply" ), td )
2174
- t .Cleanup ( testChdir ( t , td ) )
2174
+ t .Chdir ( td )
2175
2175
2176
2176
originalState := testState ()
2177
2177
statePath := testStateFile (t , originalState )
@@ -2250,7 +2250,7 @@ func TestApply_terraformEnv(t *testing.T) {
2250
2250
// Create a temporary working directory that is empty
2251
2251
td := t .TempDir ()
2252
2252
testCopyDir (t , testFixturePath ("apply-terraform-env" ), td )
2253
- t .Cleanup ( testChdir ( t , td ) )
2253
+ t .Chdir ( td )
2254
2254
2255
2255
statePath := testTempFile (t )
2256
2256
@@ -2287,7 +2287,7 @@ func TestApply_terraformEnvNonDefault(t *testing.T) {
2287
2287
// Create a temporary working directory that is empty
2288
2288
td := t .TempDir ()
2289
2289
testCopyDir (t , testFixturePath ("apply-terraform-env" ), td )
2290
- t .Cleanup ( testChdir ( t , td ) )
2290
+ t .Chdir ( td )
2291
2291
2292
2292
// Create new env
2293
2293
{
@@ -2348,7 +2348,7 @@ output = test
2348
2348
func TestApply_targeted (t * testing.T ) {
2349
2349
td := t .TempDir ()
2350
2350
testCopyDir (t , testFixturePath ("apply-targeted" ), td )
2351
- t .Cleanup ( testChdir ( t , td ) )
2351
+ t .Chdir ( td )
2352
2352
2353
2353
p := testProvider ()
2354
2354
p .GetProviderSchemaResponse = & providers.GetProviderSchemaResponse {
@@ -2403,7 +2403,7 @@ func TestApply_targetFlagsDiags(t *testing.T) {
2403
2403
t .Run (target , func (t * testing.T ) {
2404
2404
td := testTempDir (t )
2405
2405
defer os .RemoveAll (td )
2406
- t .Cleanup ( testChdir ( t , td ) )
2406
+ t .Chdir ( td )
2407
2407
2408
2408
view , done := testView (t )
2409
2409
c := & ApplyCommand {
@@ -2436,7 +2436,7 @@ func TestApply_targetFlagsDiags(t *testing.T) {
2436
2436
func TestApply_replace (t * testing.T ) {
2437
2437
td := t .TempDir ()
2438
2438
testCopyDir (t , testFixturePath ("apply-replace" ), td )
2439
- t .Cleanup ( testChdir ( t , td ) )
2439
+ t .Chdir ( td )
2440
2440
2441
2441
originalState := states .BuildState (func (s * states.SyncState ) {
2442
2442
s .SetResourceInstanceCurrent (
@@ -2523,7 +2523,7 @@ func TestApply_pluginPath(t *testing.T) {
2523
2523
// Create a temporary working directory that is empty
2524
2524
td := t .TempDir ()
2525
2525
testCopyDir (t , testFixturePath ("apply" ), td )
2526
- t .Cleanup ( testChdir ( t , td ) )
2526
+ t .Chdir ( td )
2527
2527
2528
2528
statePath := testTempFile (t )
2529
2529
@@ -2563,7 +2563,7 @@ func TestApply_jsonGoldenReference(t *testing.T) {
2563
2563
// Create a temporary working directory that is empty
2564
2564
td := t .TempDir ()
2565
2565
testCopyDir (t , testFixturePath ("apply" ), td )
2566
- t .Cleanup ( testChdir ( t , td ) )
2566
+ t .Chdir ( td )
2567
2567
2568
2568
statePath := testTempFile (t )
2569
2569
@@ -2604,7 +2604,7 @@ func TestApply_warnings(t *testing.T) {
2604
2604
// Create a temporary working directory that is empty
2605
2605
td := t .TempDir ()
2606
2606
testCopyDir (t , testFixturePath ("apply" ), td )
2607
- t .Cleanup ( testChdir ( t , td ) )
2607
+ t .Chdir ( td )
2608
2608
2609
2609
p := testProvider ()
2610
2610
p .GetProviderSchemaResponse = applyFixtureSchema ()
0 commit comments