about summary refs log tree commit diff
path: root/pkgs/tools/admin/pgadmin
diff options
context:
space:
mode:
authorFlorian Brandes <florian.brandes@posteo.de>2022-04-24 13:17:42 +0200
committerFlorian Brandes <florian.brandes@posteo.de>2022-04-27 19:15:08 +0200
commiteef222b8c2f220033fb76aa64cdfd9dcf9d6a3aa (patch)
treeac2a09cff1ee942b3fc64707c096fae8a0c7d9f3 /pkgs/tools/admin/pgadmin
parenteff62ac1963df80205482aa6d40962f1abdfa832 (diff)
pgadmin4: fix tests
this commit passes the build dependencies to the
pgadmin nixos test for package and regression testing.

Also added changelog and some clarifying comments.

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
Diffstat (limited to 'pkgs/tools/admin/pgadmin')
-rw-r--r--pkgs/tools/admin/pgadmin/default.nix106
1 files changed, 58 insertions, 48 deletions
diff --git a/pkgs/tools/admin/pgadmin/default.nix b/pkgs/tools/admin/pgadmin/default.nix
index 77cfff9aa3992..8b40687ec0b3f 100644
--- a/pkgs/tools/admin/pgadmin/default.nix
+++ b/pkgs/tools/admin/pgadmin/default.nix
@@ -1,17 +1,19 @@
-{ stdenv
-, lib
+{ lib
 , python3
 , fetchurl
 , zlib
 , mkYarnModules
 , sphinx
 , nixosTests
+, pkgs
 }:
 
 let
 
   pname = "pgadmin";
-  version = "6.8";
+  majorVersion = "6";
+  minorVersion = "8";
+  version = "${majorVersion}.${minorVersion}";
 
   src = fetchurl {
     url = "https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v${version}/source/pgadmin4-${version}.tar.gz";
@@ -26,6 +28,50 @@ let
     yarnNix = ./yarn.nix;
   };
 
+  # move buildDeps here to easily pass to test suite
+  buildDeps = with pythonPackages; [
+    flask
+    flask-gravatar
+    flask_login
+    flask_mail
+    flask_migrate
+    flask_sqlalchemy
+    flask_wtf
+    flask-compress
+    passlib
+    pytz
+    simplejson
+    six
+    sqlparse
+    wtforms
+    flask-paranoid
+    psutil
+    psycopg2
+    python-dateutil
+    sqlalchemy
+    itsdangerous
+    flask-security-too
+    bcrypt
+    cryptography
+    sshtunnel
+    ldap3
+    flask-babelex
+    flask-babel
+    gssapi
+    flask-socketio
+    eventlet
+    httpagentparser
+    user-agents
+    wheel
+    authlib
+    qrcode
+    pillow
+    pyotp
+    botocore
+    boto3
+  ];
+
+  # override necessary on pgadmin4 6.8
   pythonPackages = python3.pkgs.overrideScope (final: prev: rec {
     flask = prev.flask.overridePythonAttrs (oldAttrs: rec {
       version = "2.0.3";
@@ -68,7 +114,7 @@ pythonPackages.buildPythonApplication rec {
   postPatch = ''
     # patching Makefile, so it doesn't try to build sphinx documentation here
     # (will do so later)
-    substituteInPlace Makefile --replace "LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx html" "true"
+    substituteInPlace Makefile --replace 'LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 $(MAKE) -C docs/en_US -f Makefile.sphinx html' "true"
     # fix document which refers a non-existing document and fails
     substituteInPlace docs/en_US/contributions.rst --replace "code_snippets" ""
     patchShebangs .
@@ -137,57 +183,21 @@ pythonPackages.buildPythonApplication rec {
   # checks will be run through nixos/tests
   doCheck = false;
 
-  propagatedBuildInputs = with pythonPackages; [
-    flask
-    flask-gravatar
-    flask_login
-    flask_mail
-    flask_migrate
-    flask_sqlalchemy
-    flask_wtf
-    flask-compress
-    passlib
-    pytz
-    simplejson
-    six
-    speaklater3
-    sqlparse
-    wtforms
-    flask-paranoid
-    psutil
-    psycopg2
-    python-dateutil
-    sqlalchemy
-    itsdangerous
-    flask-security-too
-    bcrypt
-    cryptography
-    sshtunnel
-    ldap3
-    flask-babelex
-    flask-babel
-    gssapi
-    flask-socketio
-    eventlet
-    httpagentparser
-    user-agents
-    wheel
-    authlib
-    qrcode
-    pillow
-    pyotp
-    botocore
-    boto3
-  ];
+  # speaklater3 is seperate because when passing buildDeps
+  # to the test, it fails there due to a collision with speaklater
+  propagatedBuildInputs = buildDeps ++ [pythonPackages.speaklater3];
 
-  passthru = {
-    tests = { inherit (nixosTests) pgadmin4 pgadmin4-standalone; };
+  passthru.tests = {
+    standalone = nixosTests.pgadmin4-standalone;
+    # regression and function tests of the package itself
+    package = (import ../../../../nixos/tests/pgadmin4.nix ({ inherit pkgs; buildDeps = buildDeps; }));
   };
 
   meta = with lib; {
     description = "Administration and development platform for PostgreSQL";
     homepage = "https://www.pgadmin.org/";
     license = licenses.mit;
+    changelog = "https://www.pgadmin.org/docs/pgadmin4/latest/release_notes_${majorVersion}_${minorVersion}.html";
     maintainers = with maintainers; [ gador ];
   };
 }