[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
145/232: gnu: python-sqlalchemy: Run tests in parallel via xdist.
From: |
guix-commits |
Subject: |
145/232: gnu: python-sqlalchemy: Run tests in parallel via xdist. |
Date: |
Sun, 24 Apr 2022 23:59:03 -0400 (EDT) |
apteryx pushed a commit to branch wip-ipython-polyglossia
in repository guix.
commit e97fc2632b9c45e1f3307134edb124b68f46c298
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Mon Apr 18 01:23:56 2022 -0400
gnu: python-sqlalchemy: Run tests in parallel via xdist.
* gnu/packages/databases.scm (python-sqlalchemy)[phases]: Use gexps.
{check}: Run tests in parallel; skip slow test_memusage.
* gnu/packages/databases.scm (python2-sqlalchemy): Adjust to avoid xdist.
---
gnu/packages/databases.scm | 39 ++++++++++++++++++++++++++++++---------
1 file changed, 30 insertions(+), 9 deletions(-)
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 4472677ab3..6784202c35 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -32,7 +32,7 @@
;;; Copyright © 2017 Kristofer Buffington <kristoferbuffington@gmail.com>
;;; Copyright © 2018 Amirouche Boubekki <amirouche@hypermove.net>
;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
-;;; Copyright © 2018, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2018, 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
@@ -3364,16 +3364,21 @@ Database API 2.0T.")
(build-system python-build-system)
(native-inputs
(list python-cython ; for C extensions
- python-pytest python-mock)) ; for tests
+ python-pytest python-mock python-pytest-xdist)) ; for tests
(propagated-inputs
(list python-greenlet))
(arguments
- `(#:phases
- (modify-phases %standard-phases
- (replace 'check
- (lambda* (#:key tests? #:allow-other-keys)
- (when tests?
- (invoke "py.test")))))))
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv"
+ "-n" (number->string (parallel-job-count))
+ ;; The memory usage tests are very expensive and run in
+ ;; sequence; skip them.
+ "-k" "not test_memusage.py")))))))
(home-page "https://www.sqlalchemy.org")
(synopsis "Database abstraction library")
(description
@@ -3385,7 +3390,23 @@ simple and Pythonic domain language.")
(license license:x11)))
(define-public python2-sqlalchemy
- (package-with-python2 python-sqlalchemy))
+ (let ((base (package-with-python2 python-sqlalchemy)))
+ (package
+ (inherit base)
+ (arguments
+ (substitute-keyword-arguments (package-arguments base)
+ ((#:phases phases)
+ #~(modify-phases #$phases
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "pytest" "-vv"
+ ;; The memory usage tests are very expensive and
run in
+ ;; sequence; skip them.
+ "-k" "not test_memusage.py"))))))))
+ ;; Do not use pytest-xdist, which is broken for Python 2.
+ (native-inputs (modify-inputs (package-native-inputs base)
+ (delete "python-pytest-xdist"))))))
(define-public python-sqlalchemy-stubs
(package
- 130/232: gnu: Add texlive-cm-lgc., (continued)
- 130/232: gnu: Add texlive-cm-lgc., guix-commits, 2022/04/24
- 131/232: gnu: Add texlive-xindy., guix-commits, 2022/04/24
- 133/232: gnu: python-websockets: Update to 10.3 and enable tests., guix-commits, 2022/04/24
- 78/232: gnu: Add python-afdko., guix-commits, 2022/04/24
- 88/232: gnu: Add texlive-bidi., guix-commits, 2022/04/24
- 92/232: gnu: Add python-untangle., guix-commits, 2022/04/24
- 93/232: gnu: python-black: Update to 22.3.0., guix-commits, 2022/04/24
- 105/232: gnu: python-ipykernel: Update to 6.13.0., guix-commits, 2022/04/24
- 110/232: gnu: python-bleach: Update to 5.0.0., guix-commits, 2022/04/24
- 119/232: gnu: Add python-docrepr., guix-commits, 2022/04/24
- 145/232: gnu: python-sqlalchemy: Run tests in parallel via xdist.,
guix-commits <=
- 171/232: gnu: python-cmarkgfm: Update to 0.8.0., guix-commits, 2022/04/24
- 178/232: gnu: python-amqp: Update to 5.1.1 and enable tests., guix-commits, 2022/04/24
- 180/232: gnu: python-celery: Update to 5.2.6 and enable tests., guix-commits, 2022/04/24
- 181/232: gnu: Add python-argparse-addons., guix-commits, 2022/04/24
- 185/232: gnu: python-multipart: Fix build with PyYAML 6., guix-commits, 2022/04/24
- 190/232: gnu: python-mkdocs: Update to 1.3.0., guix-commits, 2022/04/24
- 77/232: gnu: Add python-fonttools-next., guix-commits, 2022/04/24
- 151/232: gnu: Add python-dictpath., guix-commits, 2022/04/24
- 163/232: gnu: python-jupyter-server: Update to 1.16.0., guix-commits, 2022/04/24
- 176/232: gnu: Add python-bson., guix-commits, 2022/04/24