[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
145/242: gnu: python-sqlalchemy: Run tests in parallel via xdist.
From: |
guix-commits |
Subject: |
145/242: gnu: python-sqlalchemy: Run tests in parallel via xdist. |
Date: |
Wed, 11 May 2022 18:03:18 -0400 (EDT) |
apteryx pushed a commit to branch wip-ipython-polyglossia
in repository guix.
commit 923a6f957fd86659338a918293eb9d9ce8fab5b8
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 b7cbfa6536..fa06983198 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>
@@ -3365,16 +3365,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
@@ -3386,7 +3391,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
- 129/242: gnu: texlive-latex-geometry: Propagate texlive-latex-graphics., (continued)
- 129/242: gnu: texlive-latex-geometry: Propagate texlive-latex-graphics., guix-commits, 2022/05/11
- 134/242: gnu: Add python-strict-rfc3339., guix-commits, 2022/05/11
- 132/242: gnu: python-ipython-documentation: Also build info and pdf targets., guix-commits, 2022/05/11
- 138/242: gnu: Add python-cbor2., guix-commits, 2022/05/11
- 136/242: gnu: Add python-openapi-schema-validator., guix-commits, 2022/05/11
- 140/242: gnu: Add python-httpcore-bootstrap., guix-commits, 2022/05/11
- 146/242: gnu: python-sqlalchemy: Update to 1.4.35., guix-commits, 2022/05/11
- 149/242: gnu: python-fakeredis: Update to 1.7.1., guix-commits, 2022/05/11
- 144/242: gnu: Add python-socksio., guix-commits, 2022/05/11
- 137/242: gnu: Add python-openapi-spec-validator., guix-commits, 2022/05/11
- 145/242: gnu: python-sqlalchemy: Run tests in parallel via xdist.,
guix-commits <=
- 141/242: gnu: Add python-httpx-bootstrap., guix-commits, 2022/05/11
- 150/242: gnu: python-falcon: Update to 3.1.0., guix-commits, 2022/05/11
- 152/242: gnu: Add python-openapi-core., guix-commits, 2022/05/11
- 147/242: gnu: Add python-pecan., guix-commits, 2022/05/11
- 157/242: gnu: python-numba: Update to 0.55.1., guix-commits, 2022/05/11
- 158/242: gnu: python-pandas: Build and run tests in parallel., guix-commits, 2022/05/11
- 162/242: gnu: python-umap-learn: Update to 0.5.3., guix-commits, 2022/05/11
- 167/242: gnu: python-jupyter-protocol: Update to 0.2.0., guix-commits, 2022/05/11
- 177/242: gnu: python-can: Update to 4.0.0., guix-commits, 2022/05/11
- 170/242: gnu: python-types-dataclasses: Fix typo., guix-commits, 2022/05/11