Skip to content

Commit

Permalink
Merge pull request #1173 from seriva/fix/dev-docs
Browse files Browse the repository at this point in the history
Updated documentation regarding running spec tests
  • Loading branch information
seriva authored Apr 20, 2020
2 parents c23ce79 + 3972184 commit fa176f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
3 changes: 0 additions & 3 deletions docs/assets/images/development/runserverspectests.png

This file was deleted.

4 changes: 2 additions & 2 deletions docs/assets/images/development/rununittests.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 7 additions & 9 deletions docs/home/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,34 +151,32 @@ The standard Python test runner fails to discover the tests so we use the ```Pyt

See the [Python Test Explorer](https://marketplace.visualstudio.com/items?itemName=LittleFoxTeam.vscode-python-test-adapter) extension page on how to debug and run individual tests.

You can also run the Python unit tests from a launch configuration called ```epicli```
You can also run the Python unit tests from a launch configuration called ```unit tests```

![rununittests](../assets/images/development/rununittests.png)

## Running serverspec tests

We maintain a set of serverspec tests that can be run to verify if a cluster is functioning properly. While it might not cover all cases at this point it is a good place to start.

There is one launch configuration called ```server spec tests```. This launch configuration can be found in ```/epiphany/core/src/epicli/.vscode/``` and looks like this:
The serverspec tests are integrated in Epicli. To run them you can extend the launch configuration ```epicli``` with the following arguments:

```json
...
{
"name": "server spec tests",
"name": "epicli",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/run-tests.py",
"program": "${workspaceFolder}/cli/epicli.py",
"cwd": "${workspaceFolder}",
"pythonPath": "${config:python.pythonPath}",
"env": { "PYTHONPATH": "${workspaceFolder}" },
"console": "integratedTerminal",
"args": ["spec", "-i", "${workspaceFolder}/PATH_TO_CLUSTER_INVENTORY", "-u", "ADMIN_USER", "-k", "${workspaceFolder}/PATH_TO_SSH_KEY"]
}
"args": ["test", "-b", "${workspaceFolder}/clusters/buildfolder/", "-g", "postgresql"]
},
...
```
To run the serverspec tests against a given cluster change the ```args``` field to point to the cluster inventory, admin username and the propper SSH key. Then the run from the run tab:
![runserverspectests](../assets/images/development/runserverspectests.png)
Where the ```-b``` argument points to the build folder of a cluster. The ```-g``` argument can be used to execute a subset of tests and is optional. Omitting ```-g``` will execute all tests.

0 comments on commit fa176f6

Please sign in to comment.