Skip to content

Commit

Permalink
Merge pull request #25 from mundialis/grass_test_improvements
Browse files Browse the repository at this point in the history
improvements of grass tests
  • Loading branch information
anikaweinmann authored Nov 28, 2024
2 parents c28ffcd + 544524c commit 1a76381
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
9 changes: 8 additions & 1 deletion grass-gis-test-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
FROM osgeo/grass-gis:current-alpine
FROM osgeo/grass-gis:main-alpine

ARG NC_TEST_DATA=""

WORKDIR /src
COPY . /src
COPY test-docker/test.sh /src

RUN test -e test-docker/ && rm -rf test-docker/

RUN apk add gcc make python3-dev musl-dev linux-headers

# create environment to install requirements
RUN python -m venv addon-env
ENV PATH="/src/addon-env/bin:$PATH"
RUN test -e requirements.txt && pip3 install -r requirements.txt || echo "No requirements.txt"

# run tests if NC_TEST_DATA is set to NC with downloaded NC test loaction otherwise in empty location
Expand Down
17 changes: 10 additions & 7 deletions grass-gis-test-docker/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ fi
g.extension extension=${ADDON} url=. && \
for file in $(find . -type f -name test*.py) ; \
do \
echo ${file}
BASENAME=$(basename "${file}") ; \
DIR=$(dirname "${file}") ; \
cd ${CURRENTDIR}/${DIR} && python3 -m unittest ${BASENAME}
for res_file in $(test_keyvalue_result_*.txt) ; do
cat ${res_file}
done
if [[ ${file} != *"addon-env"* ]] ;
then
echo ${file}
BASENAME=$(basename "${file}") ; \
DIR=$(dirname "${file}") ; \
cd ${CURRENTDIR}/${DIR} && python -m unittest ${BASENAME}
for res_file in $(test_keyvalue_result_*.txt) ; do
cat ${res_file}
done
fi
done

0 comments on commit 1a76381

Please sign in to comment.