Commit 42859902 authored by Graham Bennett's avatar Graham Bennett
Browse files

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.
parent eb569423
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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