elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.12k forks source link

eliminate createIndexPattern steps from tests #32419

Open LeeDr opened 5 years ago

LeeDr commented 5 years ago

Describe the feature: We're calling createIndexPattern as setup in some tests which are not specifically testing that feature. We should replace those with index patterns already created in the esArchiver date being loaded;

Describe a specific use case for the feature: Here's a grep to find these instances;

LeeDr@LeeDr-XPS MINGW64 ~/git/kibana (master)
$ grep -r PageObjects.settings.createIndexPattern test/functional/apps/*
test/functional/apps/discover/_large_string.js:      await PageObjects.settings.createIndexPattern('testlargestring', null);
test/functional/apps/getting_started/_shakespeare.js:      await PageObjects.settings.createIndexPattern('shakes', null);
test/functional/apps/management/_handle_alias.js:      await PageObjects.settings.createIndexPattern('alias1', null);
test/functional/apps/management/_handle_alias.js:      await PageObjects.settings.createIndexPattern('alias2', 'date');
test/functional/apps/management/_index_pattern_create_delete.js:        return PageObjects.settings.createIndexPattern()
test/functional/apps/management/_index_pattern_filter.js:      await PageObjects.settings.createIndexPattern();
test/functional/apps/management/_index_pattern_popularity.js:      await PageObjects.settings.createIndexPattern();
test/functional/apps/management/_index_pattern_results_sort.js:          await PageObjects.settings.createIndexPattern();
test/functional/apps/management/_index_pattern_results_sort.js:        await PageObjects.settings.createIndexPattern();
test/functional/apps/management/_kibana_settings.js:      await PageObjects.settings.createIndexPattern();
test/functional/apps/management/_scripted_fields.js:      await PageObjects.settings.createIndexPattern();
test/functional/apps/management/_scripted_fields_preview.js:      await PageObjects.settings.createIndexPattern();
test/functional/apps/management/_test_huge_fields.js:      await PageObjects.settings.createIndexPattern('testhuge', 'date');

LeeDr@LeeDr-XPS MINGW64 ~/git/kibana (master)
$ grep -r PageObjects.settings.createIndexPattern x-pack/test/functional/*
x-pack/test/functional/apps/graph/graph.js:      await PageObjects.settings.createIndexPattern('secrepo', '@timestamp');
x-pack/test/functional/apps/security/doc_level_security_roles.js:      await PageObjects.settings.createIndexPattern('dlstest', null);
x-pack/test/functional/apps/security/field_level_security.js:      await PageObjects.settings.createIndexPattern('flstest', null);

Here's a list of the ones from above I think should be replaced with esArchives which already contain the index pattern;

I don't think these tests are specifically about checking the privileges required to create index patterns?

I purposely left the getting started one in to mimic the steps in the doc. And this might be the only instance where we create a non-time based index pattern?; test/functional/apps/getting_started/_shakespeare.js: await PageObjects.settings.createIndexPattern('shakes', null);

I think this one should be left as-is. It's testing that we can (through the UI) create an index pattern with a huge number of fields (8000 I think); test/functional/apps/management/_test_huge_fields.js: await PageObjects.settings.createIndexPattern('testhuge', 'date');

elasticmachine commented 5 years ago

Pinging @elastic/kibana-qa