Skip to content

Commit 88cf75c

Browse files
committed
[Backwards Compatibility] update instructions in TESTING.md
fix PR comments Partially Resolved: opensearch-project/opensearch-build#705 Signed-off-by: Anan Zhuang <[email protected]>
1 parent 2d44dab commit 88cf75c

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

TESTING.md

+19-5
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@ Overview
66
- [Unit tests](#unit-tests)
77
- [Integration tests](#integration-tests)
88
- [Functional tests](#functional-tests)
9+
- [Backwards Compatibility tests](#backwards-compatibility-tests)
910
- [Continuous Integration](#continuous-integration)
1011
- [Environment misc](#environment-misc)
1112
- [Misc](#misc)
1213

1314
# General information
14-
OpenSearch Dashboards uses [Jest](https://jestjs.io/) for unit and integration tests and [Selenium](https://www.selenium.dev/) for functional tests.
15+
OpenSearch Dashboards uses [Jest](https://jestjs.io/) for unit and integration tests, [Selenium](https://www.selenium.dev/) for functional tests, and [Cypress](https://www.cypress.io/) for backwards compatibility tests.
1516

16-
In general, we recommend three tiers of tests:
17+
In general, we recommend four tiers of tests:
1718
* Unit tests: Unit tests: small and modular tests that utilize mocks for external dependencies.
1819
* Integration tests: higher-level tests that verify interactions between systems (eg. HTTP APIs, OpenSearch API calls, calling other plugin).
1920
* End-to-end tests (e2e): functional tests that verify behavior in a web browser.
21+
* Backwards Compatibility tests: cypress tests that verify any changes are backwards compatible with previous versions.
2022

2123
# Requirements
2224
* Install the latest NodeJS, [NPM](https://www.npmjs.com/get-npm) and [Yarn](https://classic.yarnpkg.com/en/docs/install/#mac-stable)
@@ -48,7 +50,20 @@ To debug functional tests:
4850
Say that you would want to debug a test in CI group 1, you can run the following command in your environment:
4951
`node --debug-brk --inspect scripts/functional_tests.js --config test/functional/config.js --include ciGroup1 --debug`
5052

51-
This will print of an address, to which you could open your chrome browser on your instance and navigate to `chrome://inspect/#devices` and inspect the functional test runner `scripts/functional_tests.js`.
53+
This will print off an address, to which you could open your chrome browser on your instance and navigate to `chrome://inspect/#devices` and inspect the functional test runner `scripts/functional_tests.js`.
54+
55+
### Backwards Compatibility tests
56+
To run all the backwards compatibility tests on vanilla OpenSearch Dashboards:
57+
58+
`yarn test:bwc -o [test path to opensearch.tar.gz] -d [test path to opensearch-dashboards.tar.gz]`
59+
60+
To run all the backwards compatibility tests on bundled dashboards, pass the bundle parameter to the test:
61+
62+
`yarn test:bwc -o [test path to opensearch.tar.gz] -d [test path to opensearch-dashboards.tar.gz] -b true`
63+
64+
To run specific versions' backwards compatibility tests, pass the versions to the test:
65+
66+
`yarn test:bwc -o [test path to opensearch.tar.gz] -d [test path to opensearch-dashboards.tar.gz] -v "[test versions]"`
5267

5368
### Additional checks
5469
Make sure you run lint checker before submitting a pull request. To run lint checker:
@@ -70,5 +85,4 @@ By default the version of OpenSearch Dashboards will pull the snapshot of the sa
7085
Although Jest is the standard for this project, there are a few Mocha tests that still exist. You can run these tests by running:
7186
`yarn test:mocha`
7287

73-
However, these tests will eventually be migrated. Please avoid writing new Mocha tests. For further questions or to check the status please see this [issue](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/215).
74-
88+
However, these tests will eventually be migrated. Please avoid writing new Mocha tests. For further questions or to check the status please see this [issue](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/215).

0 commit comments

Comments
 (0)