Skip to content

Commit 3aec7c9

Browse files
committed
intg-test: print configPath contents
1 parent a0843d1 commit 3aec7c9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

integrationtests/hotload_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package integrationtests
33
import (
44
"database/sql"
55
"fmt"
6-
"io/ioutil"
76
"log"
7+
"os"
88
"time"
99

1010
"github.com/infobloxopen/hotload"
@@ -28,7 +28,7 @@ func init() {
2828
}
2929

3030
func setDSN(dsn string, path string) {
31-
err := ioutil.WriteFile(path, []byte(dsn), 777)
31+
err := os.WriteFile(path, []byte(dsn), 777)
3232
if err != nil {
3333
Fail("error writing dsn file")
3434
}
@@ -107,6 +107,12 @@ var _ = Describe("hotload integration tests", func() {
107107

108108
It("should connect to new db when file changes", func() {
109109
for i := 0; i < 2; i++ {
110+
configDsn, err := os.ReadFile(configPath)
111+
if err != nil {
112+
Fail(fmt.Sprintf("ReadFile(%s) error opening db: %v", configPath, err))
113+
}
114+
log.Println(fmt.Sprintf("ReadFile(%s)=`%s`", configPath, string(configDsn)))
115+
110116
r, err := db.Exec(fmt.Sprintf("INSERT INTO test (c1) VALUES (%d)", i))
111117
if err != nil {
112118
Fail(fmt.Sprintf("error inserting row: %v", err))

0 commit comments

Comments
 (0)