Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update getDetectors URL to match recent API changes #1257

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

kaituo
Copy link
Contributor

@kaituo kaituo commented Apr 30, 2024

Description

This PR addresses a test failure caused by the recent update of the listing detectors URL from '/detectors' to '/detectors/_list' as implemented in server/routes/ad.ts. The change was introduced in opensearch-project/anomaly-detection-dashboards-plugin#739. Previously, the tests in dashboard_spec.js and detector_list_spec.js were failing because they were waiting for requests to BASE_AD_NODE_API_PATH + '/detectors*', which no longer exists due to the URL update.

Testing:

  • Successfully ran all tests in dashboard_spec.js and detector_list_spec.js to ensure that they now correctly interact with the updated URL.

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.

This PR addresses a test failure caused by the recent update of the listing detectors URL from '/detectors' to '/detectors/_list' as implemented in server/routes/ad.ts. The change was introduced in opensearch-project/anomaly-detection-dashboards-plugin#739. Previously, the tests in `dashboard_spec.js` and `detector_list_spec.js` were failing because they were waiting for requests to `BASE_AD_NODE_API_PATH + '/detectors*'`, which no longer exists due to the URL update.

Testing:
- Successfully ran all tests in `dashboard_spec.js` and `detector_list_spec.js` to ensure that they now correctly interact with the updated URL.

Signed-off-by: Kaituo Li <[email protected]>
@kaituo
Copy link
Contributor Author

kaituo commented Apr 30, 2024

@kaituo
Copy link
Contributor Author

kaituo commented Apr 30, 2024

Local run:


