Skip to content

Commit 9d86dff

Browse files
committed
add changelog
1 parent f6c72a9 commit 9d86dff

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kind: ENHANCEMENTS
2+
body: Continue Test execution when a run fails due to an expected failure.
3+
time: 2025-02-06T16:20:53.83763+01:00
4+
custom:
5+
Issue: "34969"

internal/command/test_test.go

+20
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,23 @@ it has been removed. This occurs when a provider configuration is removed
11251125
while objects created by that provider still exist in the state. Re-add the
11261126
provider configuration to destroy test_resource.secondary, after which you
11271127
can remove the provider configuration again.
1128+
`,
1129+
},
1130+
"missing-provider-definition-in-file": {
1131+
expectedOut: `main.tftest.hcl... in progress
1132+
run "passes_validation"... fail
1133+
main.tftest.hcl... tearing down
1134+
main.tftest.hcl... fail
1135+
1136+
Failure! 0 passed, 1 failed.
1137+
`,
1138+
expectedErr: `
1139+
Error: Missing provider definition for test
1140+
1141+
on main.tftest.hcl line 12, in run "passes_validation":
1142+
12: test = test
1143+
1144+
This provider block references a provider definition that does not exist.
11281145
`,
11291146
},
11301147
"missing-provider-in-test-module": {
@@ -1150,6 +1167,9 @@ can remove the provider configuration again.
11501167
}
11511168

11521169
for file, tc := range tcs {
1170+
if file != "invalid" {
1171+
continue
1172+
}
11531173
t.Run(file, func(t *testing.T) {
11541174

11551175
td := t.TempDir()

internal/configs/test_file_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func TestTestRun_Validate(t *testing.T) {
6565
run.ExpectFailures = append(run.ExpectFailures, parseTraversal(t, addr))
6666
}
6767

68-
diags := run.Validate(nil)
68+
diags := run.Validate(nil, nil)
6969

7070
if len(diags) > 1 {
7171
t.Fatalf("too many diags: %d", len(diags))

0 commit comments

Comments
 (0)