ida-arbeitszeit / arbeitszeitapp

A webapp for labour-time calculation.
https://arbeitszeitapp.readthedocs.io
GNU Affero General Public License v3.0
33 stars 4 forks source link

Include DB tests in nix build process #1006

Closed seppeljordan closed 2 months ago

seppeljordan commented 3 months ago

With this commit all tests from the test suite are executed as part of the nix build process. Previously only the tests that did not require a running instance of postgresql were executed. Now the DB tests are also run.

Implications

If we would merge this then we would have two checks less in our github pipeline (The CI feature of GitHub). On the other hand the flake-check pipeline would take more time to finish.

With the current implementation we would be able to run the tests (including the DB tests) on any machine that has nix available regardless of the local postgres setup. This would make all tests reproducible with regards to the DB.

Possibilities

A similar approach would allow us to have a DB setup that "just works" (TM) on any machine that runs nix.

MacOS

Please note that this change was only tested on x86_64-linux.

@Amittai-Aviram @petsch0 @rhklee It would be great if you could test this on MacOS if you have the means and the time for it. All you have to do is check out this branch and run the nix checks like so (assuming that origin points at this repository):

git fetch
git checkout origin/seppeljordan/db-tests-in-nix
nix flake check --print-build-logs

Afterwards you can post the build output here if the nix flake check command fails or write me an email with the content of the logs. The build might take some time since you might need to download some packages for the stable version of nixpkgs.

Plan-ID: d21d8863-1179-4b7c-9d17-1701a7f78e76 (2x)

seppeljordan commented 3 months ago

As you can see in the "checks" section of this PR the implementation of the DB tests does only take 1 minute to run then the test environment using pip and docker while running the tests twice actually.

seppeljordan commented 2 months ago

ping

petsch0 commented 2 months ago

Hi @seppeljordan, not sure what exactly you need from the logs, therefore attaching the whole output. As far as I can tell the command succeeded as it was supposed to. nix-flake-check-build-logs-darwin.txt

seppeljordan commented 2 months ago

@petsch0 Thanks for running the command. I checked the log file and the build succeeded on your machine. For me this would be good enough to merge. Let's see how the review of the PR goes and merge afterwards.