@@ -40,8 +40,11 @@ var isDatetimeSupported = false
40
40
var server = "127.0.0.1:3013"
41
41
var opts = Opts {
42
42
Timeout : 5 * time .Second ,
43
- User : "test" ,
44
- Pass : "test" ,
43
+ }
44
+ var dialer = TtDialer {
45
+ Address : server ,
46
+ User : "test" ,
47
+ Password : "test" ,
45
48
}
46
49
47
50
var spaceTuple1 = "testDatetime_1"
@@ -364,7 +367,7 @@ func TestDatetimeInterval(t *testing.T) {
364
367
func TestDatetimeTarantoolInterval (t * testing.T ) {
365
368
skipIfDatetimeUnsupported (t )
366
369
367
- conn := test_helpers .ConnectWithValidation (t , server , opts )
370
+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
368
371
defer conn .Close ()
369
372
370
373
dates := []string {
@@ -504,7 +507,7 @@ func TestInvalidOffset(t *testing.T) {
504
507
t .Fatalf ("Unexpected success: %v" , dt )
505
508
}
506
509
if testcase .ok && isDatetimeSupported {
507
- conn := test_helpers .ConnectWithValidation (t , server , opts )
510
+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
508
511
defer conn .Close ()
509
512
510
513
tupleInsertSelectDelete (t , conn , tm )
@@ -516,7 +519,7 @@ func TestInvalidOffset(t *testing.T) {
516
519
func TestCustomTimezone (t * testing.T ) {
517
520
skipIfDatetimeUnsupported (t )
518
521
519
- conn := test_helpers .ConnectWithValidation (t , server , opts )
522
+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
520
523
defer conn .Close ()
521
524
522
525
customZone := "Europe/Moscow"
@@ -676,7 +679,7 @@ var datetimeSample = []struct {
676
679
func TestDatetimeInsertSelectDelete (t * testing.T ) {
677
680
skipIfDatetimeUnsupported (t )
678
681
679
- conn := test_helpers .ConnectWithValidation (t , server , opts )
682
+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
680
683
defer conn .Close ()
681
684
682
685
for _ , testcase := range datetimeSample {
@@ -705,7 +708,7 @@ func TestDatetimeInsertSelectDelete(t *testing.T) {
705
708
func TestDatetimeBoundaryRange (t * testing.T ) {
706
709
skipIfDatetimeUnsupported (t )
707
710
708
- conn := test_helpers .ConnectWithValidation (t , server , opts )
711
+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
709
712
defer conn .Close ()
710
713
711
714
for _ , tm := range append (lesserBoundaryTimes , boundaryTimes ... ) {
@@ -731,7 +734,7 @@ func TestDatetimeOutOfRange(t *testing.T) {
731
734
func TestDatetimeReplace (t * testing.T ) {
732
735
skipIfDatetimeUnsupported (t )
733
736
734
- conn := test_helpers .ConnectWithValidation (t , server , opts )
737
+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
735
738
defer conn .Close ()
736
739
737
740
tm , err := time .Parse (time .RFC3339 , "2007-01-02T15:04:05Z" )
@@ -896,7 +899,7 @@ func (c *Tuple2) DecodeMsgpack(d *msgpack.Decoder) error {
896
899
func TestCustomEncodeDecodeTuple1 (t * testing.T ) {
897
900
skipIfDatetimeUnsupported (t )
898
901
899
- conn := test_helpers .ConnectWithValidation (t , server , opts )
902
+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
900
903
defer conn .Close ()
901
904
902
905
tm1 , _ := time .Parse (time .RFC3339 , "2010-05-24T17:51:56.000000009Z" )
@@ -966,7 +969,7 @@ func TestCustomEncodeDecodeTuple1(t *testing.T) {
966
969
func TestCustomDecodeFunction (t * testing.T ) {
967
970
skipIfDatetimeUnsupported (t )
968
971
969
- conn := test_helpers .ConnectWithValidation (t , server , opts )
972
+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
970
973
defer conn .Close ()
971
974
972
975
// Call function 'call_datetime_testdata' returning a custom tuples.
@@ -1010,7 +1013,7 @@ func TestCustomDecodeFunction(t *testing.T) {
1010
1013
func TestCustomEncodeDecodeTuple5 (t * testing.T ) {
1011
1014
skipIfDatetimeUnsupported (t )
1012
1015
1013
- conn := test_helpers .ConnectWithValidation (t , server , opts )
1016
+ conn := test_helpers .ConnectWithValidation (t , dialer , opts )
1014
1017
defer conn .Close ()
1015
1018
1016
1019
tm := time .Unix (500 , 1000 ).In (time .FixedZone (NoTimezone , 0 ))
@@ -1168,12 +1171,10 @@ func runTestMain(m *testing.M) int {
1168
1171
instance , err := test_helpers .StartTarantool (test_helpers.StartOpts {
1169
1172
InitScript : "config.lua" ,
1170
1173
Listen : server ,
1171
- User : opts .User ,
1172
- Pass : opts .Pass ,
1173
1174
WaitStart : 100 * time .Millisecond ,
1174
1175
ConnectRetry : 10 ,
1175
1176
RetryTimeout : 500 * time .Millisecond ,
1176
- })
1177
+ }, dialer )
1177
1178
defer test_helpers .StopTarantoolWithCleanup (instance )
1178
1179
1179
1180
if err != nil {
0 commit comments