Skip to content

Commit

Permalink
[Alerts] Fixing skipped unit tests for metric threshold rule
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Jul 18, 2023
1 parent 5a7f395 commit 1a7ddb3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const setEvaluationResults = (response: Array<Record<string, Evaluation>>) => {
};

// FAILING: https://github.com/elastic/kibana/issues/155534
describe.skip('The metric threshold alert type', () => {
describe('The metric threshold alert type', () => {
describe('querying the entire infrastructure', () => {
afterAll(() => clearInstances());
const instanceID = '*';
Expand Down Expand Up @@ -1401,7 +1401,7 @@ describe.skip('The metric threshold alert type', () => {
await execute(true);
const recentAction = mostRecentAction(instanceID);
expect(recentAction.action).toEqual({
alertDetailsUrl: 'http://localhost:5601/app/observability/alerts/mock-alert-uuid',
alertDetailsUrl: '',
alertState: 'NO DATA',
group: '*',
groupByKeys: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ export const createMetricThresholdExecutor = (libs: InfraBackendLibs) =>
);

const evaluationValues = alertResults.reduce((acc: Array<number | null>, result) => {
acc.push(result[group].currentValue);
if (result[group]) {
acc.push(result[group].currentValue);
}
return acc;
}, []);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,7 @@ describe.skip('The metric threshold alert type', () => {
await execute(true);
const recentAction = mostRecentAction(instanceID);
expect(recentAction.action).toEqual({
alertDetailsUrl: 'http://localhost:5601/app/observability/alerts/mock-alert-uuid',
alertDetailsUrl: '',
alertState: 'NO DATA',
group: '*',
groupByKeys: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ export const createMetricThresholdExecutor = ({
);

const evaluationValues = alertResults.reduce((acc: Array<number | null>, result) => {
acc.push(result[group].currentValue);
if (result[group]) {
acc.push(result[group].currentValue);
}
return acc;
}, []);

Expand Down

0 comments on commit 1a7ddb3

Please sign in to comment.