Commit 657c15f6 authored by Miguel Rincon's avatar Miguel Rincon

Fix broken specs and update changelog

Fix the specs that failed due to generate data being updated.

Added a new change log to match the current merge request.
parent a2f63b39
--- ---
title: Fix CSV downloads for multiple series in the same chart title: Fix CSV downloads for multiple series in the same chart
merge_request: 36556 merge_request: 37377
author: author:
type: fixed type: fixed
...@@ -20,6 +20,17 @@ describe('monitoring export_csv', () => { ...@@ -20,6 +20,17 @@ describe('monitoring export_csv', () => {
expect(graphDataToCsv(data)).toEqual(''); expect(graphDataToCsv(data)).toEqual('');
}); });
it('should return a csv with 1 metric', () => {
const data = timeSeriesGraphData({}, { metricCount: 1 });
expectCsvToMatchLines(graphDataToCsv(data), [
`timestamp,"Y Axis > Metric 1"`,
'2015-07-01T20:10:50.000Z,1',
'2015-07-01T20:12:50.000Z,2',
'2015-07-01T20:14:50.000Z,3',
]);
});
it('should return a csv with multiple metrics and one with no data', () => { it('should return a csv with multiple metrics and one with no data', () => {
const data = timeSeriesGraphData({}, { metricCount: 2 }); const data = timeSeriesGraphData({}, { metricCount: 2 });
...@@ -28,9 +39,9 @@ describe('monitoring export_csv', () => { ...@@ -28,9 +39,9 @@ describe('monitoring export_csv', () => {
expectCsvToMatchLines(graphDataToCsv(data), [ expectCsvToMatchLines(graphDataToCsv(data), [
`timestamp,"Y Axis > Metric 2"`, `timestamp,"Y Axis > Metric 2"`,
'2015-07-01T20:10:51.781Z,1', '2015-07-01T20:10:50.000Z,1',
'2015-07-01T20:11:06.781Z,2', '2015-07-01T20:12:50.000Z,2',
'2015-07-01T20:11:21.781Z,3', '2015-07-01T20:14:50.000Z,3',
]); ]);
}); });
...@@ -45,24 +56,13 @@ describe('monitoring export_csv', () => { ...@@ -45,24 +56,13 @@ describe('monitoring export_csv', () => {
expectCsvToMatchLines(graphDataToCsv(data), [ expectCsvToMatchLines(graphDataToCsv(data), [
`timestamp,"Y Axis > Metric 1","Y Axis > Metric 2","Y Axis > Metric 3"`, `timestamp,"Y Axis > Metric 1","Y Axis > Metric 2","Y Axis > Metric 3"`,
'2015-07-01T20:10:51.781Z,1,1,', '2015-07-01T20:10:50.000Z,1,1,',
'2015-07-01T20:11:06.781Z,2,2,', '2015-07-01T20:12:50.000Z,2,2,',
'2015-07-01T20:11:21.781Z,3,3,', '2015-07-01T20:14:50.000Z,3,3,',
'2016-01-01T00:00:00.000Z,,,9', '2016-01-01T00:00:00.000Z,,,9',
]); ]);
}); });
it('should return a csv with 1 metric', () => {
const data = timeSeriesGraphData({}, { metricCount: 1 });
expectCsvToMatchLines(graphDataToCsv(data), [
`timestamp,"Y Axis > Metric 1"`,
'2015-07-01T20:10:51.781Z,1',
'2015-07-01T20:11:06.781Z,2',
'2015-07-01T20:11:21.781Z,3',
]);
});
it('should escape double quotes in metric labels with two double quotes ("")', () => { it('should escape double quotes in metric labels with two double quotes ("")', () => {
const data = timeSeriesGraphData({}, { metricCount: 1 }); const data = timeSeriesGraphData({}, { metricCount: 1 });
...@@ -70,9 +70,9 @@ describe('monitoring export_csv', () => { ...@@ -70,9 +70,9 @@ describe('monitoring export_csv', () => {
expectCsvToMatchLines(graphDataToCsv(data), [ expectCsvToMatchLines(graphDataToCsv(data), [
`timestamp,"Y Axis > My ""quoted"" metric"`, `timestamp,"Y Axis > My ""quoted"" metric"`,
'2015-07-01T20:10:51.781Z,1', '2015-07-01T20:10:50.000Z,1',
'2015-07-01T20:11:06.781Z,2', '2015-07-01T20:12:50.000Z,2',
'2015-07-01T20:11:21.781Z,3', '2015-07-01T20:14:50.000Z,3',
]); ]);
}); });
...@@ -81,9 +81,9 @@ describe('monitoring export_csv', () => { ...@@ -81,9 +81,9 @@ describe('monitoring export_csv', () => {
expectCsvToMatchLines(graphDataToCsv(data), [ expectCsvToMatchLines(graphDataToCsv(data), [
`timestamp,"Y Axis > Metric 1","Y Axis > Metric 2","Y Axis > Metric 3"`, `timestamp,"Y Axis > Metric 1","Y Axis > Metric 2","Y Axis > Metric 3"`,
'2015-07-01T20:10:51.781Z,1,1,1', '2015-07-01T20:10:50.000Z,1,1,1',
'2015-07-01T20:11:06.781Z,2,2,2', '2015-07-01T20:12:50.000Z,2,2,2',
'2015-07-01T20:11:21.781Z,3,3,3', '2015-07-01T20:14:50.000Z,3,3,3',
]); ]);
}); });
...@@ -92,9 +92,9 @@ describe('monitoring export_csv', () => { ...@@ -92,9 +92,9 @@ describe('monitoring export_csv', () => {
expectCsvToMatchLines(graphDataToCsv(data), [ expectCsvToMatchLines(graphDataToCsv(data), [
`timestamp,"Y Axis > Metric 1","Y Axis > Metric 1"`, `timestamp,"Y Axis > Metric 1","Y Axis > Metric 1"`,
'2015-07-01T20:10:51.781Z,1,4', '2015-07-01T20:10:50.000Z,1,4',
'2015-07-01T20:11:06.781Z,2,5', '2015-07-01T20:12:50.000Z,2,5',
'2015-07-01T20:11:21.781Z,3,6', '2015-07-01T20:14:50.000Z,3,6',
]); ]);
}); });
...@@ -103,9 +103,9 @@ describe('monitoring export_csv', () => { ...@@ -103,9 +103,9 @@ describe('monitoring export_csv', () => {
expectCsvToMatchLines(graphDataToCsv(data), [ expectCsvToMatchLines(graphDataToCsv(data), [
`timestamp,"Y Axis > __name__: up, job: prometheus, instance: localhost:9090","Y Axis > __name__: up, job: node, instance: localhost:9091"`, `timestamp,"Y Axis > __name__: up, job: prometheus, instance: localhost:9090","Y Axis > __name__: up, job: node, instance: localhost:9091"`,
'2015-07-01T20:10:51.781Z,1,4', '2015-07-01T20:10:50.000Z,1,4',
'2015-07-01T20:11:06.781Z,2,5', '2015-07-01T20:12:50.000Z,2,5',
'2015-07-01T20:11:21.781Z,3,6', '2015-07-01T20:14:50.000Z,3,6',
]); ]);
}); });
...@@ -117,9 +117,9 @@ describe('monitoring export_csv', () => { ...@@ -117,9 +117,9 @@ describe('monitoring export_csv', () => {
expectCsvToMatchLines(graphDataToCsv(data), [ expectCsvToMatchLines(graphDataToCsv(data), [
`timestamp,"Y Axis > __name__: up, job: prometheus, instance: localhost:9090","Y Axis > __name__: up, job: node, instance: localhost:9091","Y Axis > __name__: up, job: prometheus, instance: localhost:9090","Y Axis > __name__: up, job: node, instance: localhost:9091","Y Axis > __name__: up, job: prometheus, instance: localhost:9090","Y Axis > __name__: up, job: node, instance: localhost:9091"`, `timestamp,"Y Axis > __name__: up, job: prometheus, instance: localhost:9090","Y Axis > __name__: up, job: node, instance: localhost:9091","Y Axis > __name__: up, job: prometheus, instance: localhost:9090","Y Axis > __name__: up, job: node, instance: localhost:9091","Y Axis > __name__: up, job: prometheus, instance: localhost:9090","Y Axis > __name__: up, job: node, instance: localhost:9091"`,
'2015-07-01T20:10:51.781Z,1,4,1,4,1,4', '2015-07-01T20:10:50.000Z,1,4,1,4,1,4',
'2015-07-01T20:11:06.781Z,2,5,2,5,2,5', '2015-07-01T20:12:50.000Z,2,5,2,5,2,5',
'2015-07-01T20:11:21.781Z,3,6,3,6,3,6', '2015-07-01T20:14:50.000Z,3,6,3,6,3,6',
]); ]);
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment