Skip to content

Commit b726127

Browse files
committed
Fix --all scenario
1 parent e8e9ef9 commit b726127

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

src/molecule/command/base.py

+18-17
Original file line numberDiff line numberDiff line change
@@ -124,33 +124,34 @@ def execute_cmdline_scenarios(
124124
SystemExit: If scenario exits prematurely.
125125
"""
126126
glob_str = MOLECULE_GLOB
127-
if scenario_names is None:
128-
scenario_names = ["*"]
129127
if excludes is None:
130128
excludes = []
131129

132130
configs: list[config.Config] = []
133-
for scenario_name in scenario_names:
134-
glob_str = glob_str.replace("*", scenario_name)
135-
configs.extend(
136-
config
137-
for config in get_configs(args, command_args, ansible_args, glob_str)
138-
if config.scenario.name not in excludes
139-
)
131+
if scenario_names is None:
132+
configs = get_configs(args, command_args, ansible_args, glob_str)
133+
else:
134+
for scenario_name in scenario_names:
135+
glob_str = glob_str.replace("*", scenario_name)
136+
configs.extend(
137+
config
138+
for config in get_configs(args, command_args, ansible_args, glob_str)
139+
if config.scenario.name not in excludes
140+
)
140141

141142
scenarios = molecule.scenarios.Scenarios(
142143
configs,
143144
scenario_names,
144145
)
145146

146-
# Should do something with this?
147-
for scenario_name in scenario_names:
148-
if scenario_name != "*" and scenarios:
149-
LOG.info(
150-
"%s scenario test matrix: %s",
151-
scenario_name,
152-
", ".join(scenarios.sequence(scenario_name)),
153-
)
147+
if scenario_names is not None:
148+
for scenario_name in scenario_names:
149+
if scenario_name != "*" and scenarios:
150+
LOG.info(
151+
"%s scenario test matrix: %s",
152+
scenario_name,
153+
", ".join(scenarios.sequence(scenario_name)),
154+
)
154155

155156
for scenario in scenarios:
156157
if scenario.config.config["prerun"]:

0 commit comments

Comments
 (0)