guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: gnu: python-aiohttp: Fallback to running tests se


From: guix-commits
Subject: branch master updated: gnu: python-aiohttp: Fallback to running tests sequentially.
Date: Sun, 20 Feb 2022 07:56:53 -0500

This is an automated email from the git hooks/post-receive script.

efraim pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 14a556c7ed gnu: python-aiohttp: Fallback to running tests sequentially.
14a556c7ed is described below

commit 14a556c7ed1e643a4388ca54b68be2f4a89b2161
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sun Feb 20 14:02:31 2022 +0200

    gnu: python-aiohttp: Fallback to running tests sequentially.
    
    * gnu/packages/python-web.scm (python-aiohttp)[arguments]: Adjust custom
    'check phase to run the tests sequentially if they fail when run in
    parallel.
---
 gnu/packages/python-web.scm | 49 ++++++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 21 deletions(-)

diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm
index 76d9a3e0c4..456323ca55 100644
--- a/gnu/packages/python-web.scm
+++ b/gnu/packages/python-web.scm
@@ -268,27 +268,34 @@ for adding, removing and dropping callbacks.")
                 (find-files "." "_.*\\.pyx$")))))
          (replace 'check
            (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               ;; This tests requires the 'proxy.py' module, not yet
-               ;; packaged.
-               (delete-file "tests/test_proxy_functional.py")
-               (invoke "pytest" "-vv"
-                       ;; Disable loading the aiohttp coverage plugin
-                       ;; to avoid a circular dependency (code coverage
-                       ;; is not very interesting to us anyway).
-                       "-o" "addopts=''" "--ignore=aiohttp"
-                       "-n" (number->string (parallel-job-count))
-                       "-k" (string-append
-                             ;; This test probably requires to be run with the
-                             ;; library loaded from the the build directory.
-                             "not test_c_parser_loaded and "
-                             ;; Disable the following tests as they require
-                             ;; networking.
-                             "not TestDeflateBuffer and "
-                             "not test_client_session_timeout_zero and "
-                             "not test_empty_body and "
-                             "not test_mark_formdata_as_processed[pyloop] and "
-                             "not test_receive_runtime_err[pyloop]"))))))))
+             (let ((skipped-tests
+                     (string-append
+                       ;; This test probably requires to be run with the
+                       ;; library loaded from the the build directory.
+                       "not test_c_parser_loaded and "
+                       ;; Disable the following tests as they require
+                       ;; networking.
+                       "not TestDeflateBuffer and "
+                       "not test_client_session_timeout_zero and "
+                       "not test_empty_body and "
+                       "not test_mark_formdata_as_processed[pyloop] and "
+                       "not test_receive_runtime_err[pyloop]")))
+               (when tests?
+                 ;; This tests requires the 'proxy.py' module, not yet
+                 ;; packaged.
+                 (delete-file "tests/test_proxy_functional.py")
+                 ;; Sometimes tests fail when run in parallel.
+                 (or
+                   (invoke "pytest" "-vv"
+                           ;; Disable loading the aiohttp coverage plugin
+                           ;; to avoid a circular dependency (code coverage
+                           ;; is not very interesting to us anyway).
+                           "-o" "addopts=''" "--ignore=aiohttp"
+                           "-n" (number->string (parallel-job-count))
+                           "-k" skipped-tests)
+                   (invoke "pytest" "-vv"
+                           "-o" "addopts=''" "--ignore=aiohttp"
+                           "-k" skipped-tests)))))))))
     (propagated-inputs
      (list python-aiodns
            python-aiosignal



reply via email to

[Prev in Thread] Current Thread [Next in Thread]