Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions inventory/agents_rds_exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ func TestRDSExporter(t *testing.T) {
CustomLabels: map[string]string{
"custom_label_rds_exporter": "rds_exporter",
},

SkipConnectionCheck: true,
SkipConnectionCheck: true,
DisableBasicMetrics: true,
DisableEnhancedMetrics: true,
})
agentID := rdsExporter.RDSExporter.AgentID
defer pmmapitests.RemoveAgents(t, agentID)
Expand All @@ -45,6 +46,7 @@ func TestRDSExporter(t *testing.T) {
Context: pmmapitests.Context,
})
require.NoError(t, err)

assert.Equal(t, &agents.GetAgentOK{
Payload: &agents.GetAgentOKBody{
RDSExporter: &agents.GetAgentOKBodyRDSExporter{
Expand All @@ -54,6 +56,8 @@ func TestRDSExporter(t *testing.T) {
CustomLabels: map[string]string{
"custom_label_rds_exporter": "rds_exporter",
},
BasicMetricsDisabled: true,
EnhancedMetricsDisabled: true,
},
},
}, getAgentRes)
Expand All @@ -73,10 +77,12 @@ func TestRDSExporter(t *testing.T) {
assert.Equal(t, &agents.ChangeRDSExporterOK{
Payload: &agents.ChangeRDSExporterOKBody{
RDSExporter: &agents.ChangeRDSExporterOKBodyRDSExporter{
NodeID: nodeID,
AgentID: agentID,
PMMAgentID: pmmAgentID,
Disabled: true,
NodeID: nodeID,
AgentID: agentID,
PMMAgentID: pmmAgentID,
Disabled: true,
BasicMetricsDisabled: true,
EnhancedMetricsDisabled: true,
},
},
}, changeRDSExporterOK)
Expand Down Expand Up @@ -104,6 +110,8 @@ func TestRDSExporter(t *testing.T) {
CustomLabels: map[string]string{
"new_label": "rds_exporter",
},
BasicMetricsDisabled: true,
EnhancedMetricsDisabled: true,
},
},
}, changeRDSExporterOK)
Expand Down
5 changes: 5 additions & 0 deletions management/rds_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func TestAddRds(t *testing.T) {
TLSSkipVerify: false,
DisableQueryExamples: false,
TablestatsGroupTableLimit: 2000,
DisableBasicMetrics: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add check that this fields are set correctly and add it for inventory API as well.

DisableEnhancedMetrics: true,
},
Context: pmmapitests.Context,
}
Expand All @@ -76,6 +78,9 @@ func TestAddRds(t *testing.T) {
require.NotNil(t, addRDSOK.Payload)

body := addRDSOK.Payload
assert.True(t, body.RDSExporter.BasicMetricsDisabled)
assert.True(t, body.RDSExporter.EnhancedMetricsDisabled)

pmmapitests.RemoveAgents(t, body.MysqldExporter.AgentID)
pmmapitests.RemoveAgents(t, body.QANMysqlPerfschema.AgentID)
pmmapitests.RemoveAgents(t, body.RDSExporter.AgentID)
Expand Down