apache-airflow: correctly run pytest checks

Previously the whole checkPhase was overridden with the preparatory test setup
commands, which prevented pytestCheckHook from having an effect. Fixed to do the
preparatory work in preCheck.
This commit is contained in:
Graham Bennett
2022-10-22 11:14:14 +01:00
parent eb569423a7
commit 4285990280
@@ -238,12 +238,17 @@ buildPythonPackage rec {
"--prefix PYTHONPATH : $PYTHONPATH"
];
postInstall = ''
cp -rv ${airflow-frontend}/static/dist $out/lib/${python.libPrefix}/site-packages/airflow/www/static
# Needed for pythonImportsCheck below
export HOME=$(mktemp -d)
'';
pythonImportsCheck = [
"airflow"
] ++ providerImports;
checkPhase = ''
export HOME=$(mktemp -d)
preCheck = ''
export AIRFLOW_HOME=$HOME
export AIRFLOW__CORE__UNIT_TEST_MODE=True
export AIRFLOW_DB="$HOME/airflow.db"
@@ -262,10 +267,6 @@ buildPythonPackage rec {
"bash_operator_kill" # psutil.AccessDenied
];
postInstall = ''
cp -rv ${airflow-frontend}/static/dist $out/lib/${python.libPrefix}/site-packages/airflow/www/static
'';
# Updates yarn.lock and package.json
passthru.updateScript = writeScript "update.sh" ''
#!/usr/bin/env nix-shell