Skip to content
This repository was archived by the owner on Aug 19, 2021. It is now read-only.

Commit 3ce5149

Browse files
authored
PMM-4145 Add simple test disable RDS metrics collection. (#84)
* PMM-4145 Add simple test disable RDS metrics collection. * PMM-4145 Improve tests.
1 parent 0464f0a commit 3ce5149

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

inventory/agents_rds_exporter_test.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ func TestRDSExporter(t *testing.T) {
3434
CustomLabels: map[string]string{
3535
"custom_label_rds_exporter": "rds_exporter",
3636
},
37-
38-
SkipConnectionCheck: true,
37+
SkipConnectionCheck: true,
38+
DisableBasicMetrics: true,
39+
DisableEnhancedMetrics: true,
3940
})
4041
agentID := rdsExporter.RDSExporter.AgentID
4142
defer pmmapitests.RemoveAgents(t, agentID)
@@ -45,6 +46,7 @@ func TestRDSExporter(t *testing.T) {
4546
Context: pmmapitests.Context,
4647
})
4748
require.NoError(t, err)
49+
4850
assert.Equal(t, &agents.GetAgentOK{
4951
Payload: &agents.GetAgentOKBody{
5052
RDSExporter: &agents.GetAgentOKBodyRDSExporter{
@@ -54,6 +56,8 @@ func TestRDSExporter(t *testing.T) {
5456
CustomLabels: map[string]string{
5557
"custom_label_rds_exporter": "rds_exporter",
5658
},
59+
BasicMetricsDisabled: true,
60+
EnhancedMetricsDisabled: true,
5761
},
5862
},
5963
}, getAgentRes)
@@ -73,10 +77,12 @@ func TestRDSExporter(t *testing.T) {
7377
assert.Equal(t, &agents.ChangeRDSExporterOK{
7478
Payload: &agents.ChangeRDSExporterOKBody{
7579
RDSExporter: &agents.ChangeRDSExporterOKBodyRDSExporter{
76-
NodeID: nodeID,
77-
AgentID: agentID,
78-
PMMAgentID: pmmAgentID,
79-
Disabled: true,
80+
NodeID: nodeID,
81+
AgentID: agentID,
82+
PMMAgentID: pmmAgentID,
83+
Disabled: true,
84+
BasicMetricsDisabled: true,
85+
EnhancedMetricsDisabled: true,
8086
},
8187
},
8288
}, changeRDSExporterOK)
@@ -104,6 +110,8 @@ func TestRDSExporter(t *testing.T) {
104110
CustomLabels: map[string]string{
105111
"new_label": "rds_exporter",
106112
},
113+
BasicMetricsDisabled: true,
114+
EnhancedMetricsDisabled: true,
107115
},
108116
},
109117
}, changeRDSExporterOK)

management/rds_test.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ func TestAddRds(t *testing.T) {
6868
TLSSkipVerify: false,
6969
DisableQueryExamples: false,
7070
TablestatsGroupTableLimit: 2000,
71+
DisableBasicMetrics: true,
72+
DisableEnhancedMetrics: true,
7173
},
7274
Context: pmmapitests.Context,
7375
}
@@ -76,6 +78,9 @@ func TestAddRds(t *testing.T) {
7678
require.NotNil(t, addRDSOK.Payload)
7779

7880
body := addRDSOK.Payload
81+
assert.True(t, body.RDSExporter.BasicMetricsDisabled)
82+
assert.True(t, body.RDSExporter.EnhancedMetricsDisabled)
83+
7984
pmmapitests.RemoveAgents(t, body.MysqldExporter.AgentID)
8085
pmmapitests.RemoveAgents(t, body.QANMysqlPerfschema.AgentID)
8186
pmmapitests.RemoveAgents(t, body.RDSExporter.AgentID)

0 commit comments

Comments
 (0)