Skip to content

Commit

Permalink
Merge branch 'main' into fix-search-filter-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Dec 18, 2023
2 parents bc75491 + 7016c04 commit 08c14e5
Show file tree
Hide file tree
Showing 40 changed files with 320 additions and 559 deletions.
58 changes: 30 additions & 28 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ packages/kbn-flot-charts @elastic/kibana-operations
x-pack/test/ui_capabilities/common/plugins/foo_plugin @elastic/kibana-security
src/plugins/ftr_apis @elastic/kibana-core
packages/kbn-ftr-common-functional-services @elastic/kibana-operations @elastic/appex-qa
packages/kbn-ftr-common-functional-ui-services @elastic/appex-qa
packages/kbn-ftr-screenshot-filename @elastic/kibana-operations @elastic/appex-qa
x-pack/test/functional_with_es_ssl/plugins/cases @elastic/response-ops
x-pack/examples/gen_ai_streaming_response_example @elastic/response-ops
Expand Down Expand Up @@ -1253,8 +1254,37 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
# AI assistant in Security Solution tests
/x-pack/test/security_solution_cypress/cypress/e2e/ai_assistant @elastic/security-threat-hunting-investigations @elastic/security-detection-rule-management

# Security Solution cross teams ownership
/x-pack/test/security_solution_cypress/cypress/fixtures @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/helpers @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/objects @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/plugins @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/screens/common @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/support @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/urls @elastic/security-threat-hunting-investigations @elastic/security-detection-engine

/x-pack/plugins/security_solution/common/ecs @elastic/security-threat-hunting-investigations
/x-pack/plugins/security_solution/common/test @elastic/security-detections-response @elastic/security-threat-hunting

/x-pack/plugins/security_solution/public/common/components/callouts @elastic/security-detections-response
/x-pack/plugins/security_solution/public/common/components/hover_actions @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations

/x-pack/plugins/security_solution/server/routes @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/plugins/security_solution/server/utils @elastic/security-detections-response @elastic/security-threat-hunting
x-pack/test/security_solution_api_integration/test_suites/detections_response/utils @elastic/security-detections-response
x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry @elastic/security-detections-response

# Security Solution sub teams

## Security Solution sub teams - security-engineering-productivity
## NOTE: It's important to keep this above other teams' sections because test automation doesn't process
## the CODEOWNERS file correctly. See https://github.com/elastic/kibana/issues/173307#issuecomment-1855858929
/x-pack/test/security_solution_cypress/* @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/cypress/* @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/cypress/tasks/login.ts @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity
/x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror

## Security Solution sub teams - Threat Hunting Investigations

/x-pack/plugins/security_solution/common/api/timeline @elastic/security-threat-hunting-investigations
Expand Down Expand Up @@ -1429,30 +1459,9 @@ x-pack/test/security_solution_api_integration/test_suites/detections_response/de
/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules.ts @elastic/security-detection-engine
/x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/rule_delete/delete_rules_ess.ts @elastic/security-detection-engine


## Security Threat Intelligence - Under Security Platform
/x-pack/plugins/security_solution/public/common/components/threat_match @elastic/security-detection-engine

## Security Solution cross teams ownership
/x-pack/test/security_solution_cypress/cypress/fixtures @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/helpers @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/objects @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/plugins @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/screens/common @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/support @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/test/security_solution_cypress/cypress/urls @elastic/security-threat-hunting-investigations @elastic/security-detection-engine

/x-pack/plugins/security_solution/common/ecs @elastic/security-threat-hunting-investigations
/x-pack/plugins/security_solution/common/test @elastic/security-detections-response @elastic/security-threat-hunting

/x-pack/plugins/security_solution/public/common/components/callouts @elastic/security-detections-response
/x-pack/plugins/security_solution/public/common/components/hover_actions @elastic/security-threat-hunting-explore @elastic/security-threat-hunting-investigations

/x-pack/plugins/security_solution/server/routes @elastic/security-detections-response @elastic/security-threat-hunting
/x-pack/plugins/security_solution/server/utils @elastic/security-detections-response @elastic/security-threat-hunting
x-pack/test/security_solution_api_integration/test_suites/detections_response/utils @elastic/security-detections-response
x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry @elastic/security-detections-response

## Security Solution sub teams - security-defend-workflows
/x-pack/plugins/security_solution/public/management/ @elastic/security-defend-workflows
/x-pack/plugins/security_solution/public/common/lib/endpoint*/ @elastic/security-defend-workflows
Expand All @@ -1476,13 +1485,6 @@ x-pack/plugins/security_solution/server/usage/ @elastic/security-data-analytics
x-pack/plugins/security_solution/server/lib/telemetry/ @elastic/security-data-analytics
x-pack/test/security_solution_api_integration/test_suites/detections_response/default_license/telemetry @elastic/security-data-analytics

