2023-10-06 17:32:28 -04:00
|
|
|
# Testing
|
|
|
|
|
|
|
|
|
|
## Server
|
|
|
|
|
|
|
|
|
|
### Unit tests
|
|
|
|
|
|
2026-05-27 16:33:23 +02:00
|
|
|
Unit tests are run with `mise //server:test`.
|
|
|
|
|
You need to run `mise //server:install` before _once_.
|
2023-10-06 17:32:28 -04:00
|
|
|
|
|
|
|
|
### End to end tests
|
|
|
|
|
|
2024-04-15 23:05:08 -04:00
|
|
|
The e2e tests can be run by first starting up a test production environment via:
|
2023-10-06 17:32:28 -04:00
|
|
|
|
2024-04-15 23:05:08 -04:00
|
|
|
```bash
|
2026-06-08 20:31:23 +02:00
|
|
|
mise e2e
|
2024-04-15 23:05:08 -04:00
|
|
|
```
|
2024-01-24 17:24:53 -05:00
|
|
|
|
2024-08-09 01:03:43 +02:00
|
|
|
Before you can run the tests, you need to run the following commands _once_:
|
|
|
|
|
|
2026-05-27 16:33:23 +02:00
|
|
|
- `mise //e2e:ci-setup` (installs e2e, SDK, and CLI dependencies)
|
2026-05-12 15:21:04 -04:00
|
|
|
- `mise //:open-api`
|
2024-08-09 01:03:43 +02:00
|
|
|
|
2024-04-15 23:05:08 -04:00
|
|
|
Once the test environment is running, the e2e tests can be run via:
|
2024-01-24 17:24:53 -05:00
|
|
|
|
2024-04-15 23:05:08 -04:00
|
|
|
```bash
|
2026-05-12 15:21:04 -04:00
|
|
|
mise //e2e:test
|
2024-04-15 23:05:08 -04:00
|
|
|
```
|
2023-10-06 17:32:28 -04:00
|
|
|
|
2024-04-15 23:05:08 -04:00
|
|
|
The tests check various things including:
|
2023-10-06 17:32:28 -04:00
|
|
|
|
2024-04-15 23:05:08 -04:00
|
|
|
- Authentication and authorization
|
|
|
|
|
- Query param, body, and url validation
|
|
|
|
|
- Response codes
|
|
|
|
|
- Thumbnail generation
|
|
|
|
|
- Metadata extraction
|
|
|
|
|
- Library scanning
|