Running tests locally
Prerequisites
- A verified account in your chosen provider which integrate with Meshery.
- bash as shell terminal
- Installations of Bats, Golang, NodeJS and Makefiles for Native OS build (Optional for docker based build).
- Kubernetes clusters (Required for connection to Kubernetes test cases)
- Meshery server up and running
Running the tests
- make sure you are in meshery/mesheryctl/tests/e2e directory
- run
bats run_tests.bash
It takes some time since meshery server is deployed to your Kubernetes cluster
Writing your own tests
Folder structure
The tests will be available in mesheryctl/tests/e2e
folder with the following structure which is donedone to follow the code base structure of mesheryctl
βββ aaa-<command>
βββ bbb-<command>
βββ ...
βββ yyy-<command>
βββ zzz-<command>
βββ helpers
βββ README.md
βββ run_tests.bash
βββ setup_suite.bash
βββ teardown_suite.bash
Naming convention
Tips
Bats will run the tests sequentially so we use a prefix code alphanumeric to be able to order tests as required when necessary
ex: you need to import a model before being able to view the details of that model
Folder
- prefix: 3 digits alphanumeric code
- name: command under test
example: 011-design
Test file
- prefix: 2 digits numeric code
- name: subcommand under test
- extension: bats
example: 05-list.bats
For consistency, we will keep the prefix 00- for the command under test in the folder and subcommands will start at 01-
Here an example withmesheryctl model
command
002-model/
βββ 00-model.bats
βββ 01-model-list.bats
Find Tests here
Refer to Meshery Test Plan for test scenarios.