## Security Solution sub teams - security-engineering-productivity
/x-pack/test/security_solution_cypress/* @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/cypress/* @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/cypress/tasks/login.ts @elastic/security-engineering-productivity
/x-pack/test/security_solution_cypress/es_archives @elastic/security-engineering-productivity
/x-pack/plugins/security_solution/scripts/run_cypress @MadameSheema @patrykkopycinski @oatkiller @maximpn @banderror

## Security Solution sub teams - adaptive-workload-protection
x-pack/plugins/security_solution/public/common/components/sessions_viewer @elastic/kibana-cloud-security-posture
x-pack/plugins/security_solution/public/kubernetes @elastic/kibana-cloud-security-posture
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,7 @@
"@kbn/failed-test-reporter-cli": "link:packages/kbn-failed-test-reporter-cli",
"@kbn/find-used-node-modules": "link:packages/kbn-find-used-node-modules",
"@kbn/ftr-common-functional-services": "link:packages/kbn-ftr-common-functional-services",
"@kbn/ftr-common-functional-ui-services": "link:packages/kbn-ftr-common-functional-ui-services",
"@kbn/ftr-screenshot-filename": "link:packages/kbn-ftr-screenshot-filename",
"@kbn/generate": "link:packages/kbn-generate",
"@kbn/get-repo-files": "link:packages/kbn-get-repo-files",
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-ftr-common-functional-ui-services/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/ftr-common-functional-ui-services

Common test services for ui actions.
10 changes: 10 additions & 0 deletions packages/kbn-ftr-common-functional-ui-services/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

export { services as commonFunctionalUIServices } from './services/all';
export type { FtrProviderContext } from './services/ftr_provider_context';
13 changes: 13 additions & 0 deletions packages/kbn-ftr-common-functional-ui-services/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

module.exports = {
preset: '@kbn/test/jest_node',
rootDir: '../..',
roots: ['<rootDir>/packages/kbn-ftr-common-functional-ui-services'],
};
6 changes: 6 additions & 0 deletions packages/kbn-ftr-common-functional-ui-services/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "shared-common",
"id": "@kbn/ftr-common-functional-ui-services",
"owner": "@elastic/appex-qa",
"devOnly": true
}
6 changes: 6 additions & 0 deletions packages/kbn-ftr-common-functional-ui-services/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@kbn/ftr-common-functional-ui-services",
"private": true,
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0"
}
13 changes: 13 additions & 0 deletions packages/kbn-ftr-common-functional-ui-services/services/all.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { RetryOnStaleProvider } from './retry_on_stale';

export const services = {
retryOnStale: RetryOnStaleProvider,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* 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 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { GenericFtrProviderContext, GenericFtrService } from '@kbn/test';

import type { services } from './all';

type Services = typeof services;

export type FtrProviderContext = GenericFtrProviderContext<Services, {}>;
export class FtrService extends GenericFtrService<FtrProviderContext> {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { FtrProviderContext } from '../../ftr_provider_context';
import { FtrProviderContext } from './ftr_provider_context';

const MAX_ATTEMPTS = 10;

Expand Down
19 changes: 19 additions & 0 deletions packages/kbn-ftr-common-functional-ui-services/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "target/types",
"types": [
"jest",
"node"
]
},
"include": [
"**/*.ts",
],
"exclude": [
"target/**/*"
],
"kbn_references": [
"@kbn/test",
]
}
1 change: 0 additions & 1 deletion test/functional/services/common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ export { PngService } from './png';
export { ScreenshotsService } from './screenshots';
export { SnapshotsService } from './snapshots';
export { TestSubjects } from './test_subjects';
export { RetryOnStaleProvider } from './retry_on_stale';
5 changes: 2 additions & 3 deletions test/functional/services/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Side Public License, v 1.
*/

