mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Merge pull request #804 from acelaya-forks/feature/document-tests
Added project tests section to the CONTRIBUTING file
This commit is contained in:
commit
f74851b0d8
1 changed files with 24 additions and 0 deletions
|
@ -35,6 +35,30 @@ Once you finish this, you will have the project exposed in ports `8000` through
|
|||
|
||||
> Note: The `indocker` shell script is a helper used to run commands inside the main docker container.
|
||||
|
||||
## Project tests
|
||||
|
||||
In order to ensure stability and no regressions are introduced while developing new features, this project has different types of tests.
|
||||
|
||||
* **Unit tests**: These are the simplest to run, and usually test individual pieces of code, replacing any external dependency by mocks.
|
||||
|
||||
The code coverage of unit tests is pretty high, and only entity repositories are excluded because of their nature.
|
||||
|
||||
* **Database tests**: These are integration tests that run against a real database, and only cover entity repositories.
|
||||
|
||||
Its purpose is to verify all the database queries behave as expected and return what's expected.
|
||||
|
||||
The project provides some tooling to run them against any of the supported database engines.
|
||||
|
||||
* **API tests**: These are E2E tests that spin up an instance of the app and test it from the outside, by interacting with the REST API.
|
||||
|
||||
These are the best tests to catch regressions, and to verify everything interacts as expected.
|
||||
|
||||
They use MySQL as the database engine, and include some fixtures that ensure the same data exists at the beginning of the execution.
|
||||
|
||||
* **CLI tests**: *TBD. Once included, its purpose will be the same as API tests, but running through the command line*
|
||||
|
||||
Depending on the kind of contribution, maybe not all kinds of tests are needed, but the more you provide, the better.
|
||||
|
||||
## Running code checks
|
||||
|
||||
* Run `./indocker composer cs` to check coding styles are fulfilled.
|
||||
|
|
Loading…
Add table
Reference in a new issue