Skip to content

Commit

Permalink
[Security Solution] Integration tests for multi line string field dif…
Browse files Browse the repository at this point in the history
…f algorithm (elastic#188688)

## Summary

Completes elastic#180159

Switches fields to use the multi line string diff algorithm assigned to
them in the [overarching
ticket](elastic#180159 (comment))

Adds integration tests in accordance to
elastic#188323 for the `upgrade/_review`
API endpoint for the multi line string field diff algorithm.


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed


### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
  • Loading branch information
dplumlee committed Jul 26, 2024
1 parent 2d83c0e commit 5817a9c
Show file tree
Hide file tree
Showing 3 changed files with 393 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import type { ThreeVersionsOf } from '../../../../../../../common/api/detection_
import { MissingVersion } from '../../../../../../../common/api/detection_engine/prebuilt_rules/model/diff/three_way_diff/three_way_diff';
import { calculateFieldsDiffFor } from './diff_calculation_helpers';
import {
multiLineStringDiffAlgorithm,
numberDiffAlgorithm,
scalarArrayDiffAlgorithm,
simpleDiffAlgorithm,
Expand Down Expand Up @@ -176,16 +177,16 @@ const commonFieldsDiffAlgorithms: FieldsDiffAlgorithmsFor<DiffableCommonFields>
version: numberDiffAlgorithm,
name: singleLineStringDiffAlgorithm,
tags: scalarArrayDiffAlgorithm,
description: simpleDiffAlgorithm,
description: multiLineStringDiffAlgorithm,
severity: singleLineStringDiffAlgorithm,
severity_mapping: simpleDiffAlgorithm,
risk_score: numberDiffAlgorithm,
risk_score_mapping: simpleDiffAlgorithm,
references: scalarArrayDiffAlgorithm,
false_positives: simpleDiffAlgorithm,
threat: simpleDiffAlgorithm,
note: simpleDiffAlgorithm,
setup: simpleDiffAlgorithm,
note: multiLineStringDiffAlgorithm,
setup: multiLineStringDiffAlgorithm,
related_integrations: simpleDiffAlgorithm,
required_fields: simpleDiffAlgorithm,
author: scalarArrayDiffAlgorithm,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export default ({ loadTestFile }: FtrProviderContext): void => {
loadTestFile(require.resolve('./upgrade_review_prebuilt_rules.number_fields'));
loadTestFile(require.resolve('./upgrade_review_prebuilt_rules.single_line_string_fields'));
loadTestFile(require.resolve('./upgrade_review_prebuilt_rules.scalar_array_fields'));
loadTestFile(require.resolve('./upgrade_review_prebuilt_rules.multi_line_string_fields'));
loadTestFile(require.resolve('./upgrade_review_prebuilt_rules.stats'));
});
};
Loading

0 comments on commit 5817a9c

Please sign in to comment.