Skip to content

Commit

Permalink
PMM-12811 fix API tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Jan 19, 2024
1 parent 602045c commit 2f48f8f
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion api-tests/inventory/agents_azure_database_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func TestAzureDatabaseExporter(t *testing.T) { //nolint:tparallel
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddDatabaseExporterRequest.NodeId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAzureDatabaseExporterParams.NodeId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveNodes(t, res.Payload.AzureDatabaseExporter.AgentID)
}
Expand Down
4 changes: 2 additions & 2 deletions api-tests/inventory/agents_external_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func TestExternalExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.ListenPort: value must be inside range (0, 65536)")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddExternalExporterParams.ListenPort: value must be inside range (0, 65536)")
if !assert.Nil(t, res) {
pmmapitests.RemoveNodes(t, res.Payload.ExternalExporter.AgentID)
}
Expand Down Expand Up @@ -282,7 +282,7 @@ func TestExternalExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.RunsOnNodeId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddExternalExporterParams.RunsOnNodeId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.ExternalExporter.AgentID)
}
Expand Down
4 changes: 2 additions & 2 deletions api-tests/inventory/agents_mongodb_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func TestMongoDBExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.ServiceId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMongoDBExporterParams.ServiceId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.MongodbExporter.AgentID)
}
Expand Down Expand Up @@ -219,7 +219,7 @@ func TestMongoDBExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMongoDBExporterParams.PmmAgentId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.MongodbExporter.AgentID)
}
Expand Down
4 changes: 2 additions & 2 deletions api-tests/inventory/agents_mysqld_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func TestMySQLdExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.ServiceId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMySQLdExporterParams.ServiceId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveNodes(t, res.Payload.MysqldExporter.AgentID)
}
Expand Down Expand Up @@ -274,7 +274,7 @@ func TestMySQLdExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddMySQLdExporterParams.PmmAgentId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.MysqldExporter.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 @@ -141,7 +141,7 @@ func TestNodeExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddNodeExporterParams.PmmAgentId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveNodes(t, res.Payload.NodeExporter.AgentID)
}
Expand Down
4 changes: 2 additions & 2 deletions api-tests/inventory/agents_postgres_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func TestPostgresExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.ServiceId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddPostgresExporterParams.ServiceId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveNodes(t, res.Payload.PostgresExporter.AgentID)
}
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestPostgresExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddPostgresExporterParams.PmmAgentId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.PostgresExporter.AgentID)
}
Expand Down
4 changes: 2 additions & 2 deletions api-tests/inventory/agents_proxysql_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func TestProxySQLExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.ServiceId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddProxySQLExporterParams.ServiceId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveNodes(t, res.Payload.ProxysqlExporter.AgentID)
}
Expand Down Expand Up @@ -216,7 +216,7 @@ func TestProxySQLExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddProxySQLExporterParams.PmmAgentId: value length must be at least 1 runes")
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 @@ -167,7 +167,7 @@ func TestRDSExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.NodeId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddRDSExporterParams.NodeId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveNodes(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 @@ -308,7 +308,7 @@ func TestPMMAgent(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.RunsOnNodeId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddPMMAgentParams.RunsOnNodeId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveNodes(t, res.Payload.PMMAgent.AgentID)
}
Expand Down Expand Up @@ -641,7 +641,7 @@ func TestQanAgentExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.ServiceId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddQANMySQLPerfSchemaAgentParams.ServiceId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.QANMysqlPerfschemaAgent.AgentID)
}
Expand Down Expand Up @@ -678,7 +678,7 @@ func TestQanAgentExporter(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddQANMySQLPerfSchemaAgentParams.PmmAgentId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.QANMysqlPerfschemaAgent.AgentID)
}
Expand Down Expand Up @@ -902,7 +902,7 @@ func TestPGStatStatementsQanAgent(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.ServiceId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddQANPostgreSQLPgStatementsAgentParams.ServiceId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.QANPostgresqlPgstatementsAgent.AgentID)
}
Expand Down Expand Up @@ -939,7 +939,7 @@ func TestPGStatStatementsQanAgent(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddQANPostgreSQLPgStatementsAgentRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddQANPostgreSQLPgStatementsAgentParams.PmmAgentId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.QANPostgresqlPgstatementsAgent.AgentID)
}
Expand Down Expand Up @@ -1230,7 +1230,7 @@ func TestPGStatMonitorQanAgent(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.ServiceId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddQANPostgreSQLPgStatMonitorAgentParams.ServiceId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.QANPostgresqlPgstatmonitorAgent.AgentID)
}
Expand Down Expand Up @@ -1267,7 +1267,7 @@ func TestPGStatMonitorQanAgent(t *testing.T) {
},
Context: pmmapitests.Context,
})
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddAgentRequest.PmmAgentId: value length must be at least 1 runes")
pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddQANPostgreSQLPgStatMonitorAgentParams.PmmAgentId: value length must be at least 1 runes")
if !assert.Nil(t, res) {
pmmapitests.RemoveAgents(t, res.Payload.QANPostgresqlPgstatmonitorAgent.AgentID)
}
Expand Down

0 comments on commit 2f48f8f

Please sign in to comment.