gnu: pre-commit: Respect #:tests?.

* gnu/packages/version-control.scm (pre-commit)[arguments]: Respect #:tests?
in the 'check phase.

Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
This commit is contained in:
Vinicius Monego 2021-06-12 21:21:10 +00:00 committed by Efraim Flashner
parent a2bcf64383
commit 335f7668d4
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -1552,26 +1552,27 @@ (define-public pre-commit
(invoke "git" "config" "--global" "user.name" "Your Name") (invoke "git" "config" "--global" "user.name" "Your Name")
(invoke "git" "config" "--global" "user.email" "you@example.com"))) (invoke "git" "config" "--global" "user.email" "you@example.com")))
(replace 'check (replace 'check
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs tests? #:allow-other-keys)
(add-installed-pythonpath inputs outputs) (add-installed-pythonpath inputs outputs)
;; The file below contains about 30 tests that fail because they (when tests?
;; depend on tools from multiple languages (cargo, npm, cpan, ;; The file below contains 30+ tests that fail because they
;; Rscript, etc). There are other tests that pass, but it's more ;; depend on tools from multiple languages (cargo, npm, cpan,
;; convenient to skip the whole file than list 30 tests to skip. ;; Rscript, etc). Other tests are passing, but it's more
(invoke "pytest" "--ignore=tests/repository_test.py" ;; convenient to skip the file than list 30 tests to skip.
;; Ruby and Node tests require node and gem. (invoke "pytest" "--ignore=tests/repository_test.py"
"--ignore=tests/languages/node_test.py" ;; Ruby and Node tests require node and gem.
"--ignore=tests/languages/ruby_test.py" "--ignore=tests/languages/node_test.py"
;; FIXME: Python tests fail because of distlib version "--ignore=tests/languages/ruby_test.py"
;; mismatch. Even with python-distlib/next it is ;; FIXME: Python tests fail because of distlib version
;; pulling version 0.3.0, while 0.3.1 is required. ;; mismatch. Even with python-distlib/next it is
"--ignore=tests/languages/python_test.py" "-k" ;; pulling version 0.3.0, while 0.3.1 is required.
(string-append "--ignore=tests/languages/python_test.py" "-k"
;; TODO: these tests fail with AssertionError. It may (string-append
;; be possible to fix them. ;; TODO: these tests fail with AssertionError. It may
"not test_install_existing_hooks_no_overwrite" ;; be possible to fix them.
" and not test_uninstall_restores_legacy_hooks" "not test_install_existing_hooks_no_overwrite"
" and not test_installed_from_venv")))) " and not test_uninstall_restores_legacy_hooks"
" and not test_installed_from_venv")))))
(add-before 'reset-gzip-timestamps 'make-gz-writable (add-before 'reset-gzip-timestamps 'make-gz-writable
(lambda* (#:key outputs #:allow-other-keys) (lambda* (#:key outputs #:allow-other-keys)
;; Make sure .gz files are writable so that the ;; Make sure .gz files are writable so that the