mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Uptime] Un-skip rest api test (#137676)
This commit is contained in:
parent
5f27051c31
commit
40ce451d72
6 changed files with 3 additions and 10 deletions
|
@ -29,7 +29,6 @@ export const SummaryType = t.partial({
|
|||
|
||||
export const StatesIndexStatusType = t.type({
|
||||
indexExists: t.boolean,
|
||||
docCount: t.number,
|
||||
indices: t.string,
|
||||
});
|
||||
|
||||
|
|
|
@ -20,11 +20,10 @@ describe('fetch saga effect factory', () => {
|
|||
it('works with success workflow', () => {
|
||||
const indexStatusResult = {
|
||||
indexExists: true,
|
||||
docCount: 2712532,
|
||||
indices: 'heartbeat-*,synthetics-*',
|
||||
};
|
||||
const fetchStatus = async (): Promise<StatesIndexStatus> => {
|
||||
return { indexExists: true, docCount: 2712532, indices: 'heartbeat-*,synthetics-*' };
|
||||
return { indexExists: true, indices: 'heartbeat-*,synthetics-*' };
|
||||
};
|
||||
fetchEffect = fetchEffectFactory(
|
||||
fetchStatus,
|
||||
|
|
|
@ -122,7 +122,7 @@ export class UptimePlugin
|
|||
hasData: async () => {
|
||||
const dataHelper = await getUptimeDataHelper();
|
||||
const status = await dataHelper.indexStatus();
|
||||
return { hasData: status.docCount > 0, indices: status.indices };
|
||||
return { hasData: status.indexExists, indices: status.indices };
|
||||
},
|
||||
fetchData: async (params: FetchDataParams) => {
|
||||
const dataHelper = await getUptimeDataHelper();
|
||||
|
|
|
@ -17,14 +17,12 @@ export const getIndexStatus: UMElasticsearchQueryFn<{}, StatesIndexStatus> = asy
|
|||
result: {
|
||||
body: {
|
||||
_shards: { total },
|
||||
count,
|
||||
},
|
||||
},
|
||||
} = await uptimeEsClient.count({ terminate_after: 1 });
|
||||
return {
|
||||
indices,
|
||||
indexExists: total > 0,
|
||||
docCount: count,
|
||||
};
|
||||
} catch (e) {
|
||||
if (e.meta.statusCode === 404) {
|
||||
|
@ -32,7 +30,6 @@ export const getIndexStatus: UMElasticsearchQueryFn<{}, StatesIndexStatus> = asy
|
|||
return {
|
||||
indices: '',
|
||||
indexExists: false,
|
||||
docCount: 0,
|
||||
};
|
||||
}
|
||||
throw e;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
"indexExists": true,
|
||||
"docCount": 1,
|
||||
"indices": "heartbeat-8*,heartbeat-7*,synthetics-*"
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
|
|||
import { expectFixtureEql } from './helper/expect_fixture_eql';
|
||||
|
||||
export default function ({ getService }: FtrProviderContext) {
|
||||
// Failing ES Promotion: https://github.com/elastic/kibana/issues/136412
|
||||
describe.skip('docCount query', () => {
|
||||
describe('indexStatus query', () => {
|
||||
const supertest = getService('supertest');
|
||||
|
||||
it(`will fetch the index's count`, async () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue