Doesn't work with ansible-test due to UTF-8 locale issue
geerlingguy opened this issue · 1 comments
geerlingguy commented
When I try using this image to run integration tests with Ansible Collections, I get:
Running php_role_test integration test role
NOTICE: To resume at this test target, use the option: --start-at php_role_test
Traceback (most recent call last):
File "/root/ansible/bin/ansible-test", line 15, in <module>
lib.cli.main()
File "/root/ansible/test/runner/lib/cli.py", line 125, in main
args.func(config)
File "/root/ansible/test/runner/lib/executor.py", line 359, in command_posix_integration
command_integration_filtered(args, internal_targets, all_targets, filename)
File "/root/ansible/test/runner/lib/executor.py", line 919, in command_integration_filtered
command_integration_role(args, target, start_at_task, test_dir, inventory_path, common_temp_path)
File "/root/ansible/test/runner/lib/executor.py", line 1271, in command_integration_role
with integration_test_environment(args, target, inventory_path) as test_env:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/root/ansible/test/runner/lib/integration/__init__.py", line 168, in integration_test_environment
temp_dir = tempfile.mkdtemp(prefix=prefix, suffix=suffix, dir=root_temp_dir)
File "/usr/lib/python2.7/tempfile.py", line 339, in mkdtemp
_os.mkdir(file, 0700)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 45-51: ordinal not in range(128)
ERROR: Command "docker exec 33a530f7644289577980466fd021d0ecd074adecc66c2d674263478ae9b5bc15 /usr/bin/env ANSIBLE_TEST_CONTENT_ROOT=/root/ansible/ansible_collections/geerlingguy/php_roles LC_ALL=en_US.UTF-8 python /root/ansible/bin/ansible-test integration --metadata metadata-33Kuk7.json --truncate 121 --color yes --requirements --allow-destructive" returned exit status 1.
According to @sdoran, I might be able to add the following to fix the issue:
ENV LC_ALL=en_US.utf-8
geerlingguy commented
See upstream Ansible quay.io container build file here: https://github.com/ansible/distro-test-containers/blob/master/ubuntu1804-test-container/Dockerfile