Skip to content

Commit aea2a5a

Browse files
committed
fix tests
1 parent f0bfb61 commit aea2a5a

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

internal/command/test_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,19 @@ func TestTest_Runs(t *testing.T) {
219219
code: 0,
220220
},
221221
"mocking": {
222-
expectedOut: []string{"6 passed, 0 failed."},
222+
expectedOut: []string{"7 passed, 0 failed."},
223223
code: 0,
224224
},
225225
"mocking-invalid": {
226226
expectedErr: []string{"Invalid outputs attribute"},
227227
initCode: 1,
228228
},
229+
"mocking-error": {
230+
expectedErr: []string{"Unknown condition value",
231+
"test_resource.primary[0].id",
232+
},
233+
code: 1,
234+
},
229235
"dangling_data_block": {
230236
expectedOut: []string{"2 passed, 0 failed."},
231237
code: 0,

internal/command/testdata/test/mocking-error/tests/plan_mocked_overridden.tftest.hcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ run "test" {
2626
command = plan
2727

2828
assert {
29-
condition = test_resource.primary[0].id != "bbbb"
29+
condition = test_resource.primary[0].id == "bbbb"
3030
error_message = "plan should not have the overridden value"
3131
}
3232

internal/terraform/node_resource_abstract_instance.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,19 +1250,6 @@ func (n *NodeAbstractResourceInstance) plan(
12501250
return plan, state, deferred, keyData, diags
12511251
}
12521252

1253-
// func getMockedData(override *configs.Override, isPlan bool) *mocking.MockedData {
1254-
// if override == nil {
1255-
// return nil
1256-
// }
1257-
// return &mocking.MockedData{
1258-
// Value: override.Values,
1259-
// Range: override.Range,
1260-
// // Apply never ignores computed values. This attribute only matters
1261-
// // when we are planning.
1262-
// ComputedAsUnknown: override.IgnoreValues && isPlan,
1263-
// }
1264-
// }
1265-
12661253
func (n *NodeAbstractResource) processIgnoreChanges(prior, config cty.Value, schema *configschema.Block) (cty.Value, tfdiags.Diagnostics) {
12671254
// ignore_changes only applies when an object already exists, since we
12681255
// can't ignore changes to a thing we've not created yet.

0 commit comments

Comments
 (0)