@@ -40,8 +40,11 @@ var isDatetimeSupported = false
4040var server = "127.0.0.1:3013"
4141var opts = Opts {
4242 Timeout : 5 * time .Second ,
43- User : "test" ,
44- Pass : "test" ,
43+ }
44+ var dialer = TtDialer {
45+ Address : server ,
46+ User : "test" ,
47+ Password : "test" ,
4548}
4649
4750var spaceTuple1 = "testDatetime_1"
@@ -364,7 +367,7 @@ func TestDatetimeInterval(t *testing.T) {
364367func TestDatetimeTarantoolInterval (t * testing.T ) {
365368 skipIfDatetimeUnsupported (t )
366369
367- conn := test_helpers .ConnectWithValidation (t , server , opts )
370+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
368371 defer conn .Close ()
369372
370373 dates := []string {
@@ -504,7 +507,7 @@ func TestInvalidOffset(t *testing.T) {
504507 t .Fatalf ("Unexpected success: %v" , dt )
505508 }
506509 if testcase .ok && isDatetimeSupported {
507- conn := test_helpers .ConnectWithValidation (t , server , opts )
510+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
508511 defer conn .Close ()
509512
510513 tupleInsertSelectDelete (t , conn , tm )
@@ -516,7 +519,7 @@ func TestInvalidOffset(t *testing.T) {
516519func TestCustomTimezone (t * testing.T ) {
517520 skipIfDatetimeUnsupported (t )
518521
519- conn := test_helpers .ConnectWithValidation (t , server , opts )
522+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
520523 defer conn .Close ()
521524
522525 customZone := "Europe/Moscow"
@@ -676,7 +679,7 @@ var datetimeSample = []struct {
676679func TestDatetimeInsertSelectDelete (t * testing.T ) {
677680 skipIfDatetimeUnsupported (t )
678681
679- conn := test_helpers .ConnectWithValidation (t , server , opts )
682+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
680683 defer conn .Close ()
681684
682685 for _ , testcase := range datetimeSample {
@@ -705,7 +708,7 @@ func TestDatetimeInsertSelectDelete(t *testing.T) {
705708func TestDatetimeBoundaryRange (t * testing.T ) {
706709 skipIfDatetimeUnsupported (t )
707710
708- conn := test_helpers .ConnectWithValidation (t , server , opts )
711+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
709712 defer conn .Close ()
710713
711714 for _ , tm := range append (lesserBoundaryTimes , boundaryTimes ... ) {
@@ -731,7 +734,7 @@ func TestDatetimeOutOfRange(t *testing.T) {
731734func TestDatetimeReplace (t * testing.T ) {
732735 skipIfDatetimeUnsupported (t )
733736
734- conn := test_helpers .ConnectWithValidation (t , server , opts )
737+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
735738 defer conn .Close ()
736739
737740 tm , err := time .Parse (time .RFC3339 , "2007-01-02T15:04:05Z" )
@@ -896,7 +899,7 @@ func (c *Tuple2) DecodeMsgpack(d *msgpack.Decoder) error {
896899func TestCustomEncodeDecodeTuple1 (t * testing.T ) {
897900 skipIfDatetimeUnsupported (t )
898901
899- conn := test_helpers .ConnectWithValidation (t , server , opts )
902+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
900903 defer conn .Close ()
901904
902905 tm1 , _ := time .Parse (time .RFC3339 , "2010-05-24T17:51:56.000000009Z" )
@@ -966,7 +969,7 @@ func TestCustomEncodeDecodeTuple1(t *testing.T) {
966969func TestCustomDecodeFunction (t * testing.T ) {
967970 skipIfDatetimeUnsupported (t )
968971
969- conn := test_helpers .ConnectWithValidation (t , server , opts )
972+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
970973 defer conn .Close ()
971974
972975 // Call function 'call_datetime_testdata' returning a custom tuples.
@@ -1010,7 +1013,7 @@ func TestCustomDecodeFunction(t *testing.T) {
10101013func TestCustomEncodeDecodeTuple5 (t * testing.T ) {
10111014 skipIfDatetimeUnsupported (t )
10121015
1013- conn := test_helpers .ConnectWithValidation (t , server , opts )
1016+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
10141017 defer conn .Close ()
10151018
10161019 tm := time .Unix (500 , 1000 ).In (time .FixedZone (NoTimezone , 0 ))
@@ -1168,12 +1171,10 @@ func runTestMain(m *testing.M) int {
11681171 instance , err := test_helpers .StartTarantool (test_helpers.StartOpts {
11691172 InitScript : "config.lua" ,
11701173 Listen : server ,
1171- User : opts .User ,
1172- Pass : opts .Pass ,
11731174 WaitStart : 100 * time .Millisecond ,
11741175 ConnectRetry : 10 ,
11751176 RetryTimeout : 500 * time .Millisecond ,
1176- })
1177+ }, dialer )
11771178 defer test_helpers .StopTarantoolWithCleanup (instance )
11781179
11791180 if err != nil {
0 commit comments