commit:     6da7547c74c70d5edb361414269976709f162d3e
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  2 11:28:43 2021 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Oct  2 11:39:33 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6da7547c

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 <AT> gentoo.org>

 dev-python/mongoengine/mongoengine-0.23.1.ebuild | 48 ++++++++++++------------
 1 file 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 8bc583611f9..299f1c98034 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

Reply via email to