Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution][Endpoint] Unskip metadata API ftr test #167226

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion x-pack/test/common/services/ingest_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* 2.0.
*/

import { fleetSetupRouteService } from '@kbn/fleet-plugin/common';
import { API_VERSIONS, fleetSetupRouteService } from '@kbn/fleet-plugin/common';
import { ELASTIC_HTTP_VERSION_HEADER } from '@kbn/core-http-common';
import { FtrProviderContext } from '../ftr_provider_context';

export function IngestManagerProvider({ getService }: FtrProviderContext) {
Expand All @@ -18,6 +19,7 @@ export function IngestManagerProvider({ getService }: FtrProviderContext) {
await retry.try(async () => {
await supertest
.post(fleetSetupRouteService.postFleetSetupPath())
.set(ELASTIC_HTTP_VERSION_HEADER, API_VERSIONS.public.v1)
.set(headers)
.send({ forceRecreate: true })
.expect(200);
Expand Down
8 changes: 6 additions & 2 deletions x-pack/test/security_solution_endpoint_api_int/apis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { getRegistryUrl as getRegistryUrlFromIngest } from '@kbn/fleet-plugin/server';
import { FtrProviderContext } from '../ftr_provider_context';
import { isRegistryEnabled, getRegistryUrlFromTestEnv } from '../registry';
import { getRegistryUrlFromTestEnv, isRegistryEnabled } from '../registry';
import { ROLE } from '../services/roles_users';

export default function endpointAPIIntegrationTests(providerContext: FtrProviderContext) {
Expand All @@ -28,7 +28,11 @@ export default function endpointAPIIntegrationTests(providerContext: FtrProvider

const roles = Object.values(ROLE);
before(async () => {
await ingestManager.setup();
try {
await ingestManager.setup();
} catch (err) {
log.warning(`Error setting up ingestManager: ${err}`);
}

// create role/user
for (const role of roles) {
Expand Down
19 changes: 9 additions & 10 deletions x-pack/test/security_solution_endpoint_api_int/apis/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { v4 as uuidv4 } from 'uuid';
import expect from '@kbn/expect';
import { TransformGetTransformStatsTransformStats } from '@elastic/elasticsearch/lib/api/types';
import {
METADATA_DATASTREAM,
ENDPOINT_DEFAULT_SORT_DIRECTION,
ENDPOINT_DEFAULT_SORT_FIELD,
HOST_METADATA_LIST_ROUTE,
METADATA_DATASTREAM,
METADATA_TRANSFORMS_STATUS_ROUTE,
METADATA_UNITED_INDEX,
METADATA_UNITED_TRANSFORM,
METADATA_TRANSFORMS_STATUS_ROUTE,
metadataTransformPrefix,
ENDPOINT_DEFAULT_SORT_FIELD,
ENDPOINT_DEFAULT_SORT_DIRECTION,
} from '@kbn/security-solution-plugin/common/endpoint/constants';
import { AGENTS_INDEX } from '@kbn/fleet-plugin/common';
import { indexFleetEndpointPolicy } from '@kbn/security-solution-plugin/common/endpoint/data_loaders/index_fleet_endpoint_policy';
Expand All @@ -29,22 +29,21 @@ import {
} from '@kbn/security-solution-plugin/common/endpoint/types';
import { generateAgentDocs, generateMetadataDocs } from './metadata.fixtures';
import {
bulkIndex,
deleteAllDocsFromFleetAgents,
deleteAllDocsFromIndex,
deleteAllDocsFromMetadataCurrentIndex,
deleteAllDocsFromMetadataDatastream,
stopTransform,
startTransform,
deleteAllDocsFromFleetAgents,
deleteAllDocsFromIndex,
bulkIndex,
stopTransform,
} from './data_stream_helper';
import { FtrProviderContext } from '../ftr_provider_context';

export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
const endpointTestResources = getService('endpointTestResources');

// Failing: See https://github.com/elastic/kibana/issues/151854
describe.skip('test metadata apis', () => {
describe('test metadata apis', () => {
describe('list endpoints GET route', () => {
const numberOfHostsInFixture = 2;
let agent1Timestamp: number;
Expand Down