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

Fix CI with newest molecule #303

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ default_language_version:
python: python3
minimum_pre_commit_version: 1.14.0
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
- repo: https://github.com/pycontribs/mirrors-prettier
# keep it before yamllint
rev: "v4.0.0-alpha.8"
rev: "v3.4.2"
hooks:
- id: prettier
# Temporary excludes so we can gradually normalize the formatting
Expand Down
11 changes: 0 additions & 11 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from molecule import config, logger
from molecule.app import get_app
from molecule.scenario import ephemeral_directory

LOG = logger.get_logger(__name__)

Expand Down Expand Up @@ -79,16 +78,6 @@ def get_molecule_file(path):
return config.molecule_file(path)


@pytest.helpers.register
def molecule_ephemeral_directory(_fixture_uuid):
project_directory = f"test-project-{_fixture_uuid}"
scenario_name = "test-instance"

return ephemeral_directory(
os.path.join("molecule_test", project_directory, scenario_name),
)


def metadata_lint_update(role_directory: str) -> None:
# By default, ansible-lint will fail on newly-created roles because the
# fields in this file have not been changed from their defaults. This is
Expand Down
10 changes: 5 additions & 5 deletions test/vagrant-plugin/functional/test_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from conftest import change_dir_to
from molecule import logger, util
from molecule.app import get_app
from molecule.scenario import ephemeral_directory

LOG = logger.get_logger(__name__)

Expand Down Expand Up @@ -141,16 +140,17 @@ def test_multi_node(temp_dir):
"scenarios",
)

molecule_eph_directory = os.path.join(temp_dir, "ephemeral")
env = os.environ
env["MOLECULE_EPHEMERAL_DIRECTORY"] = molecule_eph_directory

with change_dir_to(scenario_directory):
cmd = ["molecule", "test", "--scenario-name", "multi-node"]
result = get_app(Path()).run_command(cmd)
result = get_app(Path()).run_command(cmd, env=env)
assert result.returncode == 0

molecule_eph_directory = ephemeral_directory()
vagrantfile = os.path.join(
molecule_eph_directory,
"scenarios",
"multi-node",
"Vagrantfile",
)
with open(vagrantfile) as f:
Expand Down