mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix test
This commit is contained in:
parent
1dcc51adce
commit
ea704306a0
@ -336,24 +336,20 @@ describe('CloudWatchDatasource', function() {
|
|||||||
describeMetricFindQuery('dimension_values(us-east-1,AWS/EC2,CPUUtilization,InstanceId)', scenario => {
|
describeMetricFindQuery('dimension_values(us-east-1,AWS/EC2,CPUUtilization,InstanceId)', scenario => {
|
||||||
scenario.setup(() => {
|
scenario.setup(() => {
|
||||||
scenario.requestResponse = {
|
scenario.requestResponse = {
|
||||||
Metrics: [
|
results: {
|
||||||
{
|
metricFindQuery: {
|
||||||
Namespace: 'AWS/EC2',
|
tables: [
|
||||||
MetricName: 'CPUUtilization',
|
{ rows: [['i-12345678', 'i-12345678']] }
|
||||||
Dimensions: [
|
|
||||||
{
|
|
||||||
Name: 'InstanceId',
|
|
||||||
Value: 'i-12345678'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should call __ListMetrics and return result', () => {
|
it('should call __ListMetrics and return result', () => {
|
||||||
expect(scenario.result[0].text).to.be('i-12345678');
|
expect(scenario.result[0].text).to.contain('i-12345678');
|
||||||
expect(scenario.request.data.action).to.be('ListMetrics');
|
expect(scenario.request.queries[0].type).to.be('metricFindQuery');
|
||||||
|
expect(scenario.request.queries[0].subtype).to.be('dimension_values');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -433,38 +429,4 @@ describe('CloudWatchDatasource', function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
describeMetricFindQuery('ec2_instance_attribute(us-east-1, Tags.Name, { "tag:team": [ "sysops" ] })', scenario => {
|
|
||||||
scenario.setup(() => {
|
|
||||||
scenario.requestResponse = {
|
|
||||||
Reservations: [
|
|
||||||
{
|
|
||||||
Instances: [
|
|
||||||
{
|
|
||||||
Tags: [
|
|
||||||
{ Key: 'InstanceId', Value: 'i-123456' },
|
|
||||||
{ Key: 'Name', Value: 'Sysops Dev Server' },
|
|
||||||
{ Key: 'env', Value: 'dev' },
|
|
||||||
{ Key: 'team', Value: 'sysops' }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Tags: [
|
|
||||||
{ Key: 'InstanceId', Value: 'i-789012' },
|
|
||||||
{ Key: 'Name', Value: 'Sysops Staging Server' },
|
|
||||||
{ Key: 'env', Value: 'staging' },
|
|
||||||
{ Key: 'team', Value: 'sysops' }
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return the "Name" tag for each instance', function() {
|
|
||||||
expect(scenario.result[0].text).to.be('Sysops Dev Server');
|
|
||||||
expect(scenario.result[1].text).to.be('Sysops Staging Server');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user