Skip to content

Commit

Permalink
PMM-12857 fix API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Jun 28, 2024
1 parent f1d1151 commit c8b2668
Show file tree
Hide file tree
Showing 20 changed files with 168 additions and 77 deletions.
6 changes: 3 additions & 3 deletions api-tests/alerting/alerting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,14 +556,14 @@ func assertTemplate(t *testing.T, expectedTemplate alert.Template, listTemplates
require.NotNil(t, param.Float)
value, err := expectedParam.GetValueForFloat()
require.NoError(t, err)
assert.Equal(t, value, param.Float.Default) //nolint:testifylint
assert.Equal(t, value, *param.Float.Default) //nolint:testifylint
}

if len(expectedParam.Range) != 0 {
min, max, err := expectedParam.GetRangeForFloat()
require.NoError(t, err)
assert.Equal(t, min, param.Float.Min) //nolint:testifylint
assert.Equal(t, max, param.Float.Max) //nolint:testifylint
assert.Equal(t, min, *param.Float.Min) //nolint:testifylint
assert.Equal(t, max, *param.Float.Max) //nolint:testifylint
}

assert.Nil(t, param.Bool)
Expand Down
16 changes: 16 additions & 0 deletions api-tests/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,22 @@ func RemoveAgents(t TestingT, agentIDs ...string) {
}
}

// RemoveAgentsWithForce removes specified agents along with dependents.
func RemoveAgentsWithForce(t TestingT, agentIDs ...string) {
t.Helper()

for _, agentID := range agentIDs {
params := &agents.RemoveAgentParams{
AgentID: agentID,
Force: pointer.ToBool(true),
Context: context.Background(),
}
res, err := client.Default.AgentsService.RemoveAgent(params)
require.NoError(t, err)
assert.NotNil(t, res)
}
}

// AddGenericNode adds a generic node.
func AddGenericNode(t TestingT, nodeName string) *nodes.AddNodeOKBodyGeneric {
t.Helper()
Expand Down
26 changes: 11 additions & 15 deletions api-tests/inventory/agents_azure_database_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func TestAzureDatabaseExporter(t *testing.T) { //nolint:tparallel
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID \"pmm-not-exist-server\" not found.")
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID pmm-not-exist-server not found.")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.AzureDatabaseExporter.AgentID)
}
Expand Down Expand Up @@ -252,21 +252,17 @@ func TestAzureDatabaseExporter(t *testing.T) { //nolint:tparallel
})
require.NoError(t, err)

