mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor(server): e2e (#6632)
This commit is contained in:
parent
4424f3cb13
commit
852effa998
43 changed files with 154 additions and 485 deletions
|
|
@ -8,10 +8,20 @@ Unit are run by calling `npm run test` from the `server` directory.
|
|||
|
||||
### End to end tests
|
||||
|
||||
The backend has an end-to-end test suite that can be called with `npm run test:e2e` from the `server` directory. This will set up a dummy database inside a temporary container and run the tests against it. Setup and teardown is automatically taken care of. That test, however, can not set up all prerequisites to parse file formats, as that is very complex and error-prone. As such, this test excludes some test cases like HEIC file imports. The test suite will also print a friendly warning to remind you that not all tests are being run.
|
||||
The backend has two end-to-end test suites that can be called with the following two commands from the project root directory:
|
||||
|
||||
- `make server-e2e-api`
|
||||
- `make server-e2e-jobs`
|
||||
|
||||
#### API (e2e)
|
||||
|
||||
The API e2e tests spin up a test database and execute http requests against the server, validating the expected response codes and functionality for API endpoints.
|
||||
|
||||
#### Jobs (e2e)
|
||||
|
||||
The Jobs e2e tests spin up a docker test environment where thumbnail generation, library scanning, and other _job_ workflows are validated.
|
||||
|
||||
:::note
|
||||
Note that there is a bug in nodejs \<20.8 that causes segmentation faults when running these tests. If you run into segfaults, ensure you are using at least version 20.8.
|
||||
|
||||
To perform a full e2e test, you need to run e2e tests inside docker. The easiest way to do that is to run `make test-e2e` in the root directory. This will build and start a docker-compose consisting of the server, microservices, and a postgres database. It will then perform the tests and exit.
|
||||
|
||||
If you manually install the dependencies (see the DOCKERFILE) on your development machine, you can also run the full e2e tests manually by setting the `IMMICH_RUN_ALL_TESTS` environment value to true, i.e. `IMMICH_RUN_ALL_TESTS=true npm run e2e:jobs`.
|
||||
:::
|
||||
/follow
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue