mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Added test to for Cloudwatch EC2 tag selection
This commit is contained in:
parent
525da95f49
commit
f0169656ba
@ -318,4 +318,38 @@ describe('CloudWatchDatasource', function() {
|
||||
expect(scenario.request.data.action).to.be('ListMetrics');
|
||||
});
|
||||
});
|
||||
|
||||
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