assert.Equal(t, &agents.GetAgentOK{
Payload: &agents.GetAgentOKBody{
AzureDatabaseExporter: &agents.GetAgentOKBodyAzureDatabaseExporter{
NodeID: nodeID,
AgentID: agentID,
PMMAgentID: pmmAgentID,
AzureDatabaseSubscriptionID: "azure_subscription_id",
CustomLabels: map[string]string{
"custom_label_azure_database_exporter": "azure_database_exporter",
},
Status: &AgentStatusUnknown,
LogLevel: pointer.ToString("LOG_LEVEL_UNSPECIFIED"),
},
assert.Equal(t, &agents.GetAgentOKBodyAzureDatabaseExporter{
NodeID: nodeID,
AgentID: agentID,
PMMAgentID: pmmAgentID,
AzureDatabaseSubscriptionID: "azure_subscription_id",
CustomLabels: map[string]string{
"custom_label_azure_database_exporter": "azure_database_exporter",
},
}, getAgentRes)
Status: &AgentStatusUnknown,
LogLevel: pointer.ToString("LOG_LEVEL_UNSPECIFIED"),
}, getAgentRes.Payload.AzureDatabaseExporter)

// Test change API.
changeAzureDatabaseExporterOK, err := client.Default.AgentsService.ChangeAgent(
Expand Down
2 changes: 1 addition & 1 deletion api-tests/inventory/agents_mongodb_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func TestMongoDBExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID \"pmm-not-exist-server\" not found.")
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID pmm-not-exist-server not found.")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.MongodbExporter.AgentID)
}
Expand Down
2 changes: 1 addition & 1 deletion api-tests/inventory/agents_node_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func TestNodeExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID \"pmm-node-exporter-node\" not found.")
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID pmm-node-exporter-node not found.")
if !assert.Nil(t, res) {
pmmapitests.RemoveNodes(t, res.Payload.NodeExporter.AgentID)
}
Expand Down
2 changes: 1 addition & 1 deletion api-tests/inventory/agents_postgres_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func TestPostgresExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID \"pmm-not-exist-server\" not found.")
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID pmm-not-exist-server not found.")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.PostgresExporter.AgentID)
}
Expand Down
2 changes: 1 addition & 1 deletion api-tests/inventory/agents_proxysql_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ func TestProxySQLExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID \"pmm-not-exist-server\" not found.")
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID pmm-not-exist-server not found.")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.ProxysqlExporter.AgentID)
}
Expand Down
2 changes: 1 addition & 1 deletion api-tests/inventory/agents_rds_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func TestRDSExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID \"pmm-not-exist-server\" not found.")
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID pmm-not-exist-server not found.")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.RDSExporter.AgentID)
}
Expand Down
14 changes: 7 additions & 7 deletions api-tests/inventory/agents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,14 +423,14 @@ func TestPMMAgent(t *testing.T) {
AgentID: pmmAgentID,
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID %q not found.", pmmAgentID)
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID %s not found.", pmmAgentID)
assert.Nil(t, getAgentRes)

listAgentsOK, err = client.Default.AgentsService.ListAgents(&agents.ListAgentsParams{
PMMAgentID: pointer.ToString(pmmAgentID),
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID %q not found.", pmmAgentID)
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID %s not found.", pmmAgentID)
assert.Nil(t, listAgentsOK)
})

Expand All @@ -444,7 +444,7 @@ func TestPMMAgent(t *testing.T) {
}
res, err := client.Default.AgentsService.RemoveAgent(params)
assert.Nil(t, res)
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, `Agent with ID %q not found.`, agentID)
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, `Agent with ID %s not found.`, agentID)
})

t.Run("Remove with empty params", func(t *testing.T) {
Expand Down Expand Up @@ -722,7 +722,7 @@ func TestQanAgentExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID \"pmm-not-exist-server\" not found.")
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID pmm-not-exist-server not found.")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.QANMysqlPerfschemaAgent.AgentID)
}
Expand Down Expand Up @@ -981,7 +981,7 @@ func TestPGStatStatementsQanAgent(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID \"pmm-not-exist-server\" not found.")
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID pmm-not-exist-server not found.")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.QANPostgresqlPgstatementsAgent.AgentID)
}
Expand Down Expand Up @@ -1306,7 +1306,7 @@ func TestPGStatMonitorQanAgent(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID \"pmm-not-exist-server\" not found.")
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Agent with ID pmm-not-exist-server not found.")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.QANPostgresqlPgstatmonitorAgent.AgentID)
}
Expand Down Expand Up @@ -1357,7 +1357,7 @@ func TestMetricsResolutionsChange(t *testing.T) {
})
require.NoError(t, err)
agentID := res.Payload.PostgresExporter.AgentID
defer pmmapitests.RemoveAgents(t, agentID)
defer pmmapitests.RemoveAgentsWithForce(t, agentID)

getAgentRes, err := client.Default.AgentsService.GetAgent(
&agents.GetAgentParams{
Expand Down
4 changes: 2 additions & 2 deletions api-tests/management/external_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ func TestAddExternal(t *testing.T) {
},
}
addExternalOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddExternalRequest.ServiceName: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddExternalServiceParams.ServiceName: value length must be at least 1 runes")
assert.Nil(t, addExternalOK)
})

Expand All @@ -335,7 +335,7 @@ func TestAddExternal(t *testing.T) {
},
}
addExternalOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddExternalRequest.ListenPort: value must be inside range (0, 65536)")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddExternalServiceParams.ListenPort: value must be inside range (0, 65536)")
assert.Nil(t, addExternalOK)
})

