Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
sync with updated pmm
Browse files Browse the repository at this point in the history
  • Loading branch information
idoqo committed Mar 21, 2022
1 parent 04c5cb0 commit 8c65d66
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 27 deletions.
2 changes: 1 addition & 1 deletion api-tests/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func AssertAPIErrorf(t TestingT, actual error, httpStatus int, grpcCode codes.Co
if len(a) != 0 {
format = fmt.Sprintf(format, a...)
}
assert.Equal(t, format, errorField.String())
assert.Contains(t, errorField.String(), format)
}

func ExpectFailure(t *testing.T, link string) *expectedFailureTestingT {
Expand Down
4 changes: 2 additions & 2 deletions api-tests/server/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func TestSetup(t *testing.T) {
"swagger/": 301,

"v1/readyz": 200,
"v1/AWSInstanceCheck": 405, // only POST is expected
"v1/AWSInstanceCheck": 501, // only POST is expected and other request methods are seen as unimplemented
"v1/version": 401, // Grafana authentication required
}
for path, code := range paths {
Expand Down Expand Up @@ -173,7 +173,7 @@ func TestSetup(t *testing.T) {

resp, b := doRequest(t, client, req)
assert.Equal(t, 200, resp.StatusCode, "response:\n%s", b)
assert.Equal(t, "{\n\n}", string(b), "response:\n%s", b)
assert.Equal(t, "{}", string(b), "response:\n%s", b)
})
}

Expand Down
2 changes: 1 addition & 1 deletion api-tests/server/checks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func TestChangeSecurityChecks(t *testing.T) {
}

_, err = managementClient.Default.SecurityChecks.ChangeSecurityChecks(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "unknown value \"\\\"unknown_interval\\\"\" for enum management.SecurityCheckInterval")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, `invalid value for enum type: "unknown_interval"`)

resp, err = managementClient.Default.SecurityChecks.ListSecurityChecks(nil)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion api-tests/server/readyz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func TestReadyz(t *testing.T) {
b, err := ioutil.ReadAll(resp.Body)
require.NoError(t, err)
assert.Equal(t, 200, resp.StatusCode, "response:\n%s", b)
assert.Equal(t, "{\n\n}", string(b))
assert.Equal(t, "{}", string(b))
})
}
}
20 changes: 10 additions & 10 deletions api-tests/server/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ func TestSettings(t *testing.T) {
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument,
`bad Duration: time: missing unit in duration "1"`)
`invalid google.protobuf.Duration value "1"`)
assert.Empty(t, res)
})

Expand Down Expand Up @@ -606,7 +606,7 @@ func TestSettings(t *testing.T) {
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument,
`bad Duration: time: missing unit in duration "1"`)
`invalid google.protobuf.Duration value "1"`)
assert.Empty(t, res)
})

Expand Down Expand Up @@ -652,7 +652,7 @@ func TestSettings(t *testing.T) {
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument,
`bad Duration: time: missing unit in duration "1"`)
`invalid google.protobuf.Duration value "1"`)
assert.Empty(t, res)
})

Expand Down Expand Up @@ -680,7 +680,7 @@ func TestSettings(t *testing.T) {
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument,
`Invalid argument: data_retention: should be a natural number of days.`)
`invalid google.protobuf.Duration value "36h"`)
assert.Empty(t, res)
})

