-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure install is properly completed Ensure upgrade is properly completed Compare against v-next and not v-next since there's no current way of knowing which version is the current helm chart. This may get addressed if we start building the images and the chart as v-next from the outset. Signed-off-by: Tiago Castro <[email protected]>
- Loading branch information
1 parent
3931ccf
commit 1b1b4aa
Showing
6 changed files
with
152 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# BDD Tests | ||
|
||
The BDD tests are written in Python and make use of the pytest-bdd library. | ||
|
||
The feature files in the `features` directory define the behaviour expected of mayastor. These behaviours are | ||
described using the [Gherkin](https://cucumber.io/docs/gherkin/) syntax. | ||
|
||
The feature files can be used to auto-generate the test file. For example | ||
running `pytest-bdd generate upgrade.feature > test_upgrade.py` | ||
generates the `test_upgrade.py` test file from the `upgrade.feature` file. | ||
When updating the feature file, you can also get some helpe updating the python code. | ||
Example: `pytest --generate-missing --feature upgrade.feature test_upgrade.py` | ||
|
||
**:warning: Note: Running pytest-bdd generate will overwrite any existing files with the same name** | ||
|
||
## Running the Tests by entering the python virtual environment | ||
|
||
Before running any tests run the `setup.sh` script. This sets up the necessary environment to run the tests: | ||
|
||
```bash | ||
# NOTE: you should be inside the nix-shell to begin | ||
source ./setup.sh | ||
``` | ||
|
||
To run all the tests: | ||
|
||
```bash | ||
pytest . | ||
``` | ||
|
||
To run individual test files: | ||
|
||
```bash | ||
pytest features/test_upgrade.py | ||
``` | ||
|
||
To run an individual test within a test file use the `-k` option followed by the test name: | ||
|
||
```bash | ||
pytest features/test_upgrade.py -k test_upgrade_to_vnext | ||
``` | ||
|
||
## Running the Tests | ||
|
||
The script in `../../scripts/python/test.sh` can be used to run the tests without entering the venv. | ||
This script will implicitly enter and exit the venv during test execution. | ||
|
||
To run all the tests: | ||
|
||
```bash | ||
../../scripts/python/test.sh | ||
``` | ||
|
||
Arguments will be passed directly to pytest. Example running individual tests: | ||
|
||
```bash | ||
../../scripts/python/test.sh features/test_upgrade.py -k test_upgrade_to_vnext | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
Feature: Upgrade | ||
|
||
Background: | ||
Given an installed mayastor helm chart | ||
Given the latest mayastor helm chart is installed | ||
Then all io-engine nodes shall be listed by kubectl-mayastor | ||
|
||
Scenario: upgrade command is issued | ||
Scenario: Upgrading to the local chart as v-next | ||
When a kubectl mayastor upgrade command is issued | ||
Then the installed chart should be upgraded to the kubectl mayastor plugin's version | ||
Then eventually the installed chart should be upgraded to the kubectl mayastor plugin's version |