Expand Down
4 changes: 2 additions & 2 deletions api-tests/management/haproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func TestAddHAProxy(t *testing.T) {
},
}
addHAProxyOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddHAProxyRequest.ServiceName: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddHAProxyServiceParams.ServiceName: value length must be at least 1 runes")
assert.Nil(t, addHAProxyOK)
})

Expand All @@ -324,7 +324,7 @@ func TestAddHAProxy(t *testing.T) {
},
}
addHAProxyOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddHAProxyRequest.ListenPort: value must be inside range (0, 65536)")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddHAProxyServiceParams.ListenPort: value must be inside range (0, 65536)")
assert.Nil(t, addHAProxyOK)
})

Expand Down
4 changes: 2 additions & 2 deletions api-tests/management/mongodb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func TestAddMongoDB(t *testing.T) {
},
}
addMongoDBOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMongoDBRequest.ServiceName: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMongoDBServiceParams.ServiceName: value length must be at least 1 runes")
assert.Nil(t, addMongoDBOK)
})

Expand Down Expand Up @@ -555,7 +555,7 @@ func TestAddMongoDB(t *testing.T) {
},
}
addMongoDBOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMongoDBRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMongoDBServiceParams.PmmAgentId: value length must be at least 1 runes")
assert.Nil(t, addMongoDBOK)
})

Expand Down
6 changes: 3 additions & 3 deletions api-tests/management/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ func TestAddMySQL(t *testing.T) {
},
}
addMySQLOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMySQLRequest.ServiceName: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMySQLServiceParams.ServiceName: value length must be at least 1 runes")
assert.Nil(t, addMySQLOK)
})

Expand Down Expand Up @@ -618,7 +618,7 @@ func TestAddMySQL(t *testing.T) {
},
}
addMySQLOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMySQLRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMySQLServiceParams.PmmAgentId: value length must be at least 1 runes")
assert.Nil(t, addMySQLOK)
})

Expand All @@ -645,7 +645,7 @@ func TestAddMySQL(t *testing.T) {
},
}
addMySQLOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMySQLRequest.Username: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMySQLServiceParams.Username: value length must be at least 1 runes")
assert.Nil(t, addMySQLOK)
})

Expand Down
4 changes: 2 additions & 2 deletions api-tests/management/postgresql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ func TestAddPostgreSQL(t *testing.T) {
},
}
addPostgreSQLOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddPostgreSQLRequest.ServiceName: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddPostgreSQLServiceParams.ServiceName: value length must be at least 1 runes")
assert.Nil(t, addPostgreSQLOK)
})

Expand Down Expand Up @@ -594,7 +594,7 @@ func TestAddPostgreSQL(t *testing.T) {
},
}
addPostgreSQLOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddPostgreSQLRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddPostgreSQLServiceParams.PmmAgentId: value length must be at least 1 runes")
assert.Nil(t, addPostgreSQLOK)
})

Expand Down
6 changes: 3 additions & 3 deletions api-tests/management/proxysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func TestAddProxySQL(t *testing.T) {
},
}
addProxySQLOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddProxySQLRequest.ServiceName: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddProxySQLServiceParams.ServiceName: value length must be at least 1 runes")
assert.Nil(t, addProxySQLOK)
})

Expand Down Expand Up @@ -581,7 +581,7 @@ func TestAddProxySQL(t *testing.T) {
},
}
addProxySQLOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddProxySQLRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddProxySQLServiceParams.PmmAgentId: value length must be at least 1 runes")
assert.Nil(t, addProxySQLOK)
})

Expand All @@ -608,7 +608,7 @@ func TestAddProxySQL(t *testing.T) {
},
}
addProxySQLOK, err := client.Default.ManagementService.AddService(params)
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddProxySQLRequest.Username: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddProxySQLServiceParams.Username: value length must be at least 1 runes")
assert.Nil(t, addProxySQLOK)
})
}
Expand Down
4 changes: 2 additions & 2 deletions api-tests/management/rds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestAddRds(t *testing.T) {
AgentID: agentID,
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf(`Agent with ID "%s" not found.`, agentID))
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf(`Agent with ID %s not found.`, agentID))

