Skip to content

Commit

Permalink
PMM-7961 Updated expoter_shared version (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
percona-csalguero authored Jun 29, 2021
1 parent 9279e96 commit 3e06a84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 3 additions & 7 deletions cmd/postgres_exporter/postgres_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ import (
// Hook up gocheck into the "go test" runner.
func Test(t *testing.T) { TestingT(t) }

type FunctionalSuite struct {
}
type FunctionalSuite struct{}

var _ = Suite(&FunctionalSuite{})

func (s *FunctionalSuite) SetUpSuite(c *C) {

}

func (s *FunctionalSuite) TestSemanticVersionColumnDiscard(c *C) {
Expand Down Expand Up @@ -111,7 +109,7 @@ func (s *FunctionalSuite) TestEnvironmentSettingWithSecretsFiles(c *C) {
c.Assert(err, IsNil)
defer UnsetEnvironment(c, "DATA_SOURCE_URI")

var expected = "postgresql://custom_username$&+,%2F%3A;=%3F%40:custom_password$&+,%2F%3A;=%3F%40@localhost:5432/?sslmode=disable"
expected := "postgresql://custom_username$&+,%2F%3A;=%3F%40:custom_password$&+,%2F%3A;=%3F%40@localhost:5432/?sslmode=disable"

dsn := getDataSources()
if len(dsn) == 0 {
Expand Down Expand Up @@ -165,7 +163,7 @@ func (s *FunctionalSuite) TestEnvironmentSettingWithDnsAndSecrets(c *C) {
// test DSN including SSL enabled
func (s *FunctionalSuite) TestSSL(c *C) {
// Thr driver doesn't support sslmode=prefer
envDsn := "postgresql://root:root@localhost:5433/?sslmode=require"
envDsn := "host=127.0.0.1 port=5433 user=root password=root database=postgres sslmode=require"
err := os.Setenv("DATA_SOURCE_NAME", envDsn)
c.Assert(err, IsNil)
defer UnsetEnvironment(c, "DATA_SOURCE_NAME")
Expand Down Expand Up @@ -196,7 +194,6 @@ func (s *FunctionalSuite) TestSSL(c *C) {

db, err := sql.Open("postgres", dsn[0])
c.Assert(err, IsNil)
//v95 := semver.MustParse("9.5.0")
version, err := postgresVersion(db)
c.Assert(err, IsNil)
if version < 90500 {
Expand Down Expand Up @@ -328,7 +325,6 @@ func UnsetEnvironment(c *C, d string) {

// test boolean metric type gets converted to float
func (s *FunctionalSuite) TestBooleanConversionToValueAndString(c *C) {

type TestCase struct {
input interface{}
expectedString string
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/lib/pq v1.9.0
github.com/percona/exporter_shared v0.7.2
github.com/percona/exporter_shared v0.7.3
github.com/percona/postgres_exporter v0.4.6 // indirect
github.com/prometheus/client_golang v1.10.0
github.com/prometheus/client_model v0.2.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FI
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/percona/exporter_shared v0.7.2 h1:8eNBht83bgFagdiIm3b4HbsOFc5du6OUBCUVenTumdw=
github.com/percona/exporter_shared v0.7.2/go.mod h1:AWk9lgTPzI7tC5PzpeBGvhhqjSJNxpPNFaF7qLIJqmo=
github.com/percona/exporter_shared v0.7.3 h1:TX4LisZ08jo8KIlekBTwPX13JlM6gOOKgmwg7QEf+r8=
github.com/percona/exporter_shared v0.7.3/go.mod h1:AWk9lgTPzI7tC5PzpeBGvhhqjSJNxpPNFaF7qLIJqmo=
github.com/percona/postgres_exporter v0.4.6 h1:/x0qAgP7fzmle/MS3sPKt+3FW94amnUqTJtlibgGNSk=
github.com/percona/postgres_exporter v0.4.6/go.mod h1:n1QU5O3iehITC/jEOGg1G0U/yKalDDmQVrELcjDMafw=
github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac=
Expand Down

0 comments on commit 3e06a84

Please sign in to comment.