diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/csv_saved_search.snap b/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/csv_saved_search.snap
index b214a04d8ce57..6cee3c66abadb 100644
--- a/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/csv_saved_search.snap
+++ b/x-pack/test/reporting_api_integration/reporting_and_security/__snapshots__/csv_saved_search.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`Reporting APIs CSV Generation from Saved Search ID export from non-timebased data view with plain saved search csv file matches 1`] = `
+exports[`Reporting APIs CSV Generation from Saved Search ID export from non-timebased data view with plain saved search csv file matches (7.17) 1`] = `
"_id,_index,_score,_type,eon,epoch,era,period
tvJJX4UBvD7uFsw9L2x4,timeless-test,1,_doc,Phanerozoic, Pliocene,Cenozoic,Neogene
t_JJX4UBvD7uFsw9L2x4,timeless-test,1,_doc,Phanerozoic, Holocene,Cenozoic,Quaternary
@@ -13,6 +13,19 @@ vfJJX4UBvD7uFsw9L2x4,timeless-test,1,_doc,Hadean,-,-,-
"
`;
+exports[`Reporting APIs CSV Generation from Saved Search ID export from non-timebased data view with plain saved search csv file matches (8) 1`] = `
+"_id,_index,_score,_type,eon,epoch,era,period
+tvJJX4UBvD7uFsw9L2x4,timeless-test,1,-,Phanerozoic, Pliocene,Cenozoic,Neogene
+t_JJX4UBvD7uFsw9L2x4,timeless-test,1,-,Phanerozoic, Holocene,Cenozoic,Quaternary
+uPJJX4UBvD7uFsw9L2x4,timeless-test,1,-,Phanerozoic,-,Mesozoic,Cretaceous
+ufJJX4UBvD7uFsw9L2x4,timeless-test,1,-,Phanerozoic,-,Mesozoic,Jurassic
+uvJJX4UBvD7uFsw9L2x4,timeless-test,1,-,Phanerozoic,-,Paleozoic,Cambrian
+u_JJX4UBvD7uFsw9L2x4,timeless-test,1,-,Proterozoic,-,Paleozoic,Permian
+vPJJX4UBvD7uFsw9L2x4,timeless-test,1,-,Archean,-,-,-
+vfJJX4UBvD7uFsw9L2x4,timeless-test,1,-,Hadean,-,-,-
+"
+`;
+
exports[`Reporting APIs CSV Generation from Saved Search ID export from timebased data view export with "doc_table:hideTimeColumn" = "On" csv file matches 1`] = `
"clientip,extension
238.171.34.42,jpg
@@ -561,7 +574,7 @@ exports[`Reporting APIs CSV Generation from Saved Search ID export from timebase
"
`;
-exports[`Reporting APIs CSV Generation from Saved Search ID export from timebased data view export with no selected columns and saved date filter and no job post params csv file matches 1`] = `
+exports[`Reporting APIs CSV Generation from Saved Search ID export from timebased data view export with no selected columns and saved date filter and no job post params csv file matches (7.17) 1`] = `
"@message,@message.raw,@tags,@tags.raw,@timestamp,_id,_index,_score,_type,agent,agent.raw,bytes,clientip,extension,extension.raw,geo.coordinates,geo.dest,geo.src,geo.srcdest,headings,headings.raw,host,host.raw,index,index.raw,ip,links,links.raw,machine.os,machine.os.raw,machine.ram,machine.ram_range,referer,relatedContent.article:modified_time,relatedContent.article:published_time,relatedContent.article:section,relatedContent.article:section.raw,relatedContent.article:tag,relatedContent.article:tag.raw,relatedContent.og:description,relatedContent.og:description.raw,relatedContent.og:image,relatedContent.og:image.raw,relatedContent.og:image:height,relatedContent.og:image:height.raw,relatedContent.og:image:width,relatedContent.og:image:width.raw,relatedContent.og:site_name,relatedContent.og:site_name.raw,relatedContent.og:title,relatedContent.og:title.raw,relatedContent.og:type,relatedContent.og:type.raw,relatedContent.og:url,relatedContent.og:url.raw,relatedContent.twitter:card,relatedContent.twitter:card.raw,relatedContent.twitter:description,relatedContent.twitter:description.raw,relatedContent.twitter:image,relatedContent.twitter:image.raw,relatedContent.twitter:site,relatedContent.twitter:site.raw,relatedContent.twitter:title,relatedContent.twitter:title.raw,relatedContent.url,relatedContent.url.raw,request,request.raw,response,response.raw,spaces,spaces.raw,type,url,url.raw,utc_time,xss,xss.raw
149.170.135.63 - - [2015-09-21T04:32:47.536Z] \\"GET /uploads/vance-brand.jpg HTTP/1.1\\" 200 9723 \\"-\\" \\"Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1\\",149.170.135.63 - - [2015-09-21T04:32:47.536Z] \\"GET /uploads/vance-brand.jpg HTTP/1.1\\" 200 9723 \\"-\\" \\"Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1\\",success, info,success, info,2015-09-21 04:32:47.536,AU_x3_g3GFA8no6QjkHp,logstash-2015.09.21,-,_doc,Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1,Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1,9,723,149.170.135.63,jpg,jpg,{
\\"coordinates\\": [
@@ -576,6 +589,21 @@ exports[`Reporting APIs CSV Generation from Saved Search ID export from timebase
"
`;
+exports[`Reporting APIs CSV Generation from Saved Search ID export from timebased data view export with no selected columns and saved date filter and no job post params csv file matches (8) 1`] = `
+"@message,@message.raw,@tags,@tags.raw,@timestamp,_id,_index,_score,_type,agent,agent.raw,bytes,clientip,extension,extension.raw,geo.coordinates,geo.dest,geo.src,geo.srcdest,headings,headings.raw,host,host.raw,index,index.raw,ip,links,links.raw,machine.os,machine.os.raw,machine.ram,machine.ram_range,referer,relatedContent.article:modified_time,relatedContent.article:published_time,relatedContent.article:section,relatedContent.article:section.raw,relatedContent.article:tag,relatedContent.article:tag.raw,relatedContent.og:description,relatedContent.og:description.raw,relatedContent.og:image,relatedContent.og:image.raw,relatedContent.og:image:height,relatedContent.og:image:height.raw,relatedContent.og:image:width,relatedContent.og:image:width.raw,relatedContent.og:site_name,relatedContent.og:site_name.raw,relatedContent.og:title,relatedContent.og:title.raw,relatedContent.og:type,relatedContent.og:type.raw,relatedContent.og:url,relatedContent.og:url.raw,relatedContent.twitter:card,relatedContent.twitter:card.raw,relatedContent.twitter:description,relatedContent.twitter:description.raw,relatedContent.twitter:image,relatedContent.twitter:image.raw,relatedContent.twitter:site,relatedContent.twitter:site.raw,relatedContent.twitter:title,relatedContent.twitter:title.raw,relatedContent.url,relatedContent.url.raw,request,request.raw,response,response.raw,spaces,spaces.raw,type,url,url.raw,utc_time,xss,xss.raw
+149.170.135.63 - - [2015-09-21T04:32:47.536Z] \\"GET /uploads/vance-brand.jpg HTTP/1.1\\" 200 9723 \\"-\\" \\"Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1\\",149.170.135.63 - - [2015-09-21T04:32:47.536Z] \\"GET /uploads/vance-brand.jpg HTTP/1.1\\" 200 9723 \\"-\\" \\"Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1\\",success, info,success, info,2015-09-21 04:32:47.536,AU_x3_g3GFA8no6QjkHp,logstash-2015.09.21,-,-,Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1,Mozilla/5.0 (X11; Linux x86_64; rv:6.0a1) Gecko/20110421 Firefox/6.0a1,9,723,149.170.135.63,jpg,jpg,{
+ \\"coordinates\\": [
+ -93.61685667,
+ 36.38340333
+ ],
+ \\"type\\": \\"Point\\"
+},CN,CN,CN:CN,
george-nelson, http://twitter.com/success/michael-fincke,george-nelson, http://twitter.com/success/michael-fincke,media-for-the-masses.theacademyofperformingartsandscience.org,media-for-the-masses.theacademyofperformingartsandscience.org,logstash-2015.09.21,logstash-2015.09.21,149.170.135.63,tamara-e-jernigan@twitter.com, http://twitter.com/info/daniel-barry, www.www.slate.com,tamara-e-jernigan@twitter.com, http://twitter.com/info/daniel-barry, www.www.slate.com,win 7,win 7,15,032,385,536,{
+ \\"lt\\": 15032385599,
+ \\"gte\\": 15032385536
+},http://www.slate.com/warning/kevin-kregel,2015-01-31 23:20:16.000,2008-02-14 16:03:19.000,Music,Music,-,-,Willie Nelson, Nokia Theatre, Feb. 13 Photos by Timothy Norris If Willie Nelson had delivered a show with half as much heart, enthusiasm and class, it s...,Willie Nelson, Nokia Theatre, Feb. 13 Photos by Timothy Norris If Willie Nelson had delivered a show with half as much heart, enthusiasm and class, it s...,http://IMAGES1.laweekly.com/imager/willie-nelson-nokia-2-13/u/original/2466986/willienelsontn018.jpg,http://IMAGES1.laweekly.com/imager/willie-nelson-nokia-2-13/u/original/2466986/willienelsontn018.jpg,723,723,480,480,LA Weekly,LA Weekly,Willie Nelson, Nokia, 2/13,Willie Nelson, Nokia, 2/13,article,article,http://www.laweekly.com/music/willie-nelson-nokia-2-13-2404749,http://www.laweekly.com/music/willie-nelson-nokia-2-13-2404749,summary,summary,Willie Nelson, Nokia Theatre, Feb. 13 Photos by Timothy Norris If Willie Nelson had delivered a show with half as much heart, enthusiasm and class, it s...,Willie Nelson, Nokia Theatre, Feb. 13 Photos by Timothy Norris If Willie Nelson had delivered a show with half as much heart, enthusiasm and class, it s...,http://IMAGES1.laweekly.com/imager/willie-nelson-nokia-2-13/u/original/2466986/willienelsontn018.jpg,http://IMAGES1.laweekly.com/imager/willie-nelson-nokia-2-13/u/original/2466986/willienelsontn018.jpg,@laweekly,@laweekly,Willie Nelson, Nokia, 2/13,Willie Nelson, Nokia, 2/13,http://www.laweekly.com/music/willie-nelson-nokia-2-13-2404749,http://www.laweekly.com/music/willie-nelson-nokia-2-13-2404749,/uploads/vance-brand.jpg,/uploads/vance-brand.jpg,200,200,this is a thing with lots of spaces wwwwoooooo,this is a thing with lots of spaces wwwwoooooo,apache,https://media-for-the-masses.theacademyofperformingartsandscience.org/uploads/vance-brand.jpg,https://media-for-the-masses.theacademyofperformingartsandscience.org/uploads/vance-brand.jpg,2015-09-21 04:32:47.536,,
+"
+`;
+
exports[`Reporting APIs CSV Generation from Saved Search ID export from timebased data view export with saved date and terms filters and no job post params csv file matches 1`] = `
"@timestamp,clientip,extension
2015-09-20 10:23:34.323,41.210.252.157,gif
diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/csv_saved_search.ts b/x-pack/test/reporting_api_integration/reporting_and_security/csv_saved_search.ts
index b295252746d42..567409e1ab3c5 100644
--- a/x-pack/test/reporting_api_integration/reporting_and_security/csv_saved_search.ts
+++ b/x-pack/test/reporting_api_integration/reporting_and_security/csv_saved_search.ts
@@ -40,6 +40,7 @@ export default ({ getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
const reportingAPI = getService('reportingAPI');
const log = getService('log');
+ const esVersion = getService('esVersion');
const requestCsvFromSavedSearch = async (
savedSearchId: string,
@@ -110,6 +111,9 @@ export default ({ getService }: FtrProviderContext) => {
});
};
+ const itIf7 = esVersion.matchRange('<8') ? it : it.skip;
+ const itIf8 = esVersion.matchRange('>=8') ? it : it.skip;
+
describe('CSV Generation from Saved Search ID', () => {
before(async () => {
// clear any previous UI Settings
@@ -155,6 +159,13 @@ export default ({ getService }: FtrProviderContext) => {
job = payload.job;
path = payload.path;
await reportingAPI.waitForJobToFinish(path);
+
+ const response = await supertest.get(path);
+ expect(response.header['content-disposition']).to.equal(
+ 'inline; filename="A Saved Search.csv"'
+ );
+ expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
+ csvFile = response.text;
});
it('job response data is correct', () => {
@@ -168,13 +179,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(job.payload.version).equal('7.17');
});
- it('csv file matches', async () => {
- const response = await supertest.get(path);
- expect(response.header['content-disposition']).to.equal(
- 'inline; filename="A Saved Search.csv"'
- );
- expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
- csvFile = response.text;
+ it('csv file matches', () => {
expectSnapshot(csvFile).toMatch();
});
});
@@ -193,6 +198,12 @@ export default ({ getService }: FtrProviderContext) => {
job = payload.job;
path = payload.path;
await reportingAPI.waitForJobToFinish(path);
+ const response = await supertest.get(path);
+ expect(response.header['content-disposition']).to.equal(
+ 'inline; filename="A Saved Search with a date filter.csv"'
+ );
+ expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
+ csvFile = response.text;
});
it('job response data is correct', () => {
@@ -206,13 +217,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(job.payload.version).equal('7.17');
});
- it('csv file matches', async () => {
- const response = await supertest.get(path);
- expect(response.header['content-disposition']).to.equal(
- 'inline; filename="A Saved Search with a date filter.csv"'
- );
- expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
- csvFile = response.text;
+ it('csv file matches', () => {
expectSnapshot(csvFile).toMatch();
});
});
@@ -231,6 +236,12 @@ export default ({ getService }: FtrProviderContext) => {
job = payload.job;
path = payload.path;
await reportingAPI.waitForJobToFinish(path);
+ const response = await supertest.get(path);
+ expect(response.header['content-disposition']).to.equal(
+ 'inline; filename="Saved Search with date filter and no columns selected.csv"'
+ );
+ expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
+ csvFile = response.text;
});
it('job response data is correct', () => {
@@ -244,13 +255,10 @@ export default ({ getService }: FtrProviderContext) => {
expect(job.payload.version).equal('7.17');
});
- it('csv file matches', async () => {
- const response = await supertest.get(path);
- expect(response.header['content-disposition']).to.equal(
- 'inline; filename="Saved Search with date filter and no columns selected.csv"'
- );
- expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
- csvFile = response.text;
+ itIf7('csv file matches (7.17)', () => {
+ expectSnapshot(csvFile).toMatch();
+ });
+ itIf8('csv file matches (8)', () => {
expectSnapshot(csvFile).toMatch();
});
});
@@ -269,6 +277,12 @@ export default ({ getService }: FtrProviderContext) => {
job = payload.job;
path = payload.path;
await reportingAPI.waitForJobToFinish(path);
+ const response = await supertest.get(path);
+ expect(response.header['content-disposition']).to.equal(
+ 'inline; filename="A Saved Search with date and terms filters.csv"'
+ );
+ expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
+ csvFile = response.text;
});
it('job response data is correct', () => {
@@ -282,13 +296,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(job.payload.version).equal('7.17');
});
- it('csv file matches', async () => {
- const response = await supertest.get(path);
- expect(response.header['content-disposition']).to.equal(
- 'inline; filename="A Saved Search with date and terms filters.csv"'
- );
- expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
- csvFile = response.text;
+ it('csv file matches', () => {
expectSnapshot(csvFile).toMatch();
});
});
@@ -313,6 +321,12 @@ export default ({ getService }: FtrProviderContext) => {
job = payload.job;
path = payload.path;
await reportingAPI.waitForJobToFinish(path);
+ const response = await supertest.get(path);
+ expect(response.header['content-disposition']).to.equal(
+ 'inline; filename="A Saved Search with a date filter.csv"'
+ );
+ expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
+ csvFile = response.text;
});
it('job response data is correct', () => {
@@ -326,13 +340,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(job.payload.version).equal('7.17');
});
- it('csv file matches', async () => {
- const response = await supertest.get(path);
- expect(response.header['content-disposition']).to.equal(
- 'inline; filename="A Saved Search with a date filter.csv"'
- );
- expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
- csvFile = response.text;
+ it('csv file matches', () => {
expectSnapshot(csvFile).toMatch();
});
});
@@ -354,6 +362,12 @@ export default ({ getService }: FtrProviderContext) => {
job = payload.job;
path = payload.path;
await reportingAPI.waitForJobToFinish(path);
+ const response = await supertest.get(path);
+ expect(response.header['content-disposition']).to.equal(
+ 'inline; filename="A Saved Search.csv"'
+ );
+ expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
+ csvFile = response.text;
});
it('job response data is correct', () => {
@@ -367,13 +381,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(job.payload.version).equal('7.17');
});
- it('csv file matches', async () => {
- const response = await supertest.get(path);
- expect(response.header['content-disposition']).to.equal(
- 'inline; filename="A Saved Search.csv"'
- );
- expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
- csvFile = response.text;
+ it('csv file matches', () => {
expectSnapshot(csvFile).toMatch();
});
});
@@ -397,6 +405,12 @@ export default ({ getService }: FtrProviderContext) => {
job = payload.job;
path = payload.path;
await reportingAPI.waitForJobToFinish(path);
+ const response = await supertest.get(path);
+ expect(response.header['content-disposition']).to.equal(
+ 'inline; filename="Ecommerce Data.csv"'
+ );
+ expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
+ csvFile = response.text;
});
after(async () => {
@@ -414,13 +428,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(job.payload.version).equal('7.17');
});
- it('csv file matches', async () => {
- const response = await supertest.get(path);
- expect(response.header['content-disposition']).to.equal(
- 'inline; filename="Ecommerce Data.csv"'
- );
- expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
- csvFile = response.text;
+ it('csv file matches', () => {
expectSnapshot(csvFile).toMatch();
});
});
@@ -443,6 +451,12 @@ export default ({ getService }: FtrProviderContext) => {
job = payload.job;
path = payload.path;
await reportingAPI.waitForJobToFinish(path);
+ const response = await supertest.get(path);
+ expect(response.header['content-disposition']).to.equal(
+ 'inline; filename="A Saved Search.csv"'
+ );
+ expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
+ csvFile = response.text;
});
after(async () => {
@@ -460,13 +474,7 @@ export default ({ getService }: FtrProviderContext) => {
expect(job.payload.version).equal('7.17');
});
- it('csv file matches', async () => {
- const response = await supertest.get(path);
- expect(response.header['content-disposition']).to.equal(
- 'inline; filename="A Saved Search.csv"'
- );
- expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
- csvFile = response.text;
+ it('csv file matches', () => {
expectSnapshot(csvFile).toMatch();
});
});
@@ -535,6 +543,12 @@ export default ({ getService }: FtrProviderContext) => {
job = payload.job;
path = payload.path;
await reportingAPI.waitForJobToFinish(path);
+ const response = await supertest.get(path);
+ expect(response.header['content-disposition']).to.equal(
+ 'inline; filename="timeless: no filter, no columns selected.csv"'
+ );
+ expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
+ csvFile = response.text;
});
it('job response data is correct', () => {
@@ -548,13 +562,10 @@ export default ({ getService }: FtrProviderContext) => {
expect(job.payload.version).equal('7.17');
});
- it('csv file matches', async () => {
- const response = await supertest.get(path);
- expect(response.header['content-disposition']).to.equal(
- 'inline; filename="timeless: no filter, no columns selected.csv"'
- );
- expect(response.header['content-type']).to.equal('text/csv; charset=utf-8');
- csvFile = response.text;
+ itIf7('csv file matches (7.17)', () => {
+ expectSnapshot(csvFile).toMatch();
+ });
+ itIf8('csv file matches (8)', () => {
expectSnapshot(csvFile).toMatch();
});
});