summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2021-10-02 14:28:43 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2021-10-02 14:39:33 +0300
commit6da7547c74c70d5edb361414269976709f162d3e (patch)
tree3d14f83a4f9b69324362beb4ce586cfd33350b19
parentdev-python/mongomock: enable py3.10 (diff)
downloadgentoo-6da7547c.tar.gz
gentoo-6da7547c.tar.bz2
gentoo-6da7547c.zip
dev-python/mongoengine: enable py3.10, cleanup testing
- use EPYTEST_DESELECT for disabling tests - in case loading mongod fails, instead of redirecting to log file, output it, to make it easier sending build.log with all info Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--dev-python/mongoengine/mongoengine-0.23.1.ebuild48
1 files changed, 23 insertions, 25 deletions
diff --git a/dev-python/mongoengine/mongoengine-0.23.1.ebuild b/dev-python/mongoengine/mongoengine-0.23.1.ebuild
index 8bc583611f98..299f1c980342 100644
--- a/dev-python/mongoengine/mongoengine-0.23.1.ebuild
+++ b/dev-python/mongoengine/mongoengine-0.23.1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7..9} )
+PYTHON_COMPAT=( python3_{8..10} )
inherit distutils-r1
DESCRIPTION="A Python Object-Document-Mapper for working with MongoDB"
@@ -25,48 +25,46 @@ BDEPEND="
distutils_enable_tests pytest
-src_prepare() {
- # TODO: investigate
- sed -e 's:test_covered_index:_&:' \
- -i tests/document/test_indexes.py || die
- # no $eval
- sed -e 's:test_exec_js_field_sub:_&:' \
- -e 's:test_exec_js_query:_&:' \
- -e 's:test_item_frequencies_normalize:_&:' \
- -e 's:test_item_frequencies_with_0_values:_&:' \
- -e 's:test_item_frequencies_with_False_values:_&:' \
- -e 's:test_item_frequencies_with_null_embedded:_&:' \
- -i tests/queryset/test_queryset.py || die
- # TODO: investigate (wrong order? bad comparison?)
- sed -e 's:test_distinct_ListField_EmbeddedDocumentField:_&:' \
- -i tests/queryset/test_queryset.py || die
-
- distutils-r1_src_prepare
-}
-
python_test() {
+ local EPYTEST_DESELECT=(
+ # TODO: investigate
+ tests/document/test_indexes.py::TestIndexes::test_collation
+ tests/document/test_indexes.py::TestIndexes::test_covered_index
+ tests/document/test_indexes.py::TestIndexes::test_create_geohaystack_index
+ # no $eval
+ tests/queryset/test_queryset.py::TestQueryset::test_exec_js_query
+ tests/queryset/test_queryset.py::TestQueryset::test_exec_js_field_sub
+ tests/queryset/test_queryset.py::TestQueryset::test_item_frequencies_normalize
+ tests/queryset/test_queryset.py::TestQueryset::test_item_frequencies_with_0_values
+ tests/queryset/test_queryset.py::TestQueryset::test_item_frequencies_with_False_values
+ tests/queryset/test_queryset.py::TestQueryset::test_item_frequencies_with_null_embedded
+ # TODO: investigate (wrong order? bad comparison?)
+ tests/queryset/test_queryset.py::TestQueryset::test_distinct_ListField_EmbeddedDocumentField
+ )
+
local dbpath=${TMPDIR}/mongo.db
local logpath=${TMPDIR}/mongod.log
+ local DB_PORT=27017
mkdir -p "${dbpath}" || die
ebegin "Trying to start mongod on port ${DB_PORT}"
LC_ALL=C \
mongod --dbpath "${dbpath}" --nojournal \
- --bind_ip 127.0.0.1 --port 27017 \
+ --bind_ip 127.0.0.1 --port ${DB_PORT} \
--unixSocketPrefix "${TMPDIR}" \
--logpath "${logpath}" --fork || die
sleep 2
# Now we need to check if the server actually started...
- if [[ -S "${TMPDIR}"/mongodb-27017.sock ]]; then
+ if [[ -S "${TMPDIR}"/mongodb-${DB_PORT}.sock ]]; then
# yay!
eend 0
else
eend 1
- eerror "Unable to start mongod for tests. See the server log:"
- eerror " ${logpath}"
- die "Unable to start mongod for tests."
+ eerror "Unable to start mongod for tests. Here is the server log:"
+ cat "${logpath}"
+ die "Unable to start mongod for tests"
fi
local failed