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

BWC test workflow #1603

Merged
merged 2 commits into from
Feb 9, 2022
Merged

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Feb 8, 2022

Description

Adding backwards compatability workflow for OpenSearch and OpenSearch
Dashboards.

Signed-off-by: Kawika Avilla kavilla414@gmail.com

Issues Resolved

#705

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.

@kavilla kavilla requested a review from a team as a code owner February 8, 2022 04:21
@kavilla
Copy link
Member Author

kavilla commented Feb 8, 2022

Example test results:

[ unzip OpenSearch and OpenSearch Dashboards ]
[ Setup the cypress test environment ]

> cypress@5.6.0 postinstall /tmp/tmpfgsde90n/OpenSearch-Dashboards/bwc_tmp/test/node_modules/cypress
> node index.js --exec install


Cypress 5.6.0 is installed in /home/ubuntu/.cache/Cypress/5.6.0

added 222 packages from 152 contributors and audited 222 packages in 3.195s

15 packages are looking for funding
  run `npm fund` for details

found 3 moderate severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
Cypress is ready!
[ Setting up the OpenSearch environment for osd-1.1.0 ]
Data has been uploaded and ready to test
Checking the status OpenSearch...
OpenSearch is up!
Checking the OpenSearch Dashboards...
OpenSearch Dashboards is up!
[ Run the backwards compatibility tests for osd-1.1.0 ]

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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:      5.6.0                                                                            │
  │ Browser:      Electron 85 (headless)                                                           │
  │ Specs:        1 found (without-security/check_loaded_data.js)                                  │
  │ Searched:     cypress/integration/without-security/check_loaded_data.js                        │
  │ Experiments:  experimentalNetworkStubbing=true                                                 │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  without-security/check_loaded_data.js                                           (1 of 1)


  check previously loaded data
    ✓ previous loaded data should exist in dashboards (2465ms)
    Global Flight Dashboard should function properly
      ✓ Global Flight Dashboard is loaded when clicked (4762ms)
      ✓ If set filter for carrier, [Flights] Airline Carrier should show correct carrier (12069ms)
      ✓ If set filter for FlightDelayType, [Flights] Delay Type should filter out selected type (9367ms)
    eCommerce Revenue Dashboard should function properly
      ✓ eCommerce Revenue Dashboard is loaded when clicked (4820ms)
      ✓ If set filter for gender, [eCommerce] Sales by Gender should show one gender (7244ms)
      ✓ If filter out Women's Clothing, [eCommerce] Sales by Category should not show this category (7210ms)


  7 passing (49s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        7                                                                                │
  │ Passing:      7                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     49 seconds                                                                       │
  │ Spec Ran:     without-security/check_loaded_data.js                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /tmp/tmpfgsde90n/OpenSearch-Dashboards/bwc_tmp/test/cypress     (1 second)
                          /videos/without-security/check_loaded_data.js.mp4                         


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

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  without-security/check_loaded_data.      00:49        7        7        -        -        - │
  │    js                                                                                          │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:49        7        7        -        -        -  


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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:      5.6.0                                                                            │
  │ Browser:      Electron 85 (headless)                                                           │
  │ Specs:        1 found (without-security/check_timeline.js)                                     │
  │ Searched:     cypress/integration/without-security/check_timeline.js                           │
  │ Experiments:  experimentalNetworkStubbing=true                                                 │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  without-security/check_timeline.js                                              (1 of 1)


  check timeline visualization
    ✓ timeline visualizations should be saved and named correctly (3497ms)
    timeline visualizations should work properly
      ✓ .es(*, kibana1=true) should report search error (11156ms)
      ✓ .es(*, kibana=true) should not report search error (10659ms)
      ✓ .es(*, opensearchDashboards=true) should not report search error (11044ms)
      ✓ .elasticsearch(*, kibana1=true) should report search error (10912ms)
      ✓ .elasticsearch(*, kibana=true) should not report search error (10915ms)
      ✓ .elasticsearch(*, opensearchDashboards=true) should not report search error (10929ms)
      ✓ .opensearch(*, kibana1=true) should report search error (10906ms)
      ✓ .opensearch(*, kibana=true) should not report search error (11003ms)
      ✓ .opensearch(*, opensearchDashboards=true) should not report search error (10875ms)


  10 passing (2m)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        10                                                                               │
  │ Passing:      10                                                                               │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     1 minute, 42 seconds                                                             │
  │ Spec Ran:     without-security/check_timeline.js                                               │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /tmp/tmpfgsde90n/OpenSearch-Dashboards/bwc_tmp/test/cypress    (3 seconds)
                          /videos/without-security/check_timeline.js.mp4                            


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

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  without-security/check_timeline.js       01:42       10       10        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        01:42       10       10        -        -        -  


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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:      5.6.0                                                                            │
  │ Browser:      Electron 85 (headless)                                                           │
  │ Specs:        1 found (without-security/check_advanced_settings.js)                            │
  │ Searched:     cypress/integration/without-security/check_advanced_settings.js                  │
  │ Experiments:  experimentalNetworkStubbing=true                                                 │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  without-security/check_advanced_settings.js                                     (1 of 1)


  verify the advanced settings are saved
    ✓ the dark mode is on (2146ms)
    ✓ the Timeline default columns field is set to 4 (910ms)
    ✓ the Timeline Maximum buckets field is set to 4 (692ms)


  3 passing (4s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        3                                                                                │
  │ Passing:      3                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     3 seconds                                                                        │
  │ Spec Ran:     without-security/check_advanced_settings.js                                      │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /tmp/tmpfgsde90n/OpenSearch-Dashboards/bwc_tmp/test/cypress    (0 seconds)
                          /videos/without-security/check_advanced_settings.js.mp4                   


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

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  without-security/check_advanced_set      00:03        3        3        -        -        - │
  │    tings.js                                                                                    │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:03        3        3        -        -        -  


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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:      5.6.0                                                                            │
  │ Browser:      Electron 85 (headless)                                                           │
  │ Specs:        1 found (without-security/check_filter_and_query.js)                             │
  │ Searched:     cypress/integration/without-security/check_filter_and_query.js                   │
  │ Experiments:  experimentalNetworkStubbing=true                                                 │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  without-security/check_filter_and_query.js                                      (1 of 1)


  check dashboards filter and query
    osx filter and query should work in [Logs] Web Traffic dashboards
      ✓ osx filter and query should exist and be named correctly (3514ms)
      ✓ osx filter and query should function correctly (5075ms)


  2 passing (9s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        2                                                                                │
  │ Passing:      2                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     8 seconds                                                                        │
  │ Spec Ran:     without-security/check_filter_and_query.js                                       │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /tmp/tmpfgsde90n/OpenSearch-Dashboards/bwc_tmp/test/cypress    (0 seconds)
                          /videos/without-security/check_filter_and_query.js.mp4                    


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

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  without-security/check_filter_and_q      00:08        2        2        -        -        - │
  │    uery.js                                                                                     │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:08        2        2        -        -        -  


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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:      5.6.0                                                                            │
  │ Browser:      Electron 85 (headless)                                                           │
  │ Specs:        1 found (without-security/check_default_page.js)                                 │
  │ Searched:     cypress/integration/without-security/check_default_page.js                       │
  │ Experiments:  experimentalNetworkStubbing=true                                                 │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  without-security/check_default_page.js                                          (1 of 1)


  verify default landing page work for bwc
    ✓ the overview page is set as the default landing page (1718ms)


  1 passing (2s)


  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        true                                                                             │
  │ Duration:     1 second                                                                         │
  │ Spec Ran:     without-security/check_default_page.js                                           │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


  (Video)

  -  Started processing:  Compressing to 32 CRF                                                     
  -  Finished processing: /tmp/tmpfgsde90n/OpenSearch-Dashboards/bwc_tmp/test/cypress    (0 seconds)
                          /videos/without-security/check_default_page.js.mp4                        


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

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped  
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔  without-security/check_default_page      00:01        1        1        -        -        - │
  │    .js                                                                                         │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    ✔  All specs passed!                        00:01        1        1        -        -        -  

Closing the running OpenSearch
Closing any usage on port 5601

@kavilla
Copy link
Member Author

kavilla commented Feb 8, 2022

Related OpenSearch Dashboards PR: opensearch-project/OpenSearch-Dashboards#1190

@kavilla kavilla added the test label Feb 8, 2022
@kavilla kavilla linked an issue Feb 8, 2022 that may be closed by this pull request
)

def get_cmd(self, script, security, manifest_build_location):
return f"{script}"
Copy link
Member Author

Choose a reason for hiding this comment

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

This should be updated but current bwctest.sh doesn't accept other arguments: https://github.com/opensearch-project/anomaly-detection/blob/main/bwctest.sh

Adding backwards compatability workflow for OpenSearch and OpenSearch
Dashboards.

Issue:
opensearch-project#705

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

Good work!

Update READMEs wrt bwc tests soon.

with TemporaryDirectory(keep=self.args.keep, chdir=True) as work_dir:
all_results = TestSuiteResults()
for component in self.components.select(focus=self.args.component):
if component.name in self.test_manifest.components:
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR, but we do a similar workflow in many places and I don't love the double-select here, first pass --component name to pick a component, but then we also only want components that have a test configuration.

One option would be to fail if self.args.component not in self.test_manifest.components with an explicit error, and refactor components.select to take an array of components, i.e. self.components.select(focus=self.test_manifest.components).

Another, possibly better, could be to do self.components.select(focus=self.args.component, configs=self.test_manifest.components, key: "bwc_test") that would return a set of tuples of component + configuration. The code then becomes quite clean:

for component, config in self.components.select(focus=self.args.component, configs: self.test_manifest.components, key: "bwc_test"):
   test_suite = ...
   ...

Copy link
Member Author

Choose a reason for hiding this comment

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

Created a cleanup issue here: #1604 and assigned myself.

src/test_workflow/bwc_test/bwc_test_suite_opensearch.py Outdated Show resolved Hide resolved
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2022

Codecov Report

Merging #1603 (009f126) into main (37ae82f) will increase coverage by 0.01%.
The diff coverage is 95.48%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1603      +/-   ##
============================================
+ Coverage     94.50%   94.52%   +0.01%     
  Complexity       13       13              
============================================
  Files           153      162       +9     
  Lines          3296     3433     +137     
  Branches         13       21       +8     
============================================
+ Hits           3115     3245     +130     
- Misses          172      185      +13     
+ Partials          9        3       -6     
Impacted Files Coverage Δ
src/run_bwc_test.py 86.66% <85.71%> (-6.67%) ⬇️
src/test_workflow/bwc_test/bwc_test_suite.py 92.45% <91.48%> (-0.89%) ⬇️
src/test_workflow/bwc_test/bwc_test_runner.py 92.30% <92.30%> (ø)
...st_workflow/bwc_test/bwc_test_runner_opensearch.py 100.00% <100.00%> (ø)
.../bwc_test/bwc_test_runner_opensearch_dashboards.py 100.00% <100.00%> (ø)
src/test_workflow/bwc_test/bwc_test_runners.py 100.00% <100.00%> (ø)
...est_workflow/bwc_test/bwc_test_start_properties.py 100.00% <100.00%> (ø)
...w/bwc_test/bwc_test_start_properties_opensearch.py 100.00% <100.00%> (ø)
...bwc_test_start_properties_opensearch_dashboards.py 100.00% <100.00%> (ø)
...est_workflow/bwc_test/bwc_test_suite_opensearch.py 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 37ae82f...009f126. Read the comment docs.

test-configs:
- with-security
- without-security
schema-version: '1.0'
Copy link
Member

Choose a reason for hiding this comment

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

Nit; Can we move this to the top?

Or run BWC tests against an existing build.

```bash
./test.sh bwc-test manifests/1.3.0/opensearch-1.3.0-test.yml --paths opensearch=https://ci.opensearch.org/ci/dbc/bundle-build/1.2.0/869/linux/x64 # looks for https://.../builds/opensearch/manifest.yml and https://.../dist/opensearch/manifest.yml
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the great documentation

@@ -0,0 +1,39 @@
# SPDX-License-Identifier: Apache-2.0
Copy link
Member

Choose a reason for hiding this comment

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

Nit: this class is a whole lot of stuff for effectively two lines of differentiated behavior. I don't think there is an easier way but food for thought

mock_bundle_manifest = MagicMock()
mock_bundle_manifest.components = mock_components

mock_build_manifest = MagicMock()
Copy link
Member

Choose a reason for hiding this comment

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

Nit; Looks like you setup mock manifests a couple of times over, might be worthwhile to add MockBuildManifest/MockTestManifest that could condense these unit tests, or at least let them reuse the same setup logic

Copy link
Member

Choose a reason for hiding this comment

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

Note; even if they used a 'canned' construction pattern and then you modified them afterward to fit one test or another that could be useful

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

Great contribution!

We've got an outstanding item #1512 to make sure the test workflows have typing information - do you think you could see about adding in typing info in your new classes? If you'd like to pickup that issue separately that works for me too.

@kavilla
Copy link
Member Author

kavilla commented Feb 9, 2022

@peternied

Great contribution!

We've got an outstanding item #1512 to make sure the test workflows have typing information - do you think you could see about adding in typing info in your new classes? If you'd like to pickup that issue separately that works for me too.

Not sure what you quiet mean here. Do you have an example? If it requires updates, then probably will need to do this in the integ tests as well. Which might be beneficial to create another clean up task that I can do to get the bwc tests and integ tests aligned.

@peternied peternied merged commit 0a20ec1 into opensearch-project:main Feb 9, 2022
@peternied
Copy link
Member

I've merged your change, checkout issue #1237 for a detailed explanation with some example PRs

@kavilla
Copy link
Member Author

kavilla commented Feb 9, 2022

I've merged your change, checkout issue #1237 for a detailed explanation with some example PRs

Will do and will handle some of the clean ups you suggested

@kavilla kavilla deleted the avillk/bwc_test branch February 9, 2022 02:50
peterzhuamazon pushed a commit to peterzhuamazon/opensearch-build that referenced this pull request Feb 16, 2022
* BWC test workflow

Adding backwards compatability workflow for OpenSearch and OpenSearch
Dashboards.

Issue:
opensearch-project#705

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>

* [BWC] Update docs and return cmd

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dashboards automate backwards compatibility tests
4 participants