import { commonFunctionalUIServices } from '@kbn/ftr-common-functional-ui-services';
import { services as commonServiceProviders } from '../../common/services';

import { AppsMenuService } from './apps_menu';
Expand All @@ -17,7 +18,6 @@ import {
ScreenshotsService,
SnapshotsService,
TestSubjects,
RetryOnStaleProvider,
} from './common';
import { ComboBoxService } from './combo_box';
import {
Expand Down Expand Up @@ -60,7 +60,7 @@ import { DashboardSettingsProvider } from './dashboard/dashboard_settings';

export const services = {
...commonServiceProviders,

...commonFunctionalUIServices,
__webdriver__: RemoteProvider,
filterBar: FilterBarService,
queryBar: QueryBarService,
Expand Down Expand Up @@ -101,7 +101,6 @@ export const services = {
managementMenu: ManagementMenuService,
monacoEditor: MonacoEditorService,
menuToggle: MenuToggleService,
retryOnStale: RetryOnStaleProvider,
usageCollection: UsageCollectionService,
savedObjectsFinder: SavedObjectsFinderService,
};
1 change: 1 addition & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@
"@kbn/event-annotation-plugin",
"@kbn/event-annotation-common",
"@kbn/links-plugin",
"@kbn/ftr-common-functional-ui-services",
]
}
2 changes: 2 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,8 @@
"@kbn/ftr-apis-plugin/*": ["src/plugins/ftr_apis/*"],
"@kbn/ftr-common-functional-services": ["packages/kbn-ftr-common-functional-services"],
"@kbn/ftr-common-functional-services/*": ["packages/kbn-ftr-common-functional-services/*"],
"@kbn/ftr-common-functional-ui-services": ["packages/kbn-ftr-common-functional-ui-services"],
"@kbn/ftr-common-functional-ui-services/*": ["packages/kbn-ftr-common-functional-ui-services/*"],
"@kbn/ftr-screenshot-filename": ["packages/kbn-ftr-screenshot-filename"],
"@kbn/ftr-screenshot-filename/*": ["packages/kbn-ftr-screenshot-filename/*"],
"@kbn/functional-with-es-ssl-cases-test-plugin": ["x-pack/test/functional_with_es_ssl/plugins/cases"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,29 @@
import { ProcessorEvent } from '@kbn/observability-plugin/common';
import { APMEventClient } from '../../lib/helpers/create_es_client/create_apm_event_client';

// Note: this logic is duplicated in tutorials/apm/envs/on_prem
export async function hasHistoricalAgentData(apmEventClient: APMEventClient) {
const hasDataInWarmOrHotDataTiers = await hasDataRequest(apmEventClient, [
'data_hot',
'data_warm',
]);

if (hasDataInWarmOrHotDataTiers) {
return true;
}

const hasDataUnbounded = await hasDataRequest(apmEventClient);

return hasDataUnbounded;
}

type DataTier = 'data_hot' | 'data_warm' | 'data_cold' | 'data_frozen';
async function hasDataRequest(
apmEventClient: APMEventClient,
dataTiers?: DataTier[]
) {
const query = dataTiers ? { terms: { _tier: dataTiers } } : undefined;

const params = {
terminate_after: 1,
apm: {
events: [
ProcessorEvent.error,
Expand All @@ -20,8 +39,10 @@ export async function hasHistoricalAgentData(apmEventClient: APMEventClient) {
],
},
body: {
terminate_after: 1,
track_total_hits: 1,
size: 0,
query,
},
};

Expand Down
Loading

0 comments on commit 08c14e5

Please sign in to comment.