summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-04-13 23:45:41 -0400
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>2023-04-14 15:12:20 -0400
commitfc5dd35b071a540478074dd326ec4143e1521073 (patch)
tree5c446029abc550f3a33711515d01ed2d672e63ad
parent4116b7a9f56014b2cf9c999df1188f82f21ef947 (diff)
gnu: ansible-core: Update to 2.14.4.
* gnu/packages/admin.scm (ansible-core): Update to 2.14.4. [arguments]: Add skip-controller-tests phase. Update preserve-pythonpath and check phases. Honor parallel-job-count in check phase.
-rw-r--r--gnu/packages/admin.scm45
1 files changed, 32 insertions, 13 deletions
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index b06450216d..b8bb97c74a 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -35,7 +35,7 @@
;;; Copyright © 2020, 2021, 2022 Michael Rohleder <mike@rohleder.de>
;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
-;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2021 Stefan Reichör <stefan@xsteve.at>
;;; Copyright © 2021 qblade <qblade@protonmail.com>
@@ -2795,13 +2795,13 @@ specified directories.")
(define-public ansible-core
(package
(name "ansible-core")
- (version "2.11.6")
+ (version "2.14.4")
(source
(origin
(method url-fetch)
(uri (pypi-uri "ansible-core" version))
(sha256
- (base32 "0fih7nxszni8imi5sywsifd976v77ydhip43pzg7dd65qy1h5mck"))))
+ (base32 "057g87smxcn6zc558xk4zr6ga4q8clmkyxghn5gx60a94sy61clh"))))
(build-system python-build-system)
(arguments
`(#:modules ((guix build python-build-system)
@@ -2837,10 +2837,25 @@ sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
(and (eq? 'symlink (stat:type (lstat x)))
(string-prefix? "ansible-" x)
(string=? "ansible" (readlink x)))))))))
+ (add-after 'unpack 'skip-controller-tests
+ (lambda _
+ ;; XXX: This disables all the controller tests, which fail for
+ ;; unknown reasons, seemingly while attempting to set the
+ ;; locale to en_US.UTF-8.
+ (substitute* "test/lib/ansible_test/_internal/commands\
+/units/__init__.py"
+ (("^ if test_context == TestContext.controller:.*"
+ all)
+ (string-append all " continue\n")))))
(add-after 'unpack 'preserve-pythonpath
(lambda _
(substitute* "test/lib/ansible_test/_internal/ansible_util.py"
(("PYTHONPATH=get_ansible_python_path\\(args\\)" all)
+ (string-append all "+ ':' + os.environ['GUIX_PYTHONPATH']")))
+ (substitute* "test/lib/ansible_test/_internal/commands\
+/units/__init__.py"
+ (("PYTHONPATH=get_units_ansible_python_path\\(args, \
+test_context)" all)
(string-append all "+ ':' + os.environ['GUIX_PYTHONPATH']")))))
(add-after 'unpack 'patch-paths
(lambda* (#:key inputs outputs #:allow-other-keys)
@@ -2852,18 +2867,10 @@ sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
(("/usr/bin/python")
(which "python")))))
(replace 'check
- ;; The environment for the test suite can be tricky to get right.
- ;; The environment used for Ansible's CI defined in the following
- ;; Dockerfile can be used as a reference:
- ;; https://raw.githubusercontent.com/ansible/
- ;; default-test-container/master/Dockerfile.
(lambda* (#:key inputs outputs tests? #:allow-other-keys)
(when tests?
;; Otherwise Ansible fails to create its config directory.
(setenv "HOME" "/tmp")
- (setenv "PATH" (string-append (getenv "PATH") ":"
- (assoc-ref outputs "out") "/bin"))
- (add-installed-pythonpath inputs outputs)
;; This test module messes up with sys.path and causes many
;; test failures.
(delete-file "test/units/_vendor/test_vendor.py")
@@ -2872,11 +2879,23 @@ sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
(delete-file "test/units/utils/test_display.py")
;; This test fail for reasons unknown.
(delete-file "test/units/cli/test_adhoc.py")
+ ;; These tests fail in the container; it appears that the
+ ;; mocking of the absolute file names such as /usr/bin/svcs do
+ ;; not work as intended there.
+ (delete-file "test/units/modules/test_iptables.py")
+ (delete-file "test/units/modules/test_service.py")
+ ;; These tests fail with a "unsupported locale setting" error
+ ;; when invoking 'locale.setlocale(locale.LC_ALL, '')'
+ (delete-file "test/units/module_utils/basic/\
+test_command_nonexisting.py")
+ (delete-file "test/units/module_utils/basic/test_tmpdir.py")
;; The test suite needs to be run with 'ansible-test', which
;; does some extra environment setup. Taken from
;; https://raw.githubusercontent.com/ansible/ansible/\
;; devel/test/utils/shippable/shippable.sh.
- (invoke "ansible-test" "units" "-v")))))))
+ (invoke "ansible-test" "units" "-v"
+ "--num-workers" (number->string
+ (parallel-job-count)))))))))
(native-inputs
(list openssh
openssl
@@ -2894,7 +2913,7 @@ sys.argv[0] = re.sub(r'\\.([^/]*)-real$', r'\\1', sys.argv[0])
(list python-cryptography
python-jinja2
python-pyyaml
- python-packaging ;for version number parsing
+ python-packaging ;for version number parsing
python-resolvelib-0.5))
(home-page "https://www.ansible.com/")
(synopsis "Radically simple IT automation")