Skip to content

Commit

Permalink
Merge 88bcc17 into 7605268
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleDi committed Mar 7, 2020
2 parents 7605268 + 88bcc17 commit 9d73d80
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ go:
- '1.10'
- '1.11'
- '1.12'
- '1.13'
- '1.14'

services:
- docker

before_install:
- travis_retry docker pull yandex/clickhouse-server
- travis_retry docker pull yandex/clickhouse-server:19.16.14.65
- make up_docker_server
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

install:
- make init
- travis_retry go get -v github.com/mattn/goveralls/...
- make init

before_script:
- export TEST_CLICKHOUSE_DSN="http://localhost:8123/default"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ init:
go install ./vendor/...

up_docker_server: stop_docker_server
docker run --rm=true -p 127.0.0.1:8123:8123 --name dbr-clickhouse-server -d yandex/clickhouse-server;
docker run --rm=true -p 127.0.0.1:8123:8123 --name dbr-clickhouse-server -d yandex/clickhouse-server:19.16.14.65;

stop_docker_server:
test -n "$$(docker ps --format {{.Names}} | grep dbr-clickhouse-server)" && docker stop dbr-clickhouse-server || true
Expand Down
5 changes: 5 additions & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ func parseDSNParams(cfg *Config, params map[string][]string) (err error) {

func ensureHavePort(addr string) string {
if _, _, err := net.SplitHostPort(addr); err != nil {
// we get the missing port error here
if addr[0] == '[' && addr[len(addr)-1] == ']' {
// ipv6 brackets
addr = addr[1 : len(addr)-1]
}
return net.JoinHostPort(addr, "8123")
}
return addr
Expand Down
2 changes: 1 addition & 1 deletion config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestDefaultPort(t *testing.T) {
out string
}{
{"http://localhost/test", "http://localhost:8123/test"},
{"http://de:ad:be:ef::ca:fe/test", "http://[de:ad:be:ef::ca:fe]:8123/test"},
{"http://[de:ad:be:ef::ca:fe]/test", "http://[de:ad:be:ef::ca:fe]:8123/test"},
}
var (
cfg *Config
Expand Down

0 comments on commit 9d73d80

Please sign in to comment.