Skip to content

Commit 5eca13b

Browse files
committed
adjust tests for v2 test setup
1 parent 47777b2 commit 5eca13b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

helper/resource/testing_test.go

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,18 @@ func init() {
2929

3030
func TestParallelTest(t *testing.T) {
3131
mt := new(mockT)
32-
ParallelTest(mt, TestCase{})
32+
33+
// the test will error because the binary driver is unconfigured
34+
func() {
35+
defer func() {
36+
if r := recover(); r != nil {
37+
if !strings.HasPrefix(r.(string), "mockT") {
38+
panic(r)
39+
}
40+
}
41+
}()
42+
ParallelTest(mt, TestCase{IsUnitTest: true})
43+
}()
3344

3445
if !mt.ParallelCalled {
3546
t.Fatal("Parallel() not called")
@@ -60,8 +71,9 @@ func TestTest_factoryError(t *testing.T) {
6071
})
6172
}()
6273

63-
if !mt.failed() {
64-
t.Fatal("test should've failed")
74+
fatalStr := fmt.Sprint(mt.FatalArgs)
75+
if !strings.Contains(fatalStr, resourceFactoryError.Error()) {
76+
t.Fatalf("test should've failed with %s, failed with %s", resourceFactoryError, fatalStr)
6577
}
6678
}
6779

0 commit comments

Comments
 (0)