Skip to content

forecasting IT - #1811

Merged
CCongWang merged 2 commits into
opensearch-project:mainfrom
kaituo:forecasting
Jul 21, 2025
Merged

forecasting IT#1811
CCongWang merged 2 commits into
opensearch-project:mainfrom
kaituo:forecasting

Conversation

@kaituo

@kaituo kaituo commented Jul 15, 2025

Copy link
Copy Markdown
Contributor

Description

This PR adds cypress tests for https://docs.opensearch.org/docs/latest/observing-your-data/forecast/index/

  • create_forecaster_spec – happy-path creation against local index with history/interval validation.
  • create_remote_forecaster_spec – build a forecaster from a remote cluster index, bootstrapping the cross-cluster connection.
  • custom_flattened_forecaster_spec – verify custom flattened result index end-to-end, polling until data lands.
  • daily_forecaster_spec – daily-interval forecaster creation, chart pan/zoom controls and date-range checks.
  • forecaster_configuration_spec – edit settings (add category field), guardrail validation, re-run dry-run test, then delete.
  • forecaster_list_spec – list-page flows: create → start/stop → filter/search → delete a forecaster.
  • forecaster_list_spec_mock – mocked path for “cancel forecast” on an errored forecaster.
  • top_forecaster_spec – exercise Top-Forecaster API and split-series custom query filtering.

Adds shared fixtures (sample forecast data & mocked API payloads) and utility commands under cypress/utils.

Issues Resolved

[List any issues this PR will resolve]

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Kaituo Li <kaituo@amazon.com>
const fullVersion = response.body.version.number;
const majorMinorVersion = fullVersion.split('.').slice(0, 2).join('.');

if (majorMinorVersion !== '3.1') {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean the test will need to be updated could this use some check to make sure it's greater than or equal to 3.1? or is this just temporary?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to make sure it's greater than or equal to 3.1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing for this pr. but we should consider zipping up this files in the future and creating a helper function to unzip and install (if it's not there already). like i said nothing for this pr.

Comment thread cypress/utils/commands.js
});
});

Cypress.Commands.add('setAbsoluteDate', (startDate, endDate) => {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This functions assumes existence of querySubmitButton, which is optional and does not exist in forecasting detail page.

Comment thread cypress/utils/commands.js Outdated
cy.getElementByTestId('superDatePickerApplyTimeButton').click();

// Wait for the chart to reload with the new data
cy.contains('Loading forecast results...', { timeout: 180000 }).should(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems only relevant to forecasting but setabsolutedate is too broad. if another plugin was to use it their test will fail if not present

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I took it out.

@kavilla kavilla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving. i think we should consider using the library for the date range. and remove the global function.

Signed-off-by: Kaituo Li <kaituo@amazon.com>
@CCongWang
CCongWang merged commit a48f8ee into opensearch-project:main Jul 21, 2025
50 checks passed
opensearch-trigger-bot Bot pushed a commit that referenced this pull request Jul 21, 2025
* forecasting IT

Signed-off-by: Kaituo Li <kaituo@amazon.com>

* address comments

Signed-off-by: Kaituo Li <kaituo@amazon.com>

---------

Signed-off-by: Kaituo Li <kaituo@amazon.com>
(cherry picked from commit a48f8ee)
kavilla pushed a commit that referenced this pull request Jul 21, 2025
* forecasting IT



* address comments



---------


(cherry picked from commit a48f8ee)

Signed-off-by: Kaituo Li <kaituo@amazon.com>
Co-authored-by: Kaituo Li <kaituo@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants