me
/
guix
Archived
1
0
Fork 0

build-system/pyproject: Always run tests verbosely for supported backends.

* guix/build-system/pyproject.scm (pyproject-build): Default to '() instead of
 #false for TEST-FLAGS.
* guix/build/pyproject-build-system.scm (check): Unconditionally enable
verbose test flags.
* doc/guix.texi (Build Systems): Document this change.
* gnu/packages/fontutils.scm (python-glyphslib)[arguments]: Remove verbosity
from #:test-flags.
* gnu/packages/pdf.scm (python-pydyf, weasyprint)[arguments]: Likewise.
* gnu/packages/python-web.scm (python-openapi-spec-validator)[arguments]: Likewise.
* gnu/packages/python-xyz.scm (python-path, python-tempora)[arguments]: Likewise.
Marius Bakke 2022-10-27 20:31:38 +02:00
parent 6ef998d54e
commit e944734ef9
No known key found for this signature in database
GPG Key ID: A2A06DF2A33A54FA
7 changed files with 17 additions and 15 deletions

View File

@ -9332,8 +9332,9 @@ to guess the appropriate backend based on @file{pyproject.toml}.
@code{#:test-backend} is added. It defaults to @code{#false} and will guess @code{#:test-backend} is added. It defaults to @code{#false} and will guess
an appropriate test backend based on what is available in package inputs. an appropriate test backend based on what is available in package inputs.
@item @item
@code{#:test-flags} is added. The default is @code{#false}, and varies based @code{#:test-flags} is added. The default is @code{'()}. These flags are
on the detected @code{#:test-backend}. passed as arguments to the test command. Note that flags for verbose output
is always enabled on supported backends.
@end itemize @end itemize
It is considered ``experimental'' in that the implementation details are It is considered ``experimental'' in that the implementation details are

View File

@ -598,8 +598,7 @@ process. FontParts is the successor of RoboFab.")
(build-system pyproject-build-system) (build-system pyproject-build-system)
(arguments (arguments
(list (list
#:test-flags #~'("-vv" #:test-flags #~'(;; These fail because the test data has not yet been
;; These fail because the test data has not yet been
;; updated for newer FontTools: ;; updated for newer FontTools:
;; https://github.com/googlefonts/glyphsLib/issues/787 ;; https://github.com/googlefonts/glyphsLib/issues/787
;; Re-enable for versions > 6.0.7. ;; Re-enable for versions > 6.0.7.

View File

@ -739,7 +739,7 @@ extracting content or merging files.")
(build-system pyproject-build-system) (build-system pyproject-build-system)
(arguments (arguments
(list (list
#:test-flags #~'("-vv" "-c" "/dev/null"))) #:test-flags #~'("-c" "/dev/null")))
(propagated-inputs (list python-pillow)) (propagated-inputs (list python-pillow))
(native-inputs (native-inputs
(list ghostscript (list ghostscript
@ -1500,7 +1500,7 @@ manipulating PDF documents from the command line. It supports
(build-system pyproject-build-system) (build-system pyproject-build-system)
(arguments (arguments
(list (list
#:test-flags #~(list "-vv" "-c" "/dev/null" #:test-flags #~(list "-c" "/dev/null"
"-n" (number->string (parallel-job-count))) "-n" (number->string (parallel-job-count)))
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases

View File

@ -1648,7 +1648,7 @@ JSON Schema Specification Draft 2020-12.
(list (list
;; The example tests attempt to fetch resources from the Internet ;; The example tests attempt to fetch resources from the Internet
;; (see: https://github.com/p1c2u/openapi-spec-validator/issues/151). ;; (see: https://github.com/p1c2u/openapi-spec-validator/issues/151).
#:test-flags #~'("-vv" "-k" "not Example and not Exampe") #:test-flags #~'("-k" "not Example and not Exampe")
#:phases #:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'remove-coverage-pytest-options (add-after 'unpack 'remove-coverage-pytest-options

View File

@ -12753,7 +12753,7 @@ invoked on those path objects directly.")
((#:tests? _ #f) ((#:tests? _ #f)
(not (%current-target-system))) (not (%current-target-system)))
((#:test-flags flags #~'()) ((#:test-flags flags #~'())
#~(append (list "-vv" "-k" #~(append (list "-k"
(string-append (string-append
;; Do not test the myproject.toml build as it tries ;; Do not test the myproject.toml build as it tries
;; to pull dependencies from the Internet. ;; to pull dependencies from the Internet.
@ -21366,7 +21366,7 @@ particularly convenient for use in tests.")
(arguments (arguments
;; Do not test the myproject.toml build as it tries to pull ;; Do not test the myproject.toml build as it tries to pull
;; dependencies from the Internet. ;; dependencies from the Internet.
(list #:test-flags #~'("-vv" "-k" "not project"))) (list #:test-flags #~'("-k" "not project")))
(native-inputs (native-inputs
(list python-freezegun (list python-freezegun
python-pytest python-pytest

View File

@ -95,7 +95,7 @@
(configure-flags ''()) (configure-flags ''())
(build-backend #f) (build-backend #f)
(test-backend #f) (test-backend #f)
(test-flags #f) (test-flags ''())
(phases '%standard-phases) (phases '%standard-phases)
(outputs '("out" "wheel")) (outputs '("out" "wheel"))
(search-paths '()) (search-paths '())

View File

@ -158,14 +158,16 @@ builder.build_wheel(sys.argv[2], config_settings=config_settings)"
(format #t "Using ~a~%" use-test-backend) (format #t "Using ~a~%" use-test-backend)
(match use-test-backend (match use-test-backend
('pytest ('pytest
(apply invoke (cons pytest (or test-flags '("-vv"))))) (apply invoke pytest "-vv" test-flags))
('nose ('nose
(apply invoke (cons nosetests (or test-flags '("-v"))))) (apply invoke nosetests "-v" test-flags))
('nose2 ('nose2
(apply invoke (cons nose2 (or test-flags '("-v" "--pretty-assert"))))) (apply invoke nose2 "-v" "--pretty-assert" test-flags))
('setup.py ('setup.py
(apply invoke (append '("python" "setup.py") (apply invoke "python" "setup.py"
(or test-flags '("test" "-v"))))) (if (null? test-flags)
'("test" "-v")
test-flags)))
;; The developer should explicitly disable tests in this case. ;; The developer should explicitly disable tests in this case.
(else (raise (condition (&test-system-not-found)))))) (else (raise (condition (&test-system-not-found))))))
(format #t "test suite not run~%"))) (format #t "test suite not run~%")))