Skip to content

Commit 9fde732

Browse files
committed
tests
1 parent f62ad80 commit 9fde732

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

http_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (suite *integrationTestSuite) TestE2ESuccessfulHttpBasicAuthWithTlsProxy()
8787

8888
expected := tableData{
8989
Columns: []column{
90-
{"str_col", "STRING"},
90+
{"str_col", "VARCHAR"},
9191
{"timestamp", "TIMESTAMP"},
9292
},
9393
Dataset: [][]interface{}{

http_sender.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,11 @@ func (s *httpLineSender) detectProtocolVersion(ctx context.Context, conf *lineSe
450450
if err != nil {
451451
return protocolVersionUnset, err
452452
}
453+
if s.user != "" && s.pass != "" {
454+
req.SetBasicAuth(s.user, s.pass)
455+
} else if s.token != "" {
456+
req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", s.token))
457+
}
453458

454459
reqCtx, cancel := context.WithTimeout(ctx, s.requestTimeout)
455460
defer cancel()

integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ func setupQuestDB0(ctx context.Context, auth ilpAuthType, setupProxy bool) (*que
200200
req = testcontainers.ContainerRequest{
201201
Image: "haproxy:2.6.4",
202202
ExposedPorts: []string{"8443/tcp", "8444/tcp", "8445/tcp", "8888/tcp"},
203-
WaitingFor: wait.ForHTTP("/").WithPort("8888"),
203+
WaitingFor: wait.ForHTTP("/settings").WithPort("8888"),
204204
Networks: []string{uniqueNetworkName},
205205
Mounts: testcontainers.Mounts(testcontainers.ContainerMount{
206206
Source: testcontainers.GenericBindMountSource{

sender_pool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
)
3838

3939
func TestBasicBehavior(t *testing.T) {
40-
p, err := qdb.PoolFromConf("http::addr=localhost:1234")
40+
p, err := qdb.PoolFromConf("http::addr=localhost:1234;protocol_version=2;")
4141
require.NoError(t, err)
4242
ctx := context.Background()
4343

0 commit comments

Comments
 (0)