mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[ML] AIOps: Fix relative time bound support in the chart preview (#160121)
## Summary - Fixes relative time range support in the Change Point Detection UI. - Enables functional tests (resolves https://github.com/elastic/kibana/issues/158851) ### Checklist - [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
This commit is contained in:
parent
924da11c89
commit
d7b2a52e42
3 changed files with 4 additions and 4 deletions
|
@ -120,7 +120,7 @@ export const ChangePointDetectionContextProvider: FC = ({ children }) => {
|
|||
>({});
|
||||
const [bucketInterval, setBucketInterval] = useState<TimeBucketsInterval>();
|
||||
|
||||
const timeRange = useTimeRangeUpdates();
|
||||
const timeRange = useTimeRangeUpdates(true);
|
||||
|
||||
useEffect(function updateIntervalOnTimeBoundsChange() {
|
||||
const timeUpdateSubscription = timefilter
|
||||
|
|
|
@ -30,7 +30,7 @@ export const useCommonChartProps = ({
|
|||
annotation: ChangePointAnnotation;
|
||||
previewMode?: boolean;
|
||||
}): Partial<TypedLensByValueInput> => {
|
||||
const timeRange = useTimeRangeUpdates();
|
||||
const timeRange = useTimeRangeUpdates(true);
|
||||
const { dataView } = useDataSource();
|
||||
const { bucketInterval, resultQuery, resultFilters } = useChangePointDetectionContext();
|
||||
|
||||
|
|
|
@ -16,8 +16,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
// aiops lives in the ML UI so we need some related services.
|
||||
const ml = getService('ml');
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/158851
|
||||
describe.skip('change point detection', async function () {
|
||||
describe('change point detection', async function () {
|
||||
before(async () => {
|
||||
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce');
|
||||
await ml.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date');
|
||||
|
@ -64,6 +63,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
|
|||
await aiops.changePointDetectionPage.clickUseFullDataButton();
|
||||
await aiops.changePointDetectionPage.selectMetricField(0, 'products.discount_amount');
|
||||
await aiops.changePointDetectionPage.selectSplitField(0, 'geoip.city_name');
|
||||
await aiops.changePointDetectionPage.getTable(0).waitForTableToLoad();
|
||||
const result = await aiops.changePointDetectionPage.getTable(0).parseTable();
|
||||
expect(result.length).to.eql(5);
|
||||
// assert asc sorting by p_value is applied
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue