summary refs log tree commit diff
path: root/pkgs/applications/version-management/sourcehut
diff options
context:
space:
mode:
authorEdmund Wu <fangkazuto@gmail.com>2019-10-05 11:00:49 -0400
committerEdmund Wu <fangkazuto@gmail.com>2019-10-06 08:48:32 -0400
commitc4ce930c23549143f9c4a44ef81187c71ada063c (patch)
tree849e356afb0a51270feb1a2304198d7d7fc8ad70 /pkgs/applications/version-management/sourcehut
parent2c16a2498c9944275b6402ca7f4abc7141bee461 (diff)
downloadnixpkgs-c4ce930c23549143f9c4a44ef81187c71ada063c.tar
nixpkgs-c4ce930c23549143f9c4a44ef81187c71ada063c.tar.gz
nixpkgs-c4ce930c23549143f9c4a44ef81187c71ada063c.tar.bz2
nixpkgs-c4ce930c23549143f9c4a44ef81187c71ada063c.tar.lz
nixpkgs-c4ce930c23549143f9c4a44ef81187c71ada063c.tar.xz
nixpkgs-c4ce930c23549143f9c4a44ef81187c71ada063c.tar.zst
nixpkgs-c4ce930c23549143f9c4a44ef81187c71ada063c.zip
sourcehut.*: fix setuptools validation
Diffstat (limited to 'pkgs/applications/version-management/sourcehut')
-rw-r--r--pkgs/applications/version-management/sourcehut/core.nix6
-rw-r--r--pkgs/applications/version-management/sourcehut/git.nix1
-rw-r--r--pkgs/applications/version-management/sourcehut/scm.nix6
-rw-r--r--pkgs/applications/version-management/sourcehut/todo.nix32
4 files changed, 31 insertions, 14 deletions
diff --git a/pkgs/applications/version-management/sourcehut/core.nix b/pkgs/applications/version-management/sourcehut/core.nix
index 8ece7389bff..ac33ecbbd8d 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 131036f1441..24974aeb2e7 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 cad6562287c..efd7a9bcd28 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 8b8509bbb62..aaee9b54477 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;