]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Turn on doctest in CI
authorNicki Křížek <nicki@isc.org>
Mon, 16 Jun 2025 13:51:51 +0000 (15:51 +0200)
committerNicki Křížek <nicki@isc.org>
Fri, 18 Jul 2025 11:11:28 +0000 (13:11 +0200)
Run doctests for the isctest module in a dedicated CI job.

(cherry picked from commit d737986ea24bdcb344a91a491816766b80120c15)

.gitlab-ci.yml
bin/tests/system/isctest/mark.py

index 5e674bfcced234eed937c0cd0c404922696787cd..681f7143e48323a8b2c57e5b600da0382c1a50b7 100644 (file)
@@ -618,6 +618,19 @@ coccinelle:
     - util/check-cocci
     - if test "$(git status --porcelain | grep -Ev '\?\?' | wc -l)" -gt "0"; then git status --short; exit 1; fi
 
+doctest:
+  <<: *precheck_job
+  script:
+    - *configure
+    - *find_pytest
+    - export TOP_BUILDDIR=$(cat bin/tests/system/isctest/vars/.ac_vars/TOP_BUILDDIR)
+    - cd bin/tests/system/isctest
+    - >
+      "$PYTEST" --noconftest --doctest-modules
+  needs:
+    - job: autoreconf
+      artifacts: true
+
 pylint:
   <<: *precheck_job
   needs: []
index c04f8a84e23d6d2575a31d2fd1147802e130e4d2..ccd57090df85e45cabd263c7e3731f8943056ce2 100644 (file)
@@ -32,7 +32,9 @@ live_internet_test = pytest.mark.skipif(
 
 
 def feature_test(feature):
-    feature_test_bin = os.environ["FEATURETEST"]
+    feature_test_bin = os.environ.get("FEATURETEST")
+    if not feature_test_bin:  # this can be the case when running doctest
+        return False
     try:
         subprocess.run([feature_test_bin, feature], check=True)
     except subprocess.CalledProcessError as exc: