Skip to content

Commit f486bab

Browse files
committed
refactor: simplify protocol version handling in integration tests
1 parent 6c3459f commit f486bab

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

integration_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,13 +545,11 @@ func (suite *integrationTestSuite) TestE2EValidWrites() {
545545
questdbC, err := setupQuestDB(ctx, noAuth)
546546
assert.NoError(t, err)
547547

548-
currentVersion := pVersion
549548
switch protocol {
550549
case "tcp":
551550
switch pVersion {
552551
case 0:
553552
sender, err = qdb.NewLineSender(ctx, qdb.WithTcp(), qdb.WithAddress(questdbC.ilpAddress))
554-
currentVersion = 1
555553
case 1:
556554
sender, err = qdb.NewLineSender(ctx, qdb.WithTcp(), qdb.WithAddress(questdbC.ilpAddress), qdb.WithProtocolVersion(qdb.ProtocolVersion1))
557555
case 2:
@@ -564,7 +562,6 @@ func (suite *integrationTestSuite) TestE2EValidWrites() {
564562
switch pVersion {
565563
case 0:
566564
sender, err = qdb.NewLineSender(ctx, qdb.WithHttp(), qdb.WithAddress(questdbC.httpAddress))
567-
currentVersion = 3
568565
case 1:
569566
sender, err = qdb.NewLineSender(ctx, qdb.WithHttp(), qdb.WithAddress(questdbC.httpAddress), qdb.WithProtocolVersion(qdb.ProtocolVersion1))
570567
case 2:
@@ -576,10 +573,11 @@ func (suite *integrationTestSuite) TestE2EValidWrites() {
576573
default:
577574
panic(protocol)
578575
}
579-
if currentVersion < 2 && tc.name == "double array" {
576+
senderVersion := qdb.ProtocolVersion(sender)
577+
if senderVersion < 2 && tc.name == "double array" {
580578
return
581579
}
582-
if currentVersion < 3 && strings.Contains(tc.name, "decimal") {
580+
if senderVersion < 3 && strings.Contains(tc.name, "decimal") {
583581
return
584582
}
585583

0 commit comments

Comments
 (0)