immich icon indicating copy to clipboard operation
immich copied to clipboard

chore(ml): added testing and github workflow

Open mertalev opened this issue 2 years ago • 1 comments

Description

This PR adds pytest unit tests to the ML package. Given the expanding scope of ML, it's important to ensure a certain set of behaviors across changes. The tests included here aren't exhaustive and should be built upon in the future, but they're a good starting point.

Further, formatting, linting and testing are all automatically checked through GHA to ensure consistency across contributions.

#2951 is included in this PR and should be merged first.

Testing

To test locally, you can follow these steps:

  1. cd machine-learning
  2. poetry install --with dev
  3. pytest --cov

To test in a container, you must copy or map the machine-learning folder, not just app. You can then SSH into the container and run pytest --cov.

Note that models are mocked in most tests to avoid downloading and loading them. The exceptions are the endpoint tests, which are skipped by default. Setting MACHINE_LEARNING_TEST_FULL will run these tests as well.

mertalev avatar Jun 26 '23 17:06 mertalev

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
immich ⬜️ Ignored (Inspect) Jun 27, 2023 9:57pm

vercel[bot] avatar Jun 26 '23 17:06 vercel[bot]

Rebased

mertalev avatar Jun 27 '23 21:06 mertalev