kibana/x-pack/test/plugin_api_integration/config.ts

55 lines
1.9 KiB
TypeScript
Raw Normal View History

Core task manager (#24356) * Core task manager (#23555) * Initial stab at core task manager logic * Update task_manager readme * Update task manager readme * Add cancelable helper package, OSS, and general purpose, but will be useful for writing cancelable x-pack tasks. * Make the cancellable package promise-compliant * Update task manager readme w/ reference to cancellable * Change pool from lazy to eager, add support for sub-pools per task type. * Move cancellable to task_manager, and typescriptify it. * Working proof of concept for task manager. Still have lots to do: clean up, tests, comments, validations, assertions, etc. * Add pagination support to task manager fetch * Move task manager to OSS * Remove task manager reference from x-pack * Make task_manager a valid core plugin * Modify how task resource allocation works * Remove the special case 'max' workers occupied value * Remove x-pack package.json changes * Make taskDefinitions a part of uiExports * Make task docs saved-object compliant. * Add kbnServer to the task context. * Allow tasks to have a void / undefined return type * revert x-pack change * move cancellable to src/utils * move to src/server * use afterPluginsInit hook * task_manager.ts rename * add a wrapper with a setClient method * Add tests for task runner * Break task_pool into smaller, testable pieces * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix misidentified field name * fix rest args warning * flatten task_pool * remove cancellable * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix rest args warning * typescript fixes * roll back setClient takes a callback * createTaskRunner returns an object with run/cancel functions * Test task store, tweak task poller tests * Rename num_workers to max_workers * Tweak task pool method names * Fix cancellable test, and ts errors * Rename doc to _doc * Fix the doc type in the task manager index mappings * Make task costs configurable in kibana.yml * fix a tslint warning * TaskManager.afterPluginsInit replaces circuitous stuff * addMiddleware, implement beforeSave * wip * comment * run context stuff * pretty fix * comments * lint/pretty fixes * safeties in case they don't define both beforeRun and beforeSave * task runner test constructor opts fix * Add task_manager integration tests * FIx readme mistakes, fix schedule signature * Fix integration tests * Add blurb about middleware * make a libs directory for the small things * test for extractTaskDefinitions * unit test for middleware * Comment, refactor, and test task_manager * Touch up comments * Make task store throw error if given an unknown task type * Fix sample task definition in readme * Make task manager toggle on / off based on Elasticsearch connectivity * Prevent task manager from crashing Kibana if elasticsearch plugin is disabled * Fix task manager signature * Move the task manager into the task manager mixin, fix tests. It's an uber integration object anyway, so it seemed to make sense to keep it in one place. * Fix task manager integration tests * Update the task manager index creation to use auto_expand_replicas * Fix task manager integration tests * Fix task manager integration tests * Fix the overzealous deletion of .kibana during tests * Core task manager * Allow hardcoded ID passed in * comments * don't deconstruct type and task for payload * remove uiExport support * move task_manager to x-pack/plugins * expose as client on the plugin namespace * fix tests * move plugin api integration tests * roll back readme sample task definition example * fix sample plugin link * server.taskManager * sanitizeTaskDefinitions * fix integration tests * sanitize rename * assert unintialized and check for duplicates in registerTaskDefinitions * Remove unnecessary defaults from task_manager.test.ts * Remove task manager from OSS * Remove task manager from src * Tidy up task_manager unit tests around elasticsearch status changes * Integration test for specifying ID in scheduling * Task_manager init -> preInit to allow other plugins to consume taskManager in their init. * Remove task manager integration tests from OSS * spelling * readme fix * fix test code impacted by hapi upgrade * Task Manager index creation changes (#24542) * Uses putTemplate for task manager mappings and index settings. * Removes create option. * Opposite day, the test catches up to the code changes. * Ignores index unavailable during searches. * Improve taskRunner's processResult (#24880) * Set task state to idle after run, and add failed state * fix tests * Test alerting demo (#25136) * Ensures that task store init gets called before schedule. * Removes unused option for debugging purposes. * Fix unit tests because a second callCluster was made. * Task manager starts sanely. Does not preInit Will not allow definitions after initialization Creates store immediately. Modifies store after all plugins have initialized Adds static tasks that will be defined by plugins. * Task manager should not allow operations before initialization. * Attempts to fix runner tests. * Fixes unit test contract with APIs. * Removes unused type definitions. * Removes unused package json. * Removes unused import type. * Removes unnecessary async applied to a function. * Returns diferently if task store has already initialized. * Explains how to add static task instances to task definitions. (#25880) * Tasks cannot be scheduled until task manager is initialized. * Adds task manager api integration tests to ci group4. * Context of describe test must be the test framework object. * Update src/es_archiver/lib/indices/kibana_index.js regex update to actually disallow non-kibana system indices Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * verify fillPool exception passing * readme update about max_workers/numWorkers * change forEach to reduce * use public interfaces in internal method * replace getMaxAttempts with public readonly maxAttempts * Update x-pack/plugins/task_manager/task_store.ts `throw new Error` and initializattion spell fix Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * min = 1 for max_workers Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * timeOut => timeout * min 1 * scope as an array * no retries Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ConcreteTaskInstance is a TaskInstance * remove guard per joi logic * more return types for functions * more comments around incremental back-off Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * throw error instead of return undefined * poll_interval min 1000 * avoid handling err.stack directly * break up processResult * fix a few runtime issues * only fetch idle tasks * remove check for status idle * always return a state, and when there is an error return the state we had at beforeRun * check isStarted before attemptWork Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ts fix
2019-01-04 00:32:09 +01:00
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
Core task manager (#24356) * Core task manager (#23555) * Initial stab at core task manager logic * Update task_manager readme * Update task manager readme * Add cancelable helper package, OSS, and general purpose, but will be useful for writing cancelable x-pack tasks. * Make the cancellable package promise-compliant * Update task manager readme w/ reference to cancellable * Change pool from lazy to eager, add support for sub-pools per task type. * Move cancellable to task_manager, and typescriptify it. * Working proof of concept for task manager. Still have lots to do: clean up, tests, comments, validations, assertions, etc. * Add pagination support to task manager fetch * Move task manager to OSS * Remove task manager reference from x-pack * Make task_manager a valid core plugin * Modify how task resource allocation works * Remove the special case 'max' workers occupied value * Remove x-pack package.json changes * Make taskDefinitions a part of uiExports * Make task docs saved-object compliant. * Add kbnServer to the task context. * Allow tasks to have a void / undefined return type * revert x-pack change * move cancellable to src/utils * move to src/server * use afterPluginsInit hook * task_manager.ts rename * add a wrapper with a setClient method * Add tests for task runner * Break task_pool into smaller, testable pieces * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix misidentified field name * fix rest args warning * flatten task_pool * remove cancellable * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix rest args warning * typescript fixes * roll back setClient takes a callback * createTaskRunner returns an object with run/cancel functions * Test task store, tweak task poller tests * Rename num_workers to max_workers * Tweak task pool method names * Fix cancellable test, and ts errors * Rename doc to _doc * Fix the doc type in the task manager index mappings * Make task costs configurable in kibana.yml * fix a tslint warning * TaskManager.afterPluginsInit replaces circuitous stuff * addMiddleware, implement beforeSave * wip * comment * run context stuff * pretty fix * comments * lint/pretty fixes * safeties in case they don't define both beforeRun and beforeSave * task runner test constructor opts fix * Add task_manager integration tests * FIx readme mistakes, fix schedule signature * Fix integration tests * Add blurb about middleware * make a libs directory for the small things * test for extractTaskDefinitions * unit test for middleware * Comment, refactor, and test task_manager * Touch up comments * Make task store throw error if given an unknown task type * Fix sample task definition in readme * Make task manager toggle on / off based on Elasticsearch connectivity * Prevent task manager from crashing Kibana if elasticsearch plugin is disabled * Fix task manager signature * Move the task manager into the task manager mixin, fix tests. It's an uber integration object anyway, so it seemed to make sense to keep it in one place. * Fix task manager integration tests * Update the task manager index creation to use auto_expand_replicas * Fix task manager integration tests * Fix task manager integration tests * Fix the overzealous deletion of .kibana during tests * Core task manager * Allow hardcoded ID passed in * comments * don't deconstruct type and task for payload * remove uiExport support * move task_manager to x-pack/plugins * expose as client on the plugin namespace * fix tests * move plugin api integration tests * roll back readme sample task definition example * fix sample plugin link * server.taskManager * sanitizeTaskDefinitions * fix integration tests * sanitize rename * assert unintialized and check for duplicates in registerTaskDefinitions * Remove unnecessary defaults from task_manager.test.ts * Remove task manager from OSS * Remove task manager from src * Tidy up task_manager unit tests around elasticsearch status changes * Integration test for specifying ID in scheduling * Task_manager init -> preInit to allow other plugins to consume taskManager in their init. * Remove task manager integration tests from OSS * spelling * readme fix * fix test code impacted by hapi upgrade * Task Manager index creation changes (#24542) * Uses putTemplate for task manager mappings and index settings. * Removes create option. * Opposite day, the test catches up to the code changes. * Ignores index unavailable during searches. * Improve taskRunner's processResult (#24880) * Set task state to idle after run, and add failed state * fix tests * Test alerting demo (#25136) * Ensures that task store init gets called before schedule. * Removes unused option for debugging purposes. * Fix unit tests because a second callCluster was made. * Task manager starts sanely. Does not preInit Will not allow definitions after initialization Creates store immediately. Modifies store after all plugins have initialized Adds static tasks that will be defined by plugins. * Task manager should not allow operations before initialization. * Attempts to fix runner tests. * Fixes unit test contract with APIs. * Removes unused type definitions. * Removes unused package json. * Removes unused import type. * Removes unnecessary async applied to a function. * Returns diferently if task store has already initialized. * Explains how to add static task instances to task definitions. (#25880) * Tasks cannot be scheduled until task manager is initialized. * Adds task manager api integration tests to ci group4. * Context of describe test must be the test framework object. * Update src/es_archiver/lib/indices/kibana_index.js regex update to actually disallow non-kibana system indices Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * verify fillPool exception passing * readme update about max_workers/numWorkers * change forEach to reduce * use public interfaces in internal method * replace getMaxAttempts with public readonly maxAttempts * Update x-pack/plugins/task_manager/task_store.ts `throw new Error` and initializattion spell fix Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * min = 1 for max_workers Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * timeOut => timeout * min 1 * scope as an array * no retries Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ConcreteTaskInstance is a TaskInstance * remove guard per joi logic * more return types for functions * more comments around incremental back-off Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * throw error instead of return undefined * poll_interval min 1000 * avoid handling err.stack directly * break up processResult * fix a few runtime issues * only fetch idle tasks * remove check for status idle * always return a state, and when there is an error return the state we had at beforeRun * check isStarted before attemptWork Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ts fix
2019-01-04 00:32:09 +01:00
*/
import path from 'path';
import fs from 'fs';
import { FtrConfigProviderContext } from '@kbn/test/types/ftr';
import { services } from './services';
Core task manager (#24356) * Core task manager (#23555) * Initial stab at core task manager logic * Update task_manager readme * Update task manager readme * Add cancelable helper package, OSS, and general purpose, but will be useful for writing cancelable x-pack tasks. * Make the cancellable package promise-compliant * Update task manager readme w/ reference to cancellable * Change pool from lazy to eager, add support for sub-pools per task type. * Move cancellable to task_manager, and typescriptify it. * Working proof of concept for task manager. Still have lots to do: clean up, tests, comments, validations, assertions, etc. * Add pagination support to task manager fetch * Move task manager to OSS * Remove task manager reference from x-pack * Make task_manager a valid core plugin * Modify how task resource allocation works * Remove the special case 'max' workers occupied value * Remove x-pack package.json changes * Make taskDefinitions a part of uiExports * Make task docs saved-object compliant. * Add kbnServer to the task context. * Allow tasks to have a void / undefined return type * revert x-pack change * move cancellable to src/utils * move to src/server * use afterPluginsInit hook * task_manager.ts rename * add a wrapper with a setClient method * Add tests for task runner * Break task_pool into smaller, testable pieces * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix misidentified field name * fix rest args warning * flatten task_pool * remove cancellable * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix rest args warning * typescript fixes * roll back setClient takes a callback * createTaskRunner returns an object with run/cancel functions * Test task store, tweak task poller tests * Rename num_workers to max_workers * Tweak task pool method names * Fix cancellable test, and ts errors * Rename doc to _doc * Fix the doc type in the task manager index mappings * Make task costs configurable in kibana.yml * fix a tslint warning * TaskManager.afterPluginsInit replaces circuitous stuff * addMiddleware, implement beforeSave * wip * comment * run context stuff * pretty fix * comments * lint/pretty fixes * safeties in case they don't define both beforeRun and beforeSave * task runner test constructor opts fix * Add task_manager integration tests * FIx readme mistakes, fix schedule signature * Fix integration tests * Add blurb about middleware * make a libs directory for the small things * test for extractTaskDefinitions * unit test for middleware * Comment, refactor, and test task_manager * Touch up comments * Make task store throw error if given an unknown task type * Fix sample task definition in readme * Make task manager toggle on / off based on Elasticsearch connectivity * Prevent task manager from crashing Kibana if elasticsearch plugin is disabled * Fix task manager signature * Move the task manager into the task manager mixin, fix tests. It's an uber integration object anyway, so it seemed to make sense to keep it in one place. * Fix task manager integration tests * Update the task manager index creation to use auto_expand_replicas * Fix task manager integration tests * Fix task manager integration tests * Fix the overzealous deletion of .kibana during tests * Core task manager * Allow hardcoded ID passed in * comments * don't deconstruct type and task for payload * remove uiExport support * move task_manager to x-pack/plugins * expose as client on the plugin namespace * fix tests * move plugin api integration tests * roll back readme sample task definition example * fix sample plugin link * server.taskManager * sanitizeTaskDefinitions * fix integration tests * sanitize rename * assert unintialized and check for duplicates in registerTaskDefinitions * Remove unnecessary defaults from task_manager.test.ts * Remove task manager from OSS * Remove task manager from src * Tidy up task_manager unit tests around elasticsearch status changes * Integration test for specifying ID in scheduling * Task_manager init -> preInit to allow other plugins to consume taskManager in their init. * Remove task manager integration tests from OSS * spelling * readme fix * fix test code impacted by hapi upgrade * Task Manager index creation changes (#24542) * Uses putTemplate for task manager mappings and index settings. * Removes create option. * Opposite day, the test catches up to the code changes. * Ignores index unavailable during searches. * Improve taskRunner's processResult (#24880) * Set task state to idle after run, and add failed state * fix tests * Test alerting demo (#25136) * Ensures that task store init gets called before schedule. * Removes unused option for debugging purposes. * Fix unit tests because a second callCluster was made. * Task manager starts sanely. Does not preInit Will not allow definitions after initialization Creates store immediately. Modifies store after all plugins have initialized Adds static tasks that will be defined by plugins. * Task manager should not allow operations before initialization. * Attempts to fix runner tests. * Fixes unit test contract with APIs. * Removes unused type definitions. * Removes unused package json. * Removes unused import type. * Removes unnecessary async applied to a function. * Returns diferently if task store has already initialized. * Explains how to add static task instances to task definitions. (#25880) * Tasks cannot be scheduled until task manager is initialized. * Adds task manager api integration tests to ci group4. * Context of describe test must be the test framework object. * Update src/es_archiver/lib/indices/kibana_index.js regex update to actually disallow non-kibana system indices Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * verify fillPool exception passing * readme update about max_workers/numWorkers * change forEach to reduce * use public interfaces in internal method * replace getMaxAttempts with public readonly maxAttempts * Update x-pack/plugins/task_manager/task_store.ts `throw new Error` and initializattion spell fix Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * min = 1 for max_workers Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * timeOut => timeout * min 1 * scope as an array * no retries Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ConcreteTaskInstance is a TaskInstance * remove guard per joi logic * more return types for functions * more comments around incremental back-off Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * throw error instead of return undefined * poll_interval min 1000 * avoid handling err.stack directly * break up processResult * fix a few runtime issues * only fetch idle tasks * remove check for status idle * always return a state, and when there is an error return the state we had at beforeRun * check isStarted before attemptWork Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ts fix
2019-01-04 00:32:09 +01:00
2020-05-22 09:08:58 +02:00
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
Core task manager (#24356) * Core task manager (#23555) * Initial stab at core task manager logic * Update task_manager readme * Update task manager readme * Add cancelable helper package, OSS, and general purpose, but will be useful for writing cancelable x-pack tasks. * Make the cancellable package promise-compliant * Update task manager readme w/ reference to cancellable * Change pool from lazy to eager, add support for sub-pools per task type. * Move cancellable to task_manager, and typescriptify it. * Working proof of concept for task manager. Still have lots to do: clean up, tests, comments, validations, assertions, etc. * Add pagination support to task manager fetch * Move task manager to OSS * Remove task manager reference from x-pack * Make task_manager a valid core plugin * Modify how task resource allocation works * Remove the special case 'max' workers occupied value * Remove x-pack package.json changes * Make taskDefinitions a part of uiExports * Make task docs saved-object compliant. * Add kbnServer to the task context. * Allow tasks to have a void / undefined return type * revert x-pack change * move cancellable to src/utils * move to src/server * use afterPluginsInit hook * task_manager.ts rename * add a wrapper with a setClient method * Add tests for task runner * Break task_pool into smaller, testable pieces * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix misidentified field name * fix rest args warning * flatten task_pool * remove cancellable * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix rest args warning * typescript fixes * roll back setClient takes a callback * createTaskRunner returns an object with run/cancel functions * Test task store, tweak task poller tests * Rename num_workers to max_workers * Tweak task pool method names * Fix cancellable test, and ts errors * Rename doc to _doc * Fix the doc type in the task manager index mappings * Make task costs configurable in kibana.yml * fix a tslint warning * TaskManager.afterPluginsInit replaces circuitous stuff * addMiddleware, implement beforeSave * wip * comment * run context stuff * pretty fix * comments * lint/pretty fixes * safeties in case they don't define both beforeRun and beforeSave * task runner test constructor opts fix * Add task_manager integration tests * FIx readme mistakes, fix schedule signature * Fix integration tests * Add blurb about middleware * make a libs directory for the small things * test for extractTaskDefinitions * unit test for middleware * Comment, refactor, and test task_manager * Touch up comments * Make task store throw error if given an unknown task type * Fix sample task definition in readme * Make task manager toggle on / off based on Elasticsearch connectivity * Prevent task manager from crashing Kibana if elasticsearch plugin is disabled * Fix task manager signature * Move the task manager into the task manager mixin, fix tests. It's an uber integration object anyway, so it seemed to make sense to keep it in one place. * Fix task manager integration tests * Update the task manager index creation to use auto_expand_replicas * Fix task manager integration tests * Fix task manager integration tests * Fix the overzealous deletion of .kibana during tests * Core task manager * Allow hardcoded ID passed in * comments * don't deconstruct type and task for payload * remove uiExport support * move task_manager to x-pack/plugins * expose as client on the plugin namespace * fix tests * move plugin api integration tests * roll back readme sample task definition example * fix sample plugin link * server.taskManager * sanitizeTaskDefinitions * fix integration tests * sanitize rename * assert unintialized and check for duplicates in registerTaskDefinitions * Remove unnecessary defaults from task_manager.test.ts * Remove task manager from OSS * Remove task manager from src * Tidy up task_manager unit tests around elasticsearch status changes * Integration test for specifying ID in scheduling * Task_manager init -> preInit to allow other plugins to consume taskManager in their init. * Remove task manager integration tests from OSS * spelling * readme fix * fix test code impacted by hapi upgrade * Task Manager index creation changes (#24542) * Uses putTemplate for task manager mappings and index settings. * Removes create option. * Opposite day, the test catches up to the code changes. * Ignores index unavailable during searches. * Improve taskRunner's processResult (#24880) * Set task state to idle after run, and add failed state * fix tests * Test alerting demo (#25136) * Ensures that task store init gets called before schedule. * Removes unused option for debugging purposes. * Fix unit tests because a second callCluster was made. * Task manager starts sanely. Does not preInit Will not allow definitions after initialization Creates store immediately. Modifies store after all plugins have initialized Adds static tasks that will be defined by plugins. * Task manager should not allow operations before initialization. * Attempts to fix runner tests. * Fixes unit test contract with APIs. * Removes unused type definitions. * Removes unused package json. * Removes unused import type. * Removes unnecessary async applied to a function. * Returns diferently if task store has already initialized. * Explains how to add static task instances to task definitions. (#25880) * Tasks cannot be scheduled until task manager is initialized. * Adds task manager api integration tests to ci group4. * Context of describe test must be the test framework object. * Update src/es_archiver/lib/indices/kibana_index.js regex update to actually disallow non-kibana system indices Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * verify fillPool exception passing * readme update about max_workers/numWorkers * change forEach to reduce * use public interfaces in internal method * replace getMaxAttempts with public readonly maxAttempts * Update x-pack/plugins/task_manager/task_store.ts `throw new Error` and initializattion spell fix Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * min = 1 for max_workers Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * timeOut => timeout * min 1 * scope as an array * no retries Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ConcreteTaskInstance is a TaskInstance * remove guard per joi logic * more return types for functions * more comments around incremental back-off Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * throw error instead of return undefined * poll_interval min 1000 * avoid handling err.stack directly * break up processResult * fix a few runtime issues * only fetch idle tasks * remove check for status idle * always return a state, and when there is an error return the state we had at beforeRun * check isStarted before attemptWork Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ts fix
2019-01-04 00:32:09 +01:00
const integrationConfig = await readConfigFile(require.resolve('../api_integration/config'));
// Find all folders in ./plugins since we treat all them as plugin folder
const allFiles = fs.readdirSync(path.resolve(__dirname, 'plugins'));
2020-05-22 09:08:58 +02:00
const plugins = allFiles.filter((file) =>
2019-12-13 23:44:04 +01:00
fs.statSync(path.resolve(__dirname, 'plugins', file)).isDirectory()
);
Core task manager (#24356) * Core task manager (#23555) * Initial stab at core task manager logic * Update task_manager readme * Update task manager readme * Add cancelable helper package, OSS, and general purpose, but will be useful for writing cancelable x-pack tasks. * Make the cancellable package promise-compliant * Update task manager readme w/ reference to cancellable * Change pool from lazy to eager, add support for sub-pools per task type. * Move cancellable to task_manager, and typescriptify it. * Working proof of concept for task manager. Still have lots to do: clean up, tests, comments, validations, assertions, etc. * Add pagination support to task manager fetch * Move task manager to OSS * Remove task manager reference from x-pack * Make task_manager a valid core plugin * Modify how task resource allocation works * Remove the special case 'max' workers occupied value * Remove x-pack package.json changes * Make taskDefinitions a part of uiExports * Make task docs saved-object compliant. * Add kbnServer to the task context. * Allow tasks to have a void / undefined return type * revert x-pack change * move cancellable to src/utils * move to src/server * use afterPluginsInit hook * task_manager.ts rename * add a wrapper with a setClient method * Add tests for task runner * Break task_pool into smaller, testable pieces * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix misidentified field name * fix rest args warning * flatten task_pool * remove cancellable * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix rest args warning * typescript fixes * roll back setClient takes a callback * createTaskRunner returns an object with run/cancel functions * Test task store, tweak task poller tests * Rename num_workers to max_workers * Tweak task pool method names * Fix cancellable test, and ts errors * Rename doc to _doc * Fix the doc type in the task manager index mappings * Make task costs configurable in kibana.yml * fix a tslint warning * TaskManager.afterPluginsInit replaces circuitous stuff * addMiddleware, implement beforeSave * wip * comment * run context stuff * pretty fix * comments * lint/pretty fixes * safeties in case they don't define both beforeRun and beforeSave * task runner test constructor opts fix * Add task_manager integration tests * FIx readme mistakes, fix schedule signature * Fix integration tests * Add blurb about middleware * make a libs directory for the small things * test for extractTaskDefinitions * unit test for middleware * Comment, refactor, and test task_manager * Touch up comments * Make task store throw error if given an unknown task type * Fix sample task definition in readme * Make task manager toggle on / off based on Elasticsearch connectivity * Prevent task manager from crashing Kibana if elasticsearch plugin is disabled * Fix task manager signature * Move the task manager into the task manager mixin, fix tests. It's an uber integration object anyway, so it seemed to make sense to keep it in one place. * Fix task manager integration tests * Update the task manager index creation to use auto_expand_replicas * Fix task manager integration tests * Fix task manager integration tests * Fix the overzealous deletion of .kibana during tests * Core task manager * Allow hardcoded ID passed in * comments * don't deconstruct type and task for payload * remove uiExport support * move task_manager to x-pack/plugins * expose as client on the plugin namespace * fix tests * move plugin api integration tests * roll back readme sample task definition example * fix sample plugin link * server.taskManager * sanitizeTaskDefinitions * fix integration tests * sanitize rename * assert unintialized and check for duplicates in registerTaskDefinitions * Remove unnecessary defaults from task_manager.test.ts * Remove task manager from OSS * Remove task manager from src * Tidy up task_manager unit tests around elasticsearch status changes * Integration test for specifying ID in scheduling * Task_manager init -> preInit to allow other plugins to consume taskManager in their init. * Remove task manager integration tests from OSS * spelling * readme fix * fix test code impacted by hapi upgrade * Task Manager index creation changes (#24542) * Uses putTemplate for task manager mappings and index settings. * Removes create option. * Opposite day, the test catches up to the code changes. * Ignores index unavailable during searches. * Improve taskRunner's processResult (#24880) * Set task state to idle after run, and add failed state * fix tests * Test alerting demo (#25136) * Ensures that task store init gets called before schedule. * Removes unused option for debugging purposes. * Fix unit tests because a second callCluster was made. * Task manager starts sanely. Does not preInit Will not allow definitions after initialization Creates store immediately. Modifies store after all plugins have initialized Adds static tasks that will be defined by plugins. * Task manager should not allow operations before initialization. * Attempts to fix runner tests. * Fixes unit test contract with APIs. * Removes unused type definitions. * Removes unused package json. * Removes unused import type. * Removes unnecessary async applied to a function. * Returns diferently if task store has already initialized. * Explains how to add static task instances to task definitions. (#25880) * Tasks cannot be scheduled until task manager is initialized. * Adds task manager api integration tests to ci group4. * Context of describe test must be the test framework object. * Update src/es_archiver/lib/indices/kibana_index.js regex update to actually disallow non-kibana system indices Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * verify fillPool exception passing * readme update about max_workers/numWorkers * change forEach to reduce * use public interfaces in internal method * replace getMaxAttempts with public readonly maxAttempts * Update x-pack/plugins/task_manager/task_store.ts `throw new Error` and initializattion spell fix Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * min = 1 for max_workers Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * timeOut => timeout * min 1 * scope as an array * no retries Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ConcreteTaskInstance is a TaskInstance * remove guard per joi logic * more return types for functions * more comments around incremental back-off Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * throw error instead of return undefined * poll_interval min 1000 * avoid handling err.stack directly * break up processResult * fix a few runtime issues * only fetch idle tasks * remove check for status idle * always return a state, and when there is an error return the state we had at beforeRun * check isStarted before attemptWork Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ts fix
2019-01-04 00:32:09 +01:00
return {
testFiles: [
require.resolve('./test_suites/platform'),
require.resolve('./test_suites/task_manager'),
require.resolve('./test_suites/event_log'),
require.resolve('./test_suites/licensed_feature_usage'),
],
services,
Core task manager (#24356) * Core task manager (#23555) * Initial stab at core task manager logic * Update task_manager readme * Update task manager readme * Add cancelable helper package, OSS, and general purpose, but will be useful for writing cancelable x-pack tasks. * Make the cancellable package promise-compliant * Update task manager readme w/ reference to cancellable * Change pool from lazy to eager, add support for sub-pools per task type. * Move cancellable to task_manager, and typescriptify it. * Working proof of concept for task manager. Still have lots to do: clean up, tests, comments, validations, assertions, etc. * Add pagination support to task manager fetch * Move task manager to OSS * Remove task manager reference from x-pack * Make task_manager a valid core plugin * Modify how task resource allocation works * Remove the special case 'max' workers occupied value * Remove x-pack package.json changes * Make taskDefinitions a part of uiExports * Make task docs saved-object compliant. * Add kbnServer to the task context. * Allow tasks to have a void / undefined return type * revert x-pack change * move cancellable to src/utils * move to src/server * use afterPluginsInit hook * task_manager.ts rename * add a wrapper with a setClient method * Add tests for task runner * Break task_pool into smaller, testable pieces * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix misidentified field name * fix rest args warning * flatten task_pool * remove cancellable * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix rest args warning * typescript fixes * roll back setClient takes a callback * createTaskRunner returns an object with run/cancel functions * Test task store, tweak task poller tests * Rename num_workers to max_workers * Tweak task pool method names * Fix cancellable test, and ts errors * Rename doc to _doc * Fix the doc type in the task manager index mappings * Make task costs configurable in kibana.yml * fix a tslint warning * TaskManager.afterPluginsInit replaces circuitous stuff * addMiddleware, implement beforeSave * wip * comment * run context stuff * pretty fix * comments * lint/pretty fixes * safeties in case they don't define both beforeRun and beforeSave * task runner test constructor opts fix * Add task_manager integration tests * FIx readme mistakes, fix schedule signature * Fix integration tests * Add blurb about middleware * make a libs directory for the small things * test for extractTaskDefinitions * unit test for middleware * Comment, refactor, and test task_manager * Touch up comments * Make task store throw error if given an unknown task type * Fix sample task definition in readme * Make task manager toggle on / off based on Elasticsearch connectivity * Prevent task manager from crashing Kibana if elasticsearch plugin is disabled * Fix task manager signature * Move the task manager into the task manager mixin, fix tests. It's an uber integration object anyway, so it seemed to make sense to keep it in one place. * Fix task manager integration tests * Update the task manager index creation to use auto_expand_replicas * Fix task manager integration tests * Fix task manager integration tests * Fix the overzealous deletion of .kibana during tests * Core task manager * Allow hardcoded ID passed in * comments * don't deconstruct type and task for payload * remove uiExport support * move task_manager to x-pack/plugins * expose as client on the plugin namespace * fix tests * move plugin api integration tests * roll back readme sample task definition example * fix sample plugin link * server.taskManager * sanitizeTaskDefinitions * fix integration tests * sanitize rename * assert unintialized and check for duplicates in registerTaskDefinitions * Remove unnecessary defaults from task_manager.test.ts * Remove task manager from OSS * Remove task manager from src * Tidy up task_manager unit tests around elasticsearch status changes * Integration test for specifying ID in scheduling * Task_manager init -> preInit to allow other plugins to consume taskManager in their init. * Remove task manager integration tests from OSS * spelling * readme fix * fix test code impacted by hapi upgrade * Task Manager index creation changes (#24542) * Uses putTemplate for task manager mappings and index settings. * Removes create option. * Opposite day, the test catches up to the code changes. * Ignores index unavailable during searches. * Improve taskRunner's processResult (#24880) * Set task state to idle after run, and add failed state * fix tests * Test alerting demo (#25136) * Ensures that task store init gets called before schedule. * Removes unused option for debugging purposes. * Fix unit tests because a second callCluster was made. * Task manager starts sanely. Does not preInit Will not allow definitions after initialization Creates store immediately. Modifies store after all plugins have initialized Adds static tasks that will be defined by plugins. * Task manager should not allow operations before initialization. * Attempts to fix runner tests. * Fixes unit test contract with APIs. * Removes unused type definitions. * Removes unused package json. * Removes unused import type. * Removes unnecessary async applied to a function. * Returns diferently if task store has already initialized. * Explains how to add static task instances to task definitions. (#25880) * Tasks cannot be scheduled until task manager is initialized. * Adds task manager api integration tests to ci group4. * Context of describe test must be the test framework object. * Update src/es_archiver/lib/indices/kibana_index.js regex update to actually disallow non-kibana system indices Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * verify fillPool exception passing * readme update about max_workers/numWorkers * change forEach to reduce * use public interfaces in internal method * replace getMaxAttempts with public readonly maxAttempts * Update x-pack/plugins/task_manager/task_store.ts `throw new Error` and initializattion spell fix Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * min = 1 for max_workers Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * timeOut => timeout * min 1 * scope as an array * no retries Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ConcreteTaskInstance is a TaskInstance * remove guard per joi logic * more return types for functions * more comments around incremental back-off Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * throw error instead of return undefined * poll_interval min 1000 * avoid handling err.stack directly * break up processResult * fix a few runtime issues * only fetch idle tasks * remove check for status idle * always return a state, and when there is an error return the state we had at beforeRun * check isStarted before attemptWork Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ts fix
2019-01-04 00:32:09 +01:00
servers: integrationConfig.get('servers'),
esTestCluster: integrationConfig.get('esTestCluster'),
apps: integrationConfig.get('apps'),
esArchiver: {
2019-12-13 23:44:04 +01:00
directory: path.resolve(__dirname, '../functional/es_archives'),
Core task manager (#24356) * Core task manager (#23555) * Initial stab at core task manager logic * Update task_manager readme * Update task manager readme * Add cancelable helper package, OSS, and general purpose, but will be useful for writing cancelable x-pack tasks. * Make the cancellable package promise-compliant * Update task manager readme w/ reference to cancellable * Change pool from lazy to eager, add support for sub-pools per task type. * Move cancellable to task_manager, and typescriptify it. * Working proof of concept for task manager. Still have lots to do: clean up, tests, comments, validations, assertions, etc. * Add pagination support to task manager fetch * Move task manager to OSS * Remove task manager reference from x-pack * Make task_manager a valid core plugin * Modify how task resource allocation works * Remove the special case 'max' workers occupied value * Remove x-pack package.json changes * Make taskDefinitions a part of uiExports * Make task docs saved-object compliant. * Add kbnServer to the task context. * Allow tasks to have a void / undefined return type * revert x-pack change * move cancellable to src/utils * move to src/server * use afterPluginsInit hook * task_manager.ts rename * add a wrapper with a setClient method * Add tests for task runner * Break task_pool into smaller, testable pieces * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix misidentified field name * fix rest args warning * flatten task_pool * remove cancellable * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix rest args warning * typescript fixes * roll back setClient takes a callback * createTaskRunner returns an object with run/cancel functions * Test task store, tweak task poller tests * Rename num_workers to max_workers * Tweak task pool method names * Fix cancellable test, and ts errors * Rename doc to _doc * Fix the doc type in the task manager index mappings * Make task costs configurable in kibana.yml * fix a tslint warning * TaskManager.afterPluginsInit replaces circuitous stuff * addMiddleware, implement beforeSave * wip * comment * run context stuff * pretty fix * comments * lint/pretty fixes * safeties in case they don't define both beforeRun and beforeSave * task runner test constructor opts fix * Add task_manager integration tests * FIx readme mistakes, fix schedule signature * Fix integration tests * Add blurb about middleware * make a libs directory for the small things * test for extractTaskDefinitions * unit test for middleware * Comment, refactor, and test task_manager * Touch up comments * Make task store throw error if given an unknown task type * Fix sample task definition in readme * Make task manager toggle on / off based on Elasticsearch connectivity * Prevent task manager from crashing Kibana if elasticsearch plugin is disabled * Fix task manager signature * Move the task manager into the task manager mixin, fix tests. It's an uber integration object anyway, so it seemed to make sense to keep it in one place. * Fix task manager integration tests * Update the task manager index creation to use auto_expand_replicas * Fix task manager integration tests * Fix task manager integration tests * Fix the overzealous deletion of .kibana during tests * Core task manager * Allow hardcoded ID passed in * comments * don't deconstruct type and task for payload * remove uiExport support * move task_manager to x-pack/plugins * expose as client on the plugin namespace * fix tests * move plugin api integration tests * roll back readme sample task definition example * fix sample plugin link * server.taskManager * sanitizeTaskDefinitions * fix integration tests * sanitize rename * assert unintialized and check for duplicates in registerTaskDefinitions * Remove unnecessary defaults from task_manager.test.ts * Remove task manager from OSS * Remove task manager from src * Tidy up task_manager unit tests around elasticsearch status changes * Integration test for specifying ID in scheduling * Task_manager init -> preInit to allow other plugins to consume taskManager in their init. * Remove task manager integration tests from OSS * spelling * readme fix * fix test code impacted by hapi upgrade * Task Manager index creation changes (#24542) * Uses putTemplate for task manager mappings and index settings. * Removes create option. * Opposite day, the test catches up to the code changes. * Ignores index unavailable during searches. * Improve taskRunner's processResult (#24880) * Set task state to idle after run, and add failed state * fix tests * Test alerting demo (#25136) * Ensures that task store init gets called before schedule. * Removes unused option for debugging purposes. * Fix unit tests because a second callCluster was made. * Task manager starts sanely. Does not preInit Will not allow definitions after initialization Creates store immediately. Modifies store after all plugins have initialized Adds static tasks that will be defined by plugins. * Task manager should not allow operations before initialization. * Attempts to fix runner tests. * Fixes unit test contract with APIs. * Removes unused type definitions. * Removes unused package json. * Removes unused import type. * Removes unnecessary async applied to a function. * Returns diferently if task store has already initialized. * Explains how to add static task instances to task definitions. (#25880) * Tasks cannot be scheduled until task manager is initialized. * Adds task manager api integration tests to ci group4. * Context of describe test must be the test framework object. * Update src/es_archiver/lib/indices/kibana_index.js regex update to actually disallow non-kibana system indices Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * verify fillPool exception passing * readme update about max_workers/numWorkers * change forEach to reduce * use public interfaces in internal method * replace getMaxAttempts with public readonly maxAttempts * Update x-pack/plugins/task_manager/task_store.ts `throw new Error` and initializattion spell fix Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * min = 1 for max_workers Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * timeOut => timeout * min 1 * scope as an array * no retries Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ConcreteTaskInstance is a TaskInstance * remove guard per joi logic * more return types for functions * more comments around incremental back-off Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * throw error instead of return undefined * poll_interval min 1000 * avoid handling err.stack directly * break up processResult * fix a few runtime issues * only fetch idle tasks * remove check for status idle * always return a state, and when there is an error return the state we had at beforeRun * check isStarted before attemptWork Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ts fix
2019-01-04 00:32:09 +01:00
},
screenshots: integrationConfig.get('screenshots'),
junit: {
reportName: 'Plugin Functional Tests',
},
kbnTestServer: {
...integrationConfig.get('kbnTestServer'),
serverArgs: [
...integrationConfig.get('kbnTestServer.serverArgs'),
'--xpack.eventLog.enabled=true',
'--xpack.eventLog.logEntries=true',
'--xpack.eventLog.indexEntries=true',
'--xpack.task_manager.monitored_aggregated_stats_refresh_rate=5000',
2019-12-13 23:44:04 +01:00
...plugins.map(
2020-05-22 09:08:58 +02:00
(pluginDir) => `--plugin-path=${path.resolve(__dirname, 'plugins', pluginDir)}`
2019-12-13 23:44:04 +01:00
),
Core task manager (#24356) * Core task manager (#23555) * Initial stab at core task manager logic * Update task_manager readme * Update task manager readme * Add cancelable helper package, OSS, and general purpose, but will be useful for writing cancelable x-pack tasks. * Make the cancellable package promise-compliant * Update task manager readme w/ reference to cancellable * Change pool from lazy to eager, add support for sub-pools per task type. * Move cancellable to task_manager, and typescriptify it. * Working proof of concept for task manager. Still have lots to do: clean up, tests, comments, validations, assertions, etc. * Add pagination support to task manager fetch * Move task manager to OSS * Remove task manager reference from x-pack * Make task_manager a valid core plugin * Modify how task resource allocation works * Remove the special case 'max' workers occupied value * Remove x-pack package.json changes * Make taskDefinitions a part of uiExports * Make task docs saved-object compliant. * Add kbnServer to the task context. * Allow tasks to have a void / undefined return type * revert x-pack change * move cancellable to src/utils * move to src/server * use afterPluginsInit hook * task_manager.ts rename * add a wrapper with a setClient method * Add tests for task runner * Break task_pool into smaller, testable pieces * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix misidentified field name * fix rest args warning * flatten task_pool * remove cancellable * return raw task doc fields for calling code * remove todo comment * helper module for default client - setClient takes a callback fn * fix rest args warning * typescript fixes * roll back setClient takes a callback * createTaskRunner returns an object with run/cancel functions * Test task store, tweak task poller tests * Rename num_workers to max_workers * Tweak task pool method names * Fix cancellable test, and ts errors * Rename doc to _doc * Fix the doc type in the task manager index mappings * Make task costs configurable in kibana.yml * fix a tslint warning * TaskManager.afterPluginsInit replaces circuitous stuff * addMiddleware, implement beforeSave * wip * comment * run context stuff * pretty fix * comments * lint/pretty fixes * safeties in case they don't define both beforeRun and beforeSave * task runner test constructor opts fix * Add task_manager integration tests * FIx readme mistakes, fix schedule signature * Fix integration tests * Add blurb about middleware * make a libs directory for the small things * test for extractTaskDefinitions * unit test for middleware * Comment, refactor, and test task_manager * Touch up comments * Make task store throw error if given an unknown task type * Fix sample task definition in readme * Make task manager toggle on / off based on Elasticsearch connectivity * Prevent task manager from crashing Kibana if elasticsearch plugin is disabled * Fix task manager signature * Move the task manager into the task manager mixin, fix tests. It's an uber integration object anyway, so it seemed to make sense to keep it in one place. * Fix task manager integration tests * Update the task manager index creation to use auto_expand_replicas * Fix task manager integration tests * Fix task manager integration tests * Fix the overzealous deletion of .kibana during tests * Core task manager * Allow hardcoded ID passed in * comments * don't deconstruct type and task for payload * remove uiExport support * move task_manager to x-pack/plugins * expose as client on the plugin namespace * fix tests * move plugin api integration tests * roll back readme sample task definition example * fix sample plugin link * server.taskManager * sanitizeTaskDefinitions * fix integration tests * sanitize rename * assert unintialized and check for duplicates in registerTaskDefinitions * Remove unnecessary defaults from task_manager.test.ts * Remove task manager from OSS * Remove task manager from src * Tidy up task_manager unit tests around elasticsearch status changes * Integration test for specifying ID in scheduling * Task_manager init -> preInit to allow other plugins to consume taskManager in their init. * Remove task manager integration tests from OSS * spelling * readme fix * fix test code impacted by hapi upgrade * Task Manager index creation changes (#24542) * Uses putTemplate for task manager mappings and index settings. * Removes create option. * Opposite day, the test catches up to the code changes. * Ignores index unavailable during searches. * Improve taskRunner's processResult (#24880) * Set task state to idle after run, and add failed state * fix tests * Test alerting demo (#25136) * Ensures that task store init gets called before schedule. * Removes unused option for debugging purposes. * Fix unit tests because a second callCluster was made. * Task manager starts sanely. Does not preInit Will not allow definitions after initialization Creates store immediately. Modifies store after all plugins have initialized Adds static tasks that will be defined by plugins. * Task manager should not allow operations before initialization. * Attempts to fix runner tests. * Fixes unit test contract with APIs. * Removes unused type definitions. * Removes unused package json. * Removes unused import type. * Removes unnecessary async applied to a function. * Returns diferently if task store has already initialized. * Explains how to add static task instances to task definitions. (#25880) * Tasks cannot be scheduled until task manager is initialized. * Adds task manager api integration tests to ci group4. * Context of describe test must be the test framework object. * Update src/es_archiver/lib/indices/kibana_index.js regex update to actually disallow non-kibana system indices Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * verify fillPool exception passing * readme update about max_workers/numWorkers * change forEach to reduce * use public interfaces in internal method * replace getMaxAttempts with public readonly maxAttempts * Update x-pack/plugins/task_manager/task_store.ts `throw new Error` and initializattion spell fix Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * min = 1 for max_workers Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * timeOut => timeout * min 1 * scope as an array * no retries Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ConcreteTaskInstance is a TaskInstance * remove guard per joi logic * more return types for functions * more comments around incremental back-off Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * throw error instead of return undefined * poll_interval min 1000 * avoid handling err.stack directly * break up processResult * fix a few runtime issues * only fetch idle tasks * remove check for status idle * always return a state, and when there is an error return the state we had at beforeRun * check isStarted before attemptWork Co-Authored-By: tsullivan <tsullivan@users.noreply.github.com> * ts fix
2019-01-04 00:32:09 +01:00
],
},
};
}