_, err = inventoryClient.Default.NodesService.GetNode(&nodes.GetNodeParams{
NodeID: nodeID,
Expand Down Expand Up @@ -168,7 +168,7 @@ func TestAddRds(t *testing.T) {
AgentID: body.RDS.RDSExporter.AgentID,
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf(`Agent with ID "%s" not found.`, body.RDS.RDSExporter.AgentID))
pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, fmt.Sprintf(`Agent with ID %s not found.`, body.RDS.RDSExporter.AgentID))

_, err = inventoryClient.Default.NodesService.GetNode(&nodes.GetNodeParams{
NodeID: body.RDS.Postgresql.NodeID,
Expand Down
1 change: 1 addition & 0 deletions api-tests/server/logs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func TestDownloadLogs(t *testing.T) {
"victoriametrics_targets.json",
"vmalert.ini",
"vmalert.log",
"vmproxy.ini",
"vmproxy.log",
}

Expand Down
2 changes: 1 addition & 1 deletion api-tests/server/platform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestPlatform(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, http.StatusBadRequest, codes.InvalidArgument, "invalid field ServerName: value '' must not be an empty string")
pmmapitests.AssertAPIErrorf(t, err, http.StatusBadRequest, codes.InvalidArgument, "invalid field ConnectRequest.ServerName: value '' must not be an empty string")
})

t.Run("successful connect and disconnect", func(t *testing.T) {
Expand Down
12 changes: 6 additions & 6 deletions api-tests/server/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ func TestSettings(t *testing.T) {

getRes, err := serverClient.Default.ServerService.GetSettings(nil)
require.NoError(t, err)
getExpected := &server.ChangeSettingsOKBodySettingsAdvisorRunIntervals{
getExpected := &server.GetSettingsOKBodySettingsAdvisorRunIntervals{
RareInterval: "28800s",
StandardInterval: "1800s",
FrequentInterval: "20s",
Expand All @@ -657,7 +657,7 @@ func TestSettings(t *testing.T) {
// Check if the values were persisted
getRes, err := serverClient.Default.ServerService.GetSettings(nil)
require.NoError(t, err)
getExpected := &server.ChangeSettingsOKBodySettingsAdvisorRunIntervals{
getExpected := &server.GetSettingsOKBodySettingsAdvisorRunIntervals{
RareInterval: "28800s",
StandardInterval: "1800s",
FrequentInterval: "20s",
Expand All @@ -679,10 +679,10 @@ func TestSettings(t *testing.T) {
} `json:"settings"`
}
changeURI := pmmapitests.BaseURL.ResolveReference(&url.URL{
Path: "v1/Settings/Change",
Path: "v1/server/settings",
})
getURI := pmmapitests.BaseURL.ResolveReference(&url.URL{
Path: "v1/Settings/Get",
Path: "v1/server/settings",
})

for change, get := range map[string]string{
Expand All @@ -703,7 +703,7 @@ func TestSettings(t *testing.T) {
p.Settings.MetricsResolutions.LR = change
b, err := json.Marshal(p.Settings)
require.NoError(t, err)
req, err := http.NewRequestWithContext(pmmapitests.Context, http.MethodPost, changeURI.String(), bytes.NewReader(b))
req, err := http.NewRequestWithContext(pmmapitests.Context, http.MethodPut, changeURI.String(), bytes.NewReader(b))
require.NoError(t, err)
if pmmapitests.Debug {
b, err = httputil.DumpRequestOut(req, true)
Expand Down Expand Up @@ -733,7 +733,7 @@ func TestSettings(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, get, p.Settings.MetricsResolutions.LR, "Change")

req, err = http.NewRequestWithContext(pmmapitests.Context, http.MethodPost, getURI.String(), nil)
req, err = http.NewRequestWithContext(pmmapitests.Context, http.MethodGet, getURI.String(), nil)
require.NoError(t, err)
if pmmapitests.Debug {
b, err = httputil.DumpRequestOut(req, true)
Expand Down
Loading

0 comments on commit c8b2668

Please sign in to comment.