Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

molecule list finds scenarios in virtual envrionments #3992

Closed
cidrblock opened this issue Aug 8, 2023 · 0 comments · Fixed by #3996
Closed

molecule list finds scenarios in virtual envrionments #3992

cidrblock opened this issue Aug 8, 2023 · 0 comments · Fixed by #3996
Assignees
Milestone

Comments

@cidrblock
Copy link
Contributor

for c in glob.glob(

We may want to comapre the glob result to the gitignore file.

Something like this may work:

https://github.com/ansible-community/pytest-ansible/pull/147/files#diff-02f455c445e2548f737624f7f6f482b28f0bd5f705b60f9d0dc3040293c4d0acR283

example here:

(venv) nuc ➜  ansible.scm git:(molecule2) ✗ molecule list 
WARNING  The scenario config file ('/home/bthornto/github/ansible.scm/venv/lib/python3.11/site-packages/molecule/test/scenarios/cleanup/molecule/default/molecule.yml') has been modified since the scenario was created. If recent changes are important, reset the scenario with 'molecule destroy' to clean up created items or 'molecule reset' to clear current configuration.
WARNING  The scenario config file ('/home/bthornto/github/ansible.scm/venv/lib/python3.11/site-packages/molecule/test/scenarios/driver/delegated/molecule/default/molecule.yml') has been modified since the scenario was created. If recent changes are important, reset the scenario with 'molecule destroy' to clean up created items or 'molecule reset' to clear current configuration.
WARNING  The scenario config file ('/home/bthornto/github/ansible.scm/venv/lib/python3.11/site-packages/molecule/test/scenarios/driver/delegated_invalid_role_name_with_role_name_check_equals_to_1/molecule/default/molecule.yml') has been modified since the scenario was created. If recent changes are important, reset the scenario with 'molecule destroy' to clean up created items or 'molecule reset' to clear current configuration.
WARNING  The scenario config file ('/home/bthornto/github/ansible.scm/venv/lib/python3.11/site-packages/molecule/test/scenarios/host_group_vars/molecule/default/molecule.yml') has been modified since the scenario was created. If recent changes are important, reset the scenario with 'molecule destroy' to clean up created items or 'molecule reset' to clear current configuration.
WARNING  The scenario config file ('/home/bthornto/github/ansible.scm/venv/lib/python3.11/site-packages/molecule/test/scenarios/interpolation/molecule/default/molecule.yml') has been modified since the scenario was created. If recent changes are important, reset the scenario with 'molecule destroy' to clean up created items or 'molecule reset' to clear current configuration.
CRITICAL Failed to find driver None. Please ensure that the driver is correctly installed.

Note the warnings related to files found within a virtual environment which is ignored by git.

@cidrblock cidrblock added this to the Molecule 6 milestone Aug 12, 2023
audgirka added a commit that referenced this issue Aug 13, 2023
Ignore scenarios in virtual environments.
This only works when repository is initialized with git otherwise just
returns all scenario files.

Fixes: #3992
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants