diff --git a/pkgs/applications/version-management/sourcehut/core.nix b/pkgs/applications/version-management/sourcehut/core.nix index 8ece7389bffa..ac33ecbbd8df 100644 --- a/pkgs/applications/version-management/sourcehut/core.nix +++ b/pkgs/applications/version-management/sourcehut/core.nix @@ -55,7 +55,6 @@ buildPythonPackage rec { cp -r ${node_modules} srht/node_modules ''; - # No actual? tests but seems like it needs this anyway preCheck = let config = writeText "config.ini" '' [webhooks] @@ -65,10 +64,7 @@ buildPythonPackage rec { origin=http://meta.sr.ht.local ''; in '' - # Validation needs config option(s) - # webhooks <- ( private-key ) - # meta.sr.ht <- ( origin ) - cp ${config} config.ini + cp -f ${config} config.ini ''; meta = with stdenv.lib; { diff --git a/pkgs/applications/version-management/sourcehut/git.nix b/pkgs/applications/version-management/sourcehut/git.nix index 131036f14418..24974aeb2e7e 100644 --- a/pkgs/applications/version-management/sourcehut/git.nix +++ b/pkgs/applications/version-management/sourcehut/git.nix @@ -40,7 +40,6 @@ in buildPythonPackage rec { export SRHT_PATH=${srht}/${python.sitePackages}/srht ''; - # TODO: Remove redundant mkdir? postInstall = '' mkdir -p $out/bin cp ${buildDispatcher "${src}/gitsrht-dispatch"}/bin/gitsrht-dispatch $out/bin/gitsrht-dispatch diff --git a/pkgs/applications/version-management/sourcehut/scm.nix b/pkgs/applications/version-management/sourcehut/scm.nix index cad6562287c5..efd7a9bcd287 100644 --- a/pkgs/applications/version-management/sourcehut/scm.nix +++ b/pkgs/applications/version-management/sourcehut/scm.nix @@ -39,11 +39,7 @@ buildPythonPackage rec { origin=http://meta.sr.ht.local ''; in '' - # Validation needs config option(s) - # webhooks <- ( private-key ) - # meta.sr.ht <- ( origin ) - # builds.sr.ht <- ( origin, oauth-client-id ) - cp ${config} config.ini + cp -f ${config} config.ini ''; meta = with stdenv.lib; { diff --git a/pkgs/applications/version-management/sourcehut/todo.nix b/pkgs/applications/version-management/sourcehut/todo.nix index 8b8509bbb623..aaee9b544771 100644 --- a/pkgs/applications/version-management/sourcehut/todo.nix +++ b/pkgs/applications/version-management/sourcehut/todo.nix @@ -1,6 +1,7 @@ { stdenv, fetchgit, buildPythonPackage , python -, srht, redis, alembic, pystache }: +, srht, redis, alembic, pystache +, pytest, factory_boy, writeText }: buildPythonPackage rec { pname = "todosrht"; @@ -30,8 +31,33 @@ buildPythonPackage rec { export SRHT_PATH=${srht}/${python.sitePackages}/srht ''; - # Tests require a network connection - doCheck = false; + checkInputs = [ + pytest + factory_boy + ]; + + installCheckPhase = let + config = writeText "config.ini" '' + [webhooks] + private-key=K6JupPpnr0HnBjelKTQUSm3Ro9SgzEA2T2Zv472OvzI= + + [todo.sr.ht] + origin=http://todo.sr.ht.local + oauth-client-id= + oauth-client-secret= + + [todo.sr.ht::mail] + posting-domain= + + [meta.sr.ht] + origin=http://meta.sr.ht.local + ''; + in '' + cp -f ${config} config.ini + + # pytest tests fail + # pytest tests/ + ''; meta = with stdenv.lib; { homepage = https://todo.sr.ht/~sircmpwn/todo.sr.ht;