Refactor the checks

This commit is contained in:
Andreas Zweili 2022-11-27 21:36:06 +01:00
parent 42939e5aa2
commit 363898ed60
1 changed files with 33 additions and 33 deletions

View File

@ -41,7 +41,8 @@
export DJANGO_SETTINGS_MODULE=network_inventory.settings.local export DJANGO_SETTINGS_MODULE=network_inventory.settings.local
''; '';
}; };
checks.lint = pkgs.stdenv.mkDerivation { checks = {
lint = pkgs.stdenv.mkDerivation {
dontPatch = true; dontPatch = true;
dontConfigure = true; dontConfigure = true;
dontBuild = true; dontBuild = true;
@ -52,10 +53,10 @@
checkInputs = [ pkgs.inventoryEnv ]; checkInputs = [ pkgs.inventoryEnv ];
checkPhase = '' checkPhase = ''
mkdir -p $out mkdir -p $out
flake8 . --count --show-source --statistics | tee $out/test.log flake8 . --count --show-source --statistics
''; '';
}; };
checks.tests = pkgs.stdenv.mkDerivation { tests = pkgs.stdenv.mkDerivation {
dontPatch = true; dontPatch = true;
dontConfigure = true; dontConfigure = true;
dontBuild = true; dontBuild = true;
@ -70,11 +71,10 @@
-nauto \ -nauto \
--nomigrations \ --nomigrations \
--cov=./src \ --cov=./src \
--cov-report=html \
./src ./src
cp -r htmlcov $out/
''; '';
}; };
};
packages.venv = pkgs.inventoryEnv; packages.venv = pkgs.inventoryEnv;
packages.inventory = pkgs.inventoryPackage; packages.inventory = pkgs.inventoryPackage;
packages.default = pkgs.inventoryPackage; packages.default = pkgs.inventoryPackage;