From d7bc62ee7dc784b6e8ed0f0dd1bb08f2deecaa11 Mon Sep 17 00:00:00 2001 From: zargot Date: Tue, 2 Jan 2024 12:00:48 -0500 Subject: [PATCH 1/3] add integration test for package import --- inttests/test_import.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 inttests/test_import.sh diff --git a/inttests/test_import.sh b/inttests/test_import.sh new file mode 100755 index 00000000..ab1035a7 --- /dev/null +++ b/inttests/test_import.sh @@ -0,0 +1,14 @@ +# run with the lowest required python version (as specified in pyproject.toml) + +set -ex + +repo=$(dirname $(realpath $0))/.. +url="git+file://$repo" +dir=$(mktemp -d) + +cd $dir +python -m venv .env +source .env/bin/activate + +pip install $url +python -c 'from odm_validation.validation import validate_data' From d02864d2748ad8e76a58ec5087414ba3b51b24f3 Mon Sep 17 00:00:00 2001 From: zargot Date: Tue, 2 Jan 2024 13:18:31 -0500 Subject: [PATCH 2/3] add readme --- inttests/README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 inttests/README.md diff --git a/inttests/README.md b/inttests/README.md new file mode 100644 index 00000000..7169a998 --- /dev/null +++ b/inttests/README.md @@ -0,0 +1,6 @@ +This directory holds all integration tests. The tests are mainly to be run by +CI, but can also be run manually. + +The main reason for having integration tests is to make sure that the package +can be imported and used as intended, something that can't be verified with +unit-tests alone. From 45f425e809c2f0541e2d4e5b29f70c56cc003aa0 Mon Sep 17 00:00:00 2001 From: zargot Date: Tue, 2 Jan 2024 13:26:20 -0500 Subject: [PATCH 3/3] tweak --- inttests/test_import.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/inttests/test_import.sh b/inttests/test_import.sh index ab1035a7..7f5a9fbe 100755 --- a/inttests/test_import.sh +++ b/inttests/test_import.sh @@ -1,7 +1,12 @@ -# run with the lowest required python version (as specified in pyproject.toml) +#!/bin/bash + +# XXX: must be run with lowest required python version (as specified in +# pyproject.toml), to ensure compatibility set -ex +[[ "$(python --version)" == "Python 3.8."* ]] + repo=$(dirname $(realpath $0))/.. url="git+file://$repo" dir=$(mktemp -d) @@ -11,4 +16,4 @@ python -m venv .env source .env/bin/activate pip install $url -python -c 'from odm_validation.validation import validate_data' +python -c "from odm_validation.validation import validate_data"