public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-sphinx] rawhide: Run test in parallel in Fedora
@ 2026-06-29 11:11 Karolina Surma
  0 siblings, 0 replies; only message in thread
From: Karolina Surma @ 2026-06-29 11:11 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-sphinx
            Branch : rawhide
            Commit : 49315c5c913d260facc892ce05755235e1d21ed7
            Author : Karolina Surma <ksurma@redhat.com>
            Date   : 2026-06-29T11:20:14+02:00
            Stats  : +38/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-sphinx/c/49315c5c913d260facc892ce05755235e1d21ed7?branch=rawhide

            Log:
            Run test in parallel in Fedora

Sphinx' test run lasts quite long, so running in parallel is beneficial
for everybody building the package.
The parallel run uncovered a test bug, fix for which has been submitted
upstream.

---
diff --git a/14507.patch b/14507.patch
new file mode 100644
index 0000000..3cea526
--- /dev/null
+++ b/14507.patch
@@ -0,0 +1,29 @@
+From b9386884a3a4d65db1d69b83026339c5d72442d5 Mon Sep 17 00:00:00 2001
+From: Karolina Surma <ksurma@redhat.com>
+Date: Mon, 29 Jun 2026 11:00:42 +0200
+Subject: [PATCH] Fix test_gettext_literalblock_additional to use the correct
+ test root
+
+test-root doesn't contain the source file for literalblock.pot. The test
+passed sequentially because other tests using test root 'intl' left the
+file in the same srcdir. With pytest-xdist, the test started correctly failing,
+as no leftover file was available during the test run.
+Using the test root 'intl', which contains literalblock.txt, fixes the
+test.
+---
+ tests/test_builders/test_build_gettext.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_builders/test_build_gettext.py b/tests/test_builders/test_build_gettext.py
+index 30798cc5070..8a1827ba281 100644
+--- a/tests/test_builders/test_build_gettext.py
++++ b/tests/test_builders/test_build_gettext.py
+@@ -288,7 +288,7 @@ def test_gettext_prolog_epilog_substitution_excluded(app: SphinxTestApp) -> None
+ 
+ @pytest.mark.sphinx(
+     'gettext',
+-    testroot='root',
++    testroot='intl',
+     srcdir='gettext',
+     confoverrides={
+         'gettext_compact': False,

diff --git a/python-sphinx.spec b/python-sphinx.spec
index 518787d..2a98fd1 100644
--- a/python-sphinx.spec
+++ b/python-sphinx.spec
@@ -44,6 +44,10 @@ Patch:      sphinx-test_theming.patch
 # Fix for test_stemmer failing with Python 3.15+, merged upstream
 Patch:      https://github.com/sphinx-doc/sphinx/pull/14474.patch
 
+# Fix test_gettext_literalblock_additional failure with pytest-xdist:
+# the test used testroot='root' which lacks literalblock.txt
+Patch:      https://github.com/sphinx-doc/sphinx/pull/14507.patch
+
 # Make the first party extensions optional
 # This removes the runtime dependencies on:
 #  - sphinxcontrib.applehelp
@@ -88,6 +92,10 @@ BuildRequires: texinfo
 BuildRequires: ImageMagick
 %endif
 
+%if %{undefined rhel}
+BuildRequires: python%{python3_pkgversion}-pytest-xdist
+%endif
+
 %if %{undefined rhel} && %{with latex_tests}
 BuildRequires: texlive-collection-fontsrecommended
 BuildRequires: texlive-collection-latex
@@ -480,7 +488,7 @@ k="${k} and not test_term_in_heading_and_section and not test_IndexBuilder"
 k="${k} and not test_check_js_search_indexes"
 %endif
 
-%pytest -k "${k}"
+%pytest -k "${k}" %{!?rhel:-n auto}
 %endif
 
 %files -n python%{python3_pkgversion}-sphinx -f sphinx.lang

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-06-29 11:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 11:11 [rpms/python-sphinx] rawhide: Run test in parallel in Fedora Karolina Surma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox