Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
rpelisse committed Jun 27, 2024
1 parent 02bc369 commit 82dcba4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ansible/molecule/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ MOLECULE_DEBUG=${MOLECULE_DEBUG:-'--no-debug'}
MOLECULE_KEEP_CACHE=${MOLECULE_KEEP_CACHE:-''}
MOLECULE_CONFIG_FILE_HOME=${MOLECULE_CONFIG_FILE_HOME:-'.config/molecule/'}
MOLECULE_CONFIG_FILE=${MOLECULE_CONFIG_FILE:-"${MOLECULE_CONFIG_FILE_HOME}/config.yml"}
MOLECULE_RUN_SCENARIOS_IN_PARALEL=${MOLECULE_RUN_SCENARIOS_IN_PARALEL:-''}
MOLECULE_RUN_SCENARIOS_IN_PARRALEL=${MOLECULE_RUN_SCENARIOS_IN_PARRALEL:-''}

determineMoleculeVersion() {
echo "$(molecule --version | head -1 | sed -e 's/using python .*$//' -e 's/^molecule *//' -e 's/ //g' | grep -e '4' | wc -l )"
Expand Down Expand Up @@ -93,7 +93,7 @@ printScenariosThatFailed() {
}

configMolForParralelRuns() {
if [ -z "${MOLECULE_RUN_SCENARIOS_IN_PARALEL}" ]; then
if [ -z "${MOLECULE_RUN_SCENARIOS_IN_PARRALEL}" ]; then
if [ -e "${MOLECULE_CONFIG_FILE}" ] ; then
echo "Molecule configuration file already exists: ${MOLECULE_CONFIG_FILE}."
echo "Skipping creation and configuration for parallel runs, it is assumed that configuration allow parralel execution of the projet scenarios."
Expand All @@ -117,9 +117,9 @@ runAllMoleculeScenarios() {
}

listAllScenarios() {
for f in $(find molecule/*/molecule.yml -maxdepth 1 -print)
for molecule_xml in $(find molecule/*/molecule.yml -maxdepth 1 -print)
do
echo $(basename $(dirname "${f}"))
echo $(basename $(dirname "${molecule_xml}"))
done
}

Expand All @@ -131,7 +131,7 @@ runAllMoleculeScenariosInParralel() {
configMolForParralelRuns
for scenario_name in $(listAllScenarios)
do
echo "DEBUG> molecule ${MOLECULE_DEBUG} test --parallel -s "${scenario_name}" -d "${scenario_driver_name}" -- ${extra_args}" -e wildfly_node_id=${scenario_name} ${extra_args} "${@}" &> "${scenario_name}.log &"
echo "DEBUG> molecule ${MOLECULE_DEBUG} test --parallel -s "${scenario_name}" -d "${scenario_driver_name}" -- ${extra_args}" -e wildfly_node_id=${scenario_name} ${extra_args} "${@}" '&>' "${scenario_name}.log '&'"
# shellcheck disable=SC2086
molecule ${MOLECULE_DEBUG} test --parallel -s "${scenario_name}" -d "${scenario_driver_name}" -- -e wildfly_node_id=${scenario_name} ${extra_args} "${@}" &> "${scenario_name}.log" &
pids["${scenario_name}"]="${!}"
Expand Down Expand Up @@ -163,7 +163,7 @@ runMoleculeScenario() {
if [ "${scenario_name}" != '--all' ]; then
executeRequestedScenarios "${scenario_name}" "${scenario_driver_name}" "${extra_args}"
else
if [ -z "${MOLECULE_RUN_SCENARIOS_IN_PARALEL}" ]; then
if [ -z "${MOLECULE_RUN_SCENARIOS_IN_PARRALEL}" ]; then
MOLECULE_RUN_STATUS="$(runAllMoleculeScenarios '--all' "${scenario_driver_name}" ${extra_args})"
else
runAllMoleculeScenariosInParralel "${scenario_driver_name}" ${extra_args}
Expand Down

0 comments on commit 82dcba4

Please sign in to comment.