Expand Down Expand Up @@ -724,9 +724,9 @@ func TestSettings(t *testing.T) {
MetricsResolutions: &server.ChangeSettingsParamsBodyMetricsResolutions{
Hr: "2s",
Mr: "15s",
Lr: "2m",
Lr: "120s",
},
DataRetention: "240h",
DataRetention: "864000s", // 240h
AWSPartitions: []string{"aws-cn", "aws", "aws-cn"}, // duplicates are ok
},
Context: pmmapitests.Context,
Expand Down Expand Up @@ -791,8 +791,8 @@ func TestSettings(t *testing.T) {
res, err := serverClient.Default.Server.ChangeSettings(&server.ChangeSettingsParams{
Body: server.ChangeSettingsBody{
SttCheckIntervals: &server.ChangeSettingsParamsBodySttCheckIntervals{
RareInterval: "8h",
StandardInterval: "30m",
RareInterval: "28800s", // 8h
StandardInterval: "1800s", // 30m
FrequentInterval: "20s",
},
},
Expand Down Expand Up @@ -957,8 +957,8 @@ groups:
"60s": "60s",
"61s": "61s",
"61": "", // no suffix => error
"2m": "120s",
"1h": "3600s",
"2m": "", // m suffix => error
"1h": "", // h suffix => error
"1d": "", // d suffix => error
"1w": "", // w suffix => error
} {
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
github.com/minio/minio-go/v7 v7.0.23
github.com/percona-platform/dbaas-api v0.0.0-20220110092915-5aacd784d472
github.com/percona-platform/saas v0.0.0-20220317155708-e7f0cb2ec37f
github.com/percona/pmm v0.0.0-20220318094121-37f33aa12a72
github.com/percona/pmm v0.0.0-20220321064814-692cfc95e2e9
github.com/percona/promconfig v0.2.4-0.20211110115058-98687f586f54
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.0
Expand Down Expand Up @@ -90,7 +90,6 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-msgpack v1.1.5 // indirect
Expand Down
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,8 @@ github.com/percona-platform/dbaas-api v0.0.0-20220110092915-5aacd784d472 h1:Henk
github.com/percona-platform/dbaas-api v0.0.0-20220110092915-5aacd784d472/go.mod h1:WZZ3Hi+lAWCaGWmsrfkkvRQPkIa8n1OZ0s8Su+vbgus=
github.com/percona-platform/saas v0.0.0-20220317155708-e7f0cb2ec37f h1:yQmj2OdE1hhZ6W3YUyu3uywokveAE/63AoxBu7VcxqM=
github.com/percona-platform/saas v0.0.0-20220317155708-e7f0cb2ec37f/go.mod h1:gFUwaFp6Ugu5qsBwiOVJYbDlzgZ77tmXdXGO7tG5xVI=
github.com/percona/pmm v0.0.0-20220318094121-37f33aa12a72 h1:Gf8U98bMvygwqOumglxxNlWY3I5s050H0iw2M/A4uyA=
github.com/percona/pmm v0.0.0-20220318094121-37f33aa12a72/go.mod h1:aQ4+fUKcsA1e2HLaOB1oBZjqyhNkNOZqucRJMZvkBJQ=
github.com/percona/pmm v0.0.0-20220321064814-692cfc95e2e9 h1:kLn3GEY84qkepoom319p3WqYCkfxPBrbRmkUZ0R+30U=
github.com/percona/pmm v0.0.0-20220321064814-692cfc95e2e9/go.mod h1:aVzCM4/mvtGRSJE1QAM1TaWCOESx7Wsw8TgXJtxkKbk=
github.com/percona/promconfig v0.2.1/go.mod h1:Y2uXi5QNk71+ceJHuI9poank+0S1kjxd3K105fXKVkg=
github.com/percona/promconfig v0.2.4-0.20211110115058-98687f586f54 h1:aI1emmycDTGWKsBdxFPKZqohfBbK4y2ta9G4+RX7gVg=
github.com/percona/promconfig v0.2.4-0.20211110115058-98687f586f54/go.mod h1:Y2uXi5QNk71+ceJHuI9poank+0S1kjxd3K105fXKVkg=
Expand All @@ -673,7 +673,6 @@ github.com/prometheus/alertmanager v0.23.0/go.mod h1:0MLTrjQI8EuVmvykEhcfr/7X0xm
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=
github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og=
github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M=
Expand All @@ -691,7 +690,6 @@ github.com/prometheus/client_model v0.2.1-0.20200623203004-60555c9708c7 h1:NkLt0
github.com/prometheus/client_model v0.2.1-0.20200623203004-60555c9708c7/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc=
github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA=
github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
Expand All @@ -707,7 +705,6 @@ github.com/prometheus/exporter-toolkit v0.6.1/go.mod h1:ZUBIj498ePooX9t/2xtDjeQY
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ=
github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
Expand Down Expand Up @@ -989,7 +986,6 @@ golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down
4 changes: 0 additions & 4 deletions services/platform/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ type Service struct {
platformpb.UnimplementedPlatformServer
}

func (s *Service) SearchOrganizationEntitlements(ctx context.Context, request *platformpb.SearchOrganizationEntitlementsRequest) (*platformpb.SearchOrganizationEntitlementsResponse, error) {
panic("implement me")
}

type grafanaClient interface {
GetCurrentUserAccessToken(ctx context.Context) (string, error)
}
Expand Down

0 comments on commit 8c65d66

Please sign in to comment.