8000 Add more tests related to Ansible runtime path modifications by marble-sh · Pull Request #3529 · ansible/molecule · GitHub
[go: up one dir, main page]

Skip to content

Add more tests related to Ansible runtime path modifications - #3529

Merged
ssbarnea merged 2 commits into
ansible:mainfrom
marble-sh:main
Jun 13, 2022
Merged

ssbarnea merged 2 commits into
ansible:mainfrom
marble-sh:main

Conversation

@marble-sh
Copy link
Copy Markdown
Contributor

See: #3516

@sio
sio commented Apr 26, 2022
Copy link
Copy Markdown
Contributor

I like that you merge the values here instead of just overwriting one with another.

Yet the solution feels somewhat hacky: you introduce special handling only for ANSIBLE_ROLES_PATH and ANSIBLE_COLLECTIONS_PATH. How do we know that those are the only env vars that need to be merged? What about ANSIBLE_LIBRARY_PATH? There may be more such variables, how should we treat them and why?

Also, the code is not exactly DRY and has a potential to become even more repetitive. What if we decide that another variable needs to follow the same logic? I think that merging of colon-separated lists should be split off into a function.

@marble-sh
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback, I'll get to work on updating the pull request.

@marble-sh
marble-sh force-pushed the main branch 2 times, most recently from 0453e91 to fb442dd Compare April 26, 2022 21:10
@apatard
apatard commented Apr 27, 2022
Copy link
Copy Markdown
Contributor

I like that you merge the values here instead of just overwriting one with another.

Yet the solution feels somewhat hacky: you introduce special handling only for ANSIBLE_ROLES_PATH and ANSIBLE_COLLECTIONS_PATH. How do w 8000 e know that those are the only env vars that need to be merged? What about ANSIBLE_LIBRARY_PATH? There may be more such variables, how should we treat them and why?

I was about to suggest writing a modified version of utils.merge_dicts() but I'm not sure how to make this function generic. I mean there's no way to know how to merge two variables without knowing what the env variables contain.

@marble-sh
marble-sh force-pushed the main branch 7 times, most recently from 52b9aa9 to 5bd4851 Compare April 27, 2022 20:08
@marble-sh
Copy link
Copy Markdown
Contributor Author

@sio
I hope this implementation is much cleaner. I've also added some tests.

@zhan9san
zhan9san commented May 4, 2022
Copy link
Copy Markdown
Contributor

Hi @ssbarnea

The original issue is ~/.cache/ansible-compat/DEADBEEF/collections:... is not in ANSIBLE_COLLECTIONS_PATH

Could you please consider the following implementation?

@bonddim has verified they can fix #3404.

@ssbarnea
ssbarnea requested a review from apatard June 1, 2022 07:54
@ssbarnea
ssbarnea commented Jun 1, 2022
Copy link
Copy Markdown
Member

Can you please rebase this?

@marble-sh
marble-sh requested review from a team as code owners June 1, 2022 21:50
@marble-sh
marble-sh requested review from priyamsahoo and removed request for a team June 1, 2022 21:50
@marble-sh
marble-sh force-pushed the main branch 2 times, most recently from c92b75b to 160b9e2 Compare June 1, 2022 22:01
@ssbarnea ssbarnea changed the title Clean up runtime environment variables implementation Add more tests related to Ansible runtime path modifications Jun 6, 2022
@ssbarnea
ssbarnea merged commit c40d81b into ansible:main Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

0