Skip to content

Commit

Permalink
Fixing a checktype issue
Browse files Browse the repository at this point in the history
  • Loading branch information
achyutjhunjhunwala committed Jul 4, 2024
1 parent c35518e commit b15f822
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 31 deletions.
4 changes: 2 additions & 2 deletions x-pack/test/dataset_quality_api_integration/common/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import { createDatasetQualityApiClient } from './dataset_quality_api_supertest';
import { RegistryProvider } from './registry';
import { DatasetQualityFtrConfigName } from '../configs';
import { PackageService } from './integration_service';
import { PackageService } from './package_service';

export interface DatasetQualityFtrConfig {
name: DatasetQualityFtrConfigName;
Expand Down Expand Up @@ -71,7 +71,7 @@ export interface CreateTest {
context: InheritedFtrProviderContext
) => Promise<LogsSynthtraceEsClient>;
datasetQualityApiClient: (context: InheritedFtrProviderContext) => DatasetQualityApiClient;
packageService: PackageService;
packageService: ({ getService }: FtrProviderContext) => ReturnType<typeof PackageService>;
};
junit: { reportName: string };
esTestCluster: any;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* 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.
*/

import { FtrProviderContext } from './ftr_provider_context';

interface IntegrationPackage {
name: string;
version: string;
}

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

function uninstallPackage({ name, version }: IntegrationPackage) {
return supertest.delete(`/api/fleet/epm/packages/${name}/${version}`).set('kbn-xsrf', 'xxxx');
}

function installPackage({ name, version }: IntegrationPackage) {
return supertest
.post(`/api/fleet/epm/packages/${name}/${version}`)
.set('kbn-xsrf', 'xxxx')
.send({ force: true });
}

return { uninstallPackage, installPackage };
}

0 comments on commit b15f822

Please sign in to comment.