Skip to content

Commit

Permalink
Restore auto-installation of local collection (#3225)
Browse files Browse the repository at this point in the history
Before 3.4.0 molecule used to auto-install local collection if
one is detected. This patch restores this behavior and installs
a collection as part of the prerun.
  • Loading branch information
ssbarnea authored Jun 1, 2022
1 parent de9da25 commit eecb465
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 5 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ jobs:
- tox_env: docs
python-version: 3.9
- tox_env: py38
PREFIX: PYTEST_REQPASS=453
PREFIX: PYTEST_REQPASS=454
python-version: 3.8
cover: true
- tox_env: py39
PREFIX: PYTEST_REQPASS=453
PREFIX: PYTEST_REQPASS=454
python-version: 3.9
cover: true
- tox_env: py310
PREFIX: PYTEST_REQPASS=453
PREFIX: PYTEST_REQPASS=454
python-version: "3.10"
cover: true
- tox_env: py38-devel
PREFIX: PYTEST_REQPASS=453
PREFIX: PYTEST_REQPASS=454
python-version: 3.8
cover: true
- tox_env: py310-devel
PREFIX: PYTEST_REQPASS=453
PREFIX: PYTEST_REQPASS=454
python-version: "3.10"
# see https://github.com/ansible-community/molecule/issues/3291
experimental: true
Expand Down
9 changes: 9 additions & 0 deletions src/molecule/test/functional/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,12 @@ def test_command_test_with_platform_name(
)
def test_command_verify(scenario_to_test, with_scenario, scenario_name):
verify(scenario_name)


def test_sample_collection():
assert (
run_command(
["molecule", "test"], cwd="src/molecule/test/resources/sample-collection"
).returncode
== 0
)
31 changes: 31 additions & 0 deletions src/molecule/test/resources/sample-collection/galaxy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: goodies
namespace: acme
version: 1.0.0
readme: README.md
authors:
- Red Hat
description: Acme Goodies Collection
build_ignore:
- "*.egg-info"
- .DS_Store
- .eggs
- .gitignore
- .mypy_cache
- .pytest_cache
- .stestr
- .stestr.conf
- .tox
- .vscode
- MANIFEST.in
- build
- dist
- doc
- report.html
- setup.cfg
- setup.py
- "tests/unit/*.*"
- README.rst
- tox.ini

repository: https://opendev.org/openstack/tripleo-repos
license_file: LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Converge
hosts: localhost
tasks:
- name: "Include sample role from current collection"
include_role:
name: acme.goodies.get_rich
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
dependency:
name: galaxy
driver:
name: delegated
platforms:
- name: instance
provisioner:
name: ansible
verifier:
name: ansible
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- name: "some task inside foo.bar collection"
debug:
msg: "hello world!"

0 comments on commit eecb465

Please sign in to comment.