(base) kaituo@88665a53bc93 opensearch-dashboards-functional-test % yarn cypress:run-without-security --browser electron --spec cypress/integration/plugins/anomaly-detection-dashboards-plugin/detector_list_spec.js
Couldn't determine Mocha version

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.5.4                                                                          │
  │ Browser:        Electron 94 (headless)                                                         │
  │ Node Version:   v18.19.0 (/Users/kaituo/.nvm/versions/node/v18.19.0/bin/node)                  │
  │ Specs:          1 found (plugins/anomaly-detection-dashboards-plugin/detector_list_spec.js)    │
  │ Searched:       cypress/integration/plugins/anomaly-detection-dashboards-plugin/detector_list_ │
  │                 spec.js                                                                        │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  plugins/anomaly-detection-dashboards-plugin/detector_list_spec.js               (1 of 1)
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Couldn't determine Mocha version


  Detector list page
    ✓ Empty - no detector index (6876ms)
    ✓ Empty - empty detector index
    ✓ Non-empty - single stopped detector
    ✓ Non-empty - multiple detectors
    ✓ Redirect to create detector
    ✓ Start single detector
    ✓ Stop single detector
    ✓ Delete single detector
    ✓ Filter by detector search
    ✓ Filter by detector state
    ✓ Filter by index


  11 passing (31s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        11                                                                               │
  │ Passing:      11                                                                               │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     31 seconds                                                                       │
  │ Spec Ran:     plugins/anomaly-detection-dashboards-plugin/detector_list_spec.js                │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF
  -  Finished processing: /Users/kaituo/code/github/opensearch-dashboards-functional-    (3 seconds)
                          test/cypress/videos/plugins/anomaly-detection-dashboards-pl
                          ugin/detector_list_spec.js.mp4


====================================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  plugins/anomaly-detection-dashboard      00:31       11       11        -        -        - │
  │    s-plugin/detector_list_spec.js                                                              │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:31       11       11        -        -        -



(base) kaituo@88665a53bc93 opensearch-dashboards-functional-test % yarn cypress:run-without-security --browser electron --spec cypress/integration/plugins/anomaly-detection-dashboards-plugin/dashboard_spec.js
Couldn't determine Mocha version

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        9.5.4                                                                          │
  │ Browser:        Electron 94 (headless)                                                         │
  │ Node Version:   v18.19.0 (/Users/kaituo/.nvm/versions/node/v18.19.0/bin/node)                  │
  │ Specs:          1 found (plugins/anomaly-detection-dashboards-plugin/dashboard_spec.js)        │
  │ Searched:       cypress/integration/plugins/anomaly-detection-dashboards-plugin/dashboard_spec │
  │                 .js                                                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────

  Running:  plugins/anomaly-detection-dashboards-plugin/dashboard_spec.js                   (1 of 1)
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db

Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
Couldn't determine Mocha version


  AD Dashboard page
    ✓ Empty - no detector index (6042ms)
    ✓ Empty - empty detector index
    ✓ Non-empty - single running detector
    ✓ Redirect to create detector page
    ✓ Filter by detector
    ✓ Filter by detector state
    ✓ Filter by index
    ✓ Enter and exit full screen


  8 passing (21s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        8                                                                                │
  │ Passing:      8                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     21 seconds                                                                       │
  │ Spec Ran:     plugins/anomaly-detection-dashboards-plugin/dashboard_spec.js                    │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF
  -  Finished processing: /Users/kaituo/code/github/opensearch-dashboards-functional-    (2 seconds)
                          test/cypress/videos/plugins/anomaly-detection-dashboards-pl
                          ugin/dashboard_spec.js.mp4


====================================================================================================

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  plugins/anomaly-detection-dashboard      00:21        8        8        -        -        - │
  │    s-plugin/dashboard_spec.js                                                                  │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:21        8        8        -        -        -

@kavilla kavilla merged commit c4c515d into opensearch-project:main Apr 30, 2024
39 of 40 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 30, 2024
This PR addresses a test failure caused by the recent update of the listing detectors URL from '/detectors' to '/detectors/_list' as implemented in server/routes/ad.ts. The change was introduced in opensearch-project/anomaly-detection-dashboards-plugin#739. Previously, the tests in `dashboard_spec.js` and `detector_list_spec.js` were failing because they were waiting for requests to `BASE_AD_NODE_API_PATH + '/detectors*'`, which no longer exists due to the URL update.

Testing:
- Successfully ran all tests in `dashboard_spec.js` and `detector_list_spec.js` to ensure that they now correctly interact with the updated URL.

Signed-off-by: Kaituo Li <[email protected]>
(cherry picked from commit c4c515d)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 30, 2024
This PR addresses a test failure caused by the recent update of the listing detectors URL from '/detectors' to '/detectors/_list' as implemented in server/routes/ad.ts. The change was introduced in opensearch-project/anomaly-detection-dashboards-plugin#739. Previously, the tests in `dashboard_spec.js` and `detector_list_spec.js` were failing because they were waiting for requests to `BASE_AD_NODE_API_PATH + '/detectors*'`, which no longer exists due to the URL update.

Testing:
- Successfully ran all tests in `dashboard_spec.js` and `detector_list_spec.js` to ensure that they now correctly interact with the updated URL.

Signed-off-by: Kaituo Li <[email protected]>
(cherry picked from commit c4c515d)
kavilla pushed a commit that referenced this pull request Apr 30, 2024
This PR addresses a test failure caused by the recent update of the listing detectors URL from '/detectors' to '/detectors/_list' as implemented in server/routes/ad.ts. The change was introduced in opensearch-project/anomaly-detection-dashboards-plugin#739. Previously, the tests in `dashboard_spec.js` and `detector_list_spec.js` were failing because they were waiting for requests to `BASE_AD_NODE_API_PATH + '/detectors*'`, which no longer exists due to the URL update.

Testing:
- Successfully ran all tests in `dashboard_spec.js` and `detector_list_spec.js` to ensure that they now correctly interact with the updated URL.

Signed-off-by: Kaituo Li <[email protected]>
(cherry picked from commit c4c515d)

Co-authored-by: Kaituo Li <[email protected]>
kavilla pushed a commit that referenced this pull request Apr 30, 2024
This PR addresses a test failure caused by the recent update of the listing detectors URL from '/detectors' to '/detectors/_list' as implemented in server/routes/ad.ts. The change was introduced in opensearch-project/anomaly-detection-dashboards-plugin#739. Previously, the tests in `dashboard_spec.js` and `detector_list_spec.js` were failing because they were waiting for requests to `BASE_AD_NODE_API_PATH + '/detectors*'`, which no longer exists due to the URL update.

Testing:
- Successfully ran all tests in `dashboard_spec.js` and `detector_list_spec.js` to ensure that they now correctly interact with the updated URL.

Signed-off-by: Kaituo Li <[email protected]>
(cherry picked from commit c4c515d)

Co-authored-by: Kaituo Li <[email protected]>
kaituo added a commit to kaituo/anomaly-detection-dashboards-plugin that referenced this pull request Apr 30, 2024
The introduction of `sleep` between test runs in `dashboard_spec.js` and `detector_list_spec.js` was initially implemented to handle timing issues. However, these tests were actually failing due to a recent URL change, as detailed in opensearch-project/opensearch-dashboards-functional-test#1257.

With the root cause of the failures addressed, the delays introduced by `sleep` commands are now redundant and can potentially slow down the testing process without providing any benefit. This PR removes these unnecessary sleep intervals between test executions.

**Testing Done:**
- Confirmed that all remote Cypress tests pass without the sleep intervals.

Signed-off-by: Kaituo Li <[email protected]>
kaituo added a commit to kaituo/anomaly-detection-dashboards-plugin that referenced this pull request Apr 30, 2024
The introduction of `sleep` between test runs in `dashboard_spec.js` and `detector_list_spec.js` was initially implemented to handle timing issues. However, these tests were actually failing due to a recent URL change, as detailed in opensearch-project/opensearch-dashboards-functional-test#1257.

With the root cause of the failures addressed, the delays introduced by `sleep` commands are now redundant and can potentially slow down the testing process without providing any benefit. This PR removes these unnecessary sleep intervals between test executions.

**Testing Done:**
- Confirmed that all remote Cypress tests pass without the sleep intervals.

Signed-off-by: Kaituo Li <[email protected]>
kaituo added a commit to kaituo/anomaly-detection-dashboards-plugin that referenced this pull request May 1, 2024
The introduction of `sleep` between test runs in `dashboard_spec.js` and `detector_list_spec.js` was initially implemented to handle timing issues. However, these tests were actually failing due to a recent URL change, as detailed in opensearch-project/opensearch-dashboards-functional-test#1257.

With the root cause of the failures addressed, the delays introduced by `sleep` commands are now redundant and can potentially slow down the testing process without providing any benefit. This PR removes these unnecessary sleep intervals between test executions.

**Testing Done:**
- Confirmed that all remote Cypress tests pass without the sleep intervals.

Signed-off-by: Kaituo Li <[email protected]>
dbwiddis pushed a commit to opensearch-project/anomaly-detection-dashboards-plugin that referenced this pull request May 1, 2024
The introduction of `sleep` between test runs in `dashboard_spec.js` and `detector_list_spec.js` was initially implemented to handle timing issues. However, these tests were actually failing due to a recent URL change, as detailed in opensearch-project/opensearch-dashboards-functional-test#1257.

With the root cause of the failures addressed, the delays introduced by `sleep` commands are now redundant and can potentially slow down the testing process without providing any benefit. This PR removes these unnecessary sleep intervals between test executions.

**Testing Done:**
- Confirmed that all remote Cypress tests pass without the sleep intervals.

Signed-off-by: Kaituo Li <[email protected]>
opensearch-trigger-bot bot pushed a commit to opensearch-project/anomaly-detection-dashboards-plugin that referenced this pull request May 1, 2024
The introduction of `sleep` between test runs in `dashboard_spec.js` and `detector_list_spec.js` was initially implemented to handle timing issues. However, these tests were actually failing due to a recent URL change, as detailed in opensearch-project/opensearch-dashboards-functional-test#1257.

With the root cause of the failures addressed, the delays introduced by `sleep` commands are now redundant and can potentially slow down the testing process without providing any benefit. This PR removes these unnecessary sleep intervals between test executions.

**Testing Done:**
- Confirmed that all remote Cypress tests pass without the sleep intervals.

Signed-off-by: Kaituo Li <[email protected]>
(cherry picked from commit e509a03)
opensearch-trigger-bot bot pushed a commit to opensearch-project/anomaly-detection-dashboards-plugin that referenced this pull request May 1, 2024
The introduction of `sleep` between test runs in `dashboard_spec.js` and `detector_list_spec.js` was initially implemented to handle timing issues. However, these tests were actually failing due to a recent URL change, as detailed in opensearch-project/opensearch-dashboards-functional-test#1257.

With the root cause of the failures addressed, the delays introduced by `sleep` commands are now redundant and can potentially slow down the testing process without providing any benefit. This PR removes these unnecessary sleep intervals between test executions.

**Testing Done:**
- Confirmed that all remote Cypress tests pass without the sleep intervals.

Signed-off-by: Kaituo Li <[email protected]>
(cherry picked from commit e509a03)
dbwiddis pushed a commit to opensearch-project/anomaly-detection-dashboards-plugin that referenced this pull request May 1, 2024
The introduction of `sleep` between test runs in `dashboard_spec.js` and `detector_list_spec.js` was initially implemented to handle timing issues. However, these tests were actually failing due to a recent URL change, as detailed in opensearch-project/opensearch-dashboards-functional-test#1257.

With the root cause of the failures addressed, the delays introduced by `sleep` commands are now redundant and can potentially slow down the testing process without providing any benefit. This PR removes these unnecessary sleep intervals between test executions.

**Testing Done:**
- Confirmed that all remote Cypress tests pass without the sleep intervals.

Signed-off-by: Kaituo Li <[email protected]>
(cherry picked from commit e509a03)

Co-authored-by: Kaituo Li <[email protected]>
dbwiddis pushed a commit to opensearch-project/anomaly-detection-dashboards-plugin that referenced this pull request May 1, 2024
The introduction of `sleep` between test runs in `dashboard_spec.js` and `detector_list_spec.js` was initially implemented to handle timing issues. However, these tests were actually failing due to a recent URL change, as detailed in opensearch-project/opensearch-dashboards-functional-test#1257.

With the root cause of the failures addressed, the delays introduced by `sleep` commands are now redundant and can potentially slow down the testing process without providing any benefit. This PR removes these unnecessary sleep intervals between test executions.

**Testing Done:**
- Confirmed that all remote Cypress tests pass without the sleep intervals.

Signed-off-by: Kaituo Li <[email protected]>
(cherry picked from commit e509a03)

Co-authored-by: Kaituo Li <[email protected]>
LDrago27 pushed a commit to LDrago27/opensearch-dashboards-functional-test that referenced this pull request May 3, 2024
…ct#1257)

This PR addresses a test failure caused by the recent update of the listing detectors URL from '/detectors' to '/detectors/_list' as implemented in server/routes/ad.ts. The change was introduced in opensearch-project/anomaly-detection-dashboards-plugin#739. Previously, the tests in `dashboard_spec.js` and `detector_list_spec.js` were failing because they were waiting for requests to `BASE_AD_NODE_API_PATH + '/detectors*'`, which no longer exists due to the URL update.

Testing:
- Successfully ran all tests in `dashboard_spec.js` and `detector_list_spec.js` to ensure that they now correctly interact with the updated URL.

Signed-off-by: Kaituo Li <[email protected]>
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.

3 participants