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

Ensure helper.py script can be called #44

Merged
Merged
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
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ else
fi

# Check optimade-python-tools version is >0.10
PACKAGE_VERSION=($(python helper.py package-version))
PACKAGE_VERSION=($(python /helper.py package-version))

if [ ${PACKAGE_VERSION[0]} -eq 0 ] && [ ${PACKAGE_VERSION[1]} -lt 10 ]; then
echo "Incompatible validator version requested ${INPUT_VALIDATOR_VERSION}, please use >=0.10."
Expand Down Expand Up @@ -124,7 +124,7 @@ if [ "${INPUT_PATH}" = "/" ]; then
else
filler="/v"
fi
API_VERSION=($(python helper.py api-versions))
API_VERSION=($(python /helper.py api-versions))
case ${INPUT_ALL_VERSIONED_PATHS} in
y | Y | yes | Yes | YES | true | True | TRUE | on | On | ON)
for version in "${API_VERSION[@]}"; do
Expand Down Expand Up @@ -157,7 +157,7 @@ esac
EXIT_CODE=${PIPESTATUS[0]}

# Create output 'results'
RESULTS=$(python helper.py results)
RESULTS=$(python /helper.py results)
echo "::set-output name=results::${RESULTS}"

exit ${EXIT_CODE}
6 changes: 5 additions & 1 deletion tests/test_fixtures.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ function setup_file() {
rm -f ${DOCKER_BATS_WORKDIR}/tests/.entrypoint-run_validator.txt
rm -f ${ENTRYPOINT_SH}

# Comment out "set -e" from entrypoint.sh in a new test entrypoint.sh
# Create BATS test entrypoint.sh at ${ENTRYPOINT_SH}
while IFS="" read -r line || [ -n "${line}" ]; do
if [[ "${line}" =~ ^set[[:blank:]]-e$ ]]; then
# Comment out "set -e" from entrypoint.sh in a new test entrypoint.sh
line="# ${line}"
fi
if [[ "${line}" =~ ^.*helper\.py.*$ ]]; then
line="${line/\/helper\.py/helper.py}"
fi
printf "%s\n" "${line}" >> ${ENTRYPOINT_SH}
done < ${REAL_ENTRYPOINT_SH}
chmod +x ${ENTRYPOINT_SH}
Expand Down