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

Add molecule lint in docker image #342

Closed
alexanderbazhenoff opened this issue Apr 3, 2024 · 0 comments
Closed

Add molecule lint in docker image #342

alexanderbazhenoff opened this issue Apr 3, 2024 · 0 comments

Comments

@alexanderbazhenoff
Copy link

alexanderbazhenoff commented Apr 3, 2024

Hi,

First of all I want to giva a positive feedback because this GH action is more flexible. At least this can change a working directory for molecule command: other available Molecule actions can't do this. So no ansible collection testing is possible, only roles. But I have a feature request.

Please add an opportunity to run lint molecule scenario like so:
poetry run pip install "molecule-plugins[lint]"

Otherwise this will fail:

INFO     default scenario test matrix: dependency, lint, destroy, syntax, create, prepare, converge, verify, side_effect, destroy
INFO     Performing prerun with role_name_check=0...
INFO     Running default > dependency
...
AttributeError: module 'molecule.command' has no attribute 'lint'. Did you mean: 'list'?

You can see a raw log on pastebin.

If you have an ansible galaxy dependencies already, this won't be installed using shell. So:

---

dependency:
  name: galaxy
  options:
    ignore-certs: true
    ignore-errors: true
  name: shell
  command: bash -c 'pip install "molecule-plugins[lint]" flake8 yamllint'
driver:
  name: docker

didn't worked for me.

Ofcourse, we can move linting to another job, but molecule lint scenario is quite standard. I also don't want to change all my tests files in default/ forlder when I use different testing environment (e.g. GitHub, GitLab, Travis CI, etc...)

May be also yamllint, it's on your choice. But ansible-lint use them also.

But I think pre-command before molecule run will be more usefull, people can install any packages, like:

  with:
    pre_command: pip install something

UPDATE:

Oh, Sorry for bothering, I was wrong about lint action: looks like it was removed since molecule v5. Here is a lot of URLs:

But pre-command is still good idea.

@alexanderbazhenoff alexanderbazhenoff closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2024
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

No branches or pull requests

1 participant