fix(tests): do not fail when testing collections without a test directory (typically collections from ansible-galaxy)

This commit is contained in:
NaeiKinDus 2024-02-07 00:00:00 +00:00
parent 1f367782f5
commit b317cabe65
Signed by: WoodSmellParticle
GPG key ID: 8E52ADFF7CA8AE56

View file

@ -45,10 +45,8 @@ tasks:
test:module:sanity:
internal: true
dir: '{{.COLLECTION_PATH}}'
preconditions:
- test -d tests
cmds:
- '{{.PYTHON_WRAPPER}} ansible-test sanity --venv'
- 'test -d tests && {{.PYTHON_WRAPPER}} ansible-test sanity --venv || echo - ignored $(pwd)'
test:collections:
desc: run molecule tests for all roles and collections.
@ -65,10 +63,8 @@ tasks:
test:collection:molecule:
internal: true
dir: '{{.COLLECTION_PATH}}/extensions'
preconditions:
- test -d molecule
cmds:
- '{{.PYTHON_WRAPPER}} molecule test'
- 'test -d molecule && {{.PYTHON_WRAPPER}} molecule test || echo - ignored $(pwd)'
module:github_artifact:
desc: run a module from the collection for testing purposes