[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
139/204: gnu: python-sqlalchemy: Run tests in parallel via xdist.
From: |
guix-commits |
Subject: |
139/204: gnu: python-sqlalchemy: Run tests in parallel via xdist. |
Date: |
Wed, 20 Apr 2022 02:03:34 -0400 (EDT) |
apteryx pushed a commit to branch wip-ipython-polyglossia
in repository guix.
commit 688872ea36e007e13d419677da954fbecdda69cc
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
- 92/204: gnu: Add python-untangle., (continued)
- 92/204: gnu: Add python-untangle., guix-commits, 2022/04/20
- 96/204: gnu: Add python-pydevd., guix-commits, 2022/04/20
- 100/204: gnu: python-pytest-xdist-next: Update to 2.5.0., guix-commits, 2022/04/20
- 102/204: gnu: python-nest-asyncio: Update to 1.5.5., guix-commits, 2022/04/20
- 116/204: gnu: python-send2trash: Update to 1.8.0 and update home page., guix-commits, 2022/04/20
- 97/204: gnu: Add python-debugpy., guix-commits, 2022/04/20
- 120/204: gnu: python-sphinx: Propagate TexLive dependencies., guix-commits, 2022/04/20
- 123/204: gnu: Add python-sphinx-sitemap., guix-commits, 2022/04/20
- 124/204: gnu: texlive-fontspec: Add missing propagated inputs., guix-commits, 2022/04/20
- 132/204: gnu: Add python-cbor2., guix-commits, 2022/04/20
- 139/204: gnu: python-sqlalchemy: Run tests in parallel via xdist.,
guix-commits <=
- 133/204: gnu: python-httpcore: Update to 0.14.7 and enable tests., guix-commits, 2022/04/20
- 156/204: gnu: python-umap-learn: Update to 0.5.3., guix-commits, 2022/04/20
- 176/204: gnu: python-bitstruct: Update to 8.14.0., guix-commits, 2022/04/20
- 188/204: gnu: Remove python2-jmespath., guix-commits, 2022/04/20
- 189/204: gnu: python-croniter: Update to 1.3.4., guix-commits, 2022/04/20
- 195/204: gnu: markets: Add python-wrapper to fix build., guix-commits, 2022/04/20
- 70/204: gnu: python-pytest-shutil: Adjust to use python-path., guix-commits, 2022/04/20
- 90/204: gnu: python-click: Update to 8.1.2 and honor TESTS?., guix-commits, 2022/04/20
- 108/204: gnu: python-anyio: Update to 3.5.0., guix-commits, 2022/04/20
- 143/204: gnu: python-fakeredis: Update to 1.7.1., guix-commits, 2022/04/20