Skip to content

🐛 Fix status process in tests #361

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

Merged
merged 5 commits into from
Jul 19, 2022
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
2 changes: 1 addition & 1 deletion dev.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is a dev file for testing the changes to this repo
docker build . -t satel/python-base:latest
cd tests/
docker build . -t docker-python-base
docker build . --build-arg DEVFLAG=--dev -t docker-python-base

case $1 in
run)
Expand Down
20 changes: 11 additions & 9 deletions test_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ checkuser() {


reportvalidation() {
if [ -z "$1" ]
if [ "$1" -eq 0 ]
then
echo "OK"
else
echo -e "\e[1m\e[91mFAILED\e[21m\e[39m"
echo "$1"
echo "$2"
fi
}

Expand All @@ -39,15 +39,18 @@ python -m pytest -vv --durations=3 --cov ./ --cov-report term-missing $PYTEST_RE

echo -ne "$SECTION_PREFIX CHECK DOCKER USER IS PYTHON: "
USEROUT=`checkuser`
reportvalidation "$USEROUT"; STATUS2=$?
STATUS2=$?
reportvalidation "$STATUS2" "$USEROUT"

echo -ne "$SECTION_PREFIX CHECK TYPING: "
MYPYOUT=`mypy --cache-dir /home/python --no-error-summary . $MYPY_REPORTS`
reportvalidation "$MYPYOUT"; STATUS3=$?
STATUS3=$?
reportvalidation "$STATUS3" "$MYPYOUT"

echo -ne "$SECTION_PREFIX CHECK LINTING: "
FLAKE8OUT=`flake8`
reportvalidation "$FLAKE8OUT"; STATUS4=$?
STATUS4=$?
reportvalidation "$STATUS4" "$FLAKE8OUT"

echo -ne "$SECTION_PREFIX CHECK FORMATTING: "
BLACKOUT=`black --skip-string-normalization --line-length 99 ./ --check 2>&1`; STATUS5=$?
Expand All @@ -59,11 +62,10 @@ else
echo "$BLACKOUT"
fi

echo

echo -ne "$SECTION_PREFIX CHECK DOCSTRINGS: "
INTERROGATEOUT=`interrogate`
reportvalidation "$INTERROGATEOUT"; STATUS5=$?
STATUS5=$?
reportvalidation "$STATUS5" "$INTERROGATEOUT"

if [[ $1 == "reports" ]]
then
Expand All @@ -72,5 +74,5 @@ then
echo
fi

TOTAL=$((STATUS1 + STATUS2 + STATUS3 + STATUS4 + STATUS5 + STATUS6))
TOTAL=$((STATUS1 + STATUS2 + STATUS3 + STATUS4 + STATUS5))
exit $TOTAL
2 changes: 1 addition & 1 deletion tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG IMAGE_VERSION=satel/python-base:latest
FROM python:3.10.5-slim AS requirements-stage

RUN pip install poetry
COPY ./pyproject.toml ./poetry.lock* ./
COPY ./pyproject.toml ./poetry.lock ./

# Generate the requirement file
ARG DEVFLAG
Expand Down
Loading