From b317cabe65fd85a2f5129bae1eae47ded253b723 Mon Sep 17 00:00:00 2001 From: NaeiKinDus Date: Wed, 7 Feb 2024 00:00:00 +0000 Subject: [PATCH] fix(tests): do not fail when testing collections without a test directory (typically collections from ansible-galaxy) --- Taskfile.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index e9d6036..cdd2adf 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -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