tests: Account for /tmp symlink in virtualenv test on macOS

pull/1032/head
Alex Willmer 9 months ago
parent adfd4e17f3
commit 2839954559

@ -25,6 +25,11 @@ except NameError:
def main(): def main():
module = AnsibleModule(argument_spec={}) module = AnsibleModule(argument_spec={})
module.exit_json( module.exit_json(
fs={
'/tmp': {
'resolved': os.path.realpath('/tmp'),
},
},
python={ python={
'version': { 'version': {
'full': '%i.%i.%i' % sys.version_info[:3], 'full': '%i.%i.%i' % sys.version_info[:3],

@ -23,9 +23,16 @@
when: when:
- lout.python.version.full is version('2.7', '>=', strict=True) - lout.python.version.full is version('2.7', '>=', strict=True)
- assert: - name: Check virtualenv was used
# On macOS runners a symlink /tmp -> /private/tmp has been seen
vars:
requested_executable: /tmp/issue_152_virtualenv/bin/python
expected_executables:
- "{{ requested_executable }}"
- "{{ requested_executable.replace('/tmp', out.fs['/tmp'].resolved) }}"
assert:
that: that:
- out.sys_executable == "/tmp/issue_152_virtualenv/bin/python" - out.sys_executable in expected_executables
fail_msg: out={{out}} fail_msg: out={{out}}
when: when:
- lout.python.version.full is version('2.7', '>=', strict=True) - lout.python.version.full is version('2.7', '>=', strict=True)

Loading…
Cancel
Save