File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,8 @@ package integrationtests
33import (
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
3030func 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 ))
You can’t perform that action at this time.
0 commit comments