docs: + development/running_tests.md

This commit is contained in:
maxlath 2025-06-06 10:32:19 +02:00
parent e2256e7f43
commit 9a8fff7c8e
2 changed files with 36 additions and 9 deletions

View file

@ -5,27 +5,36 @@ This directory hosts the main **technical documentation** about Inventaire, incl
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
- [Install](#install)
- [Configure](#configure)
- [Administrate](#administrate)
- [Installation](#installation)
- [Configuration](#configuration)
- [Administration](#administration)
- [Entities host instance specifics](#entities-host-instance-specifics)
- [Development](#development)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
### Install
### Installation
What you need to install will depend on if you are trying to set up a development or a production environment:
* In **development**, you will need the server and client repositories of course, and their dependencies: **CouchDB**, **Elasticsearch**, **GraphicsMagick**
* In **production**, in addition to those dependencies, you will need a reverse proxy, typically **Nginx**, to handle TLS termination, image resizing and caching, etc
For details on how to install all of those:
* See [installation](./installation) procedure for Debian-based systems.
* See the [installation](./installation) procedure for Debian-based systems.
* See [Docker Inventaire Suite](https://git.inventaire.io/docker-inventaire) for a fully packaged federated production-ready instance
* For other operating systems and setups, see [install on another OS](./installation/README.md#install-on-other-operating-systems)
### Configure
### Configuration
See [configuration](https://git.inventaire.io/inventaire/src/branch/main/docs/configuration) directory.
See the [configuration](https://git.inventaire.io/inventaire/src/branch/main/docs/configuration) directory.
### Administrate
### Administration
See [administration](https://git.inventaire.io/inventaire/src/branch/main/docs/administration) directory.
See the [administration](https://git.inventaire.io/inventaire/src/branch/main/docs/administration) directory.
#### Entities host instance specifics
See the [entities_host_specific](https://git.inventaire.io/inventaire/src/branch/main/docs/entities_host_specific) directory.
### Development
See the [development](https://git.inventaire.io/inventaire/src/branch/main/docs/development) directory.

View file

@ -0,0 +1,18 @@
# Running tests
`npm tests` successively runs all the tests groups: `units`, `integration`, and `api`. But if one of those groups has failing tests, it will not run the next group. That can happen typically happen if a third-party service on which the code depends is offline. It can thus be preferable to run the tests groups separately:
* `npm run test-unit`
* `npm run test-integration`
* `npm run test-api`
During development, it's often convenient to just run the tests for the controller of interest. For instance, if you are working on the signup controller, that could be:
```sh
# Using the quick mode to not recreate databases and restart the tests server everytime
npm run test-api-quick ./tests/api/auth/signup.test.ts
```
`api` tests logs will only contain the logs generated by the tests code themself, not the tests server logs. Those logs can instead be found in `logs/tests-server.log`.
A common setup is thus to open another terminal to follow what's happening on the test server, while running `npm run test-api-quick`:
```sh
tail -f logs/tests-server.log -n 100
```