44import json
55import os
66import re
7+ import subprocess
78import sys
89from pathlib import Path
910from typing import Optional
@@ -200,13 +201,16 @@ def test_integration(
200201
201202
202203@task (aliases = ["tf" ])
203- def test_fuzz (context ):
204+ def test_fuzz (context , long : bool = False ):
205+ arg_long = "--long" if long else ""
206+
204207 run_invoke (
205208 context ,
206- """
209+ f """
207210 python html2pdf4doc/html2pdf4doc_fuzzer.py
208211 tests/fuzz/01_strictdoc_guide_202510/strictdoc/docs/strictdoc_01_user_guide-PDF.html
209212 tests/fuzz/01_strictdoc_guide_202510/
213+ { arg_long }
210214 """ ,
211215 )
212216
@@ -355,16 +359,25 @@ def _is_full_ci_test() -> bool:
355359 Returns True if the tag is found in PR body/title or commit message.
356360 Returns False for local runs or when tag not found.
357361 """
362+
363+ if "@full_test" in _get_last_commit_message_or_empty ():
364+ print ("[is_full_ci_test] @full_test found in the last commit message." ) # noqa: T201
365+ return True
366+
358367 event_name = os .getenv ("GITHUB_EVENT_NAME" )
359368 event_path = os .getenv ("GITHUB_EVENT_PATH" )
360369
361- # No GitHub env (e.g. local run)
370+ # No GitHub env (e.g. local run).
362371 if not event_name or not event_path or not Path (event_path ).exists ():
363372 print ( # noqa: T201
364373 "[is_full_ci_test] No GitHub environment detected — running in local mode."
365374 )
366375 return False
367376
377+ if event_name == "schedule" :
378+ "[is_full_ci_test] Detected scheduled run."
379+ return True
380+
368381 try :
369382 with open (event_path , encoding = "utf-8" ) as f :
370383 event = json .load (f )
@@ -376,25 +389,29 @@ def _is_full_ci_test() -> bool:
376389
377390 tag = "@full_test"
378391
379- # Check PR body/title
392+ # Check PR body.
380393 if event_name == "pull_request" :
381394 pr = event .get ("pull_request" , {})
382395 body = (pr .get ("body" ) or "" ).lower ()
383- title = (pr .get ("title" ) or "" ).lower ()
384- if tag in body or tag in title :
385- print ( # noqa: T201
386- "[is_full_ci_test] Detected @full_test in PR body/title."
387- )
388- return True
389396
390- # Check commit message
391- if event_name == "push" :
392- commit_msg = (event .get ("head_commit" , {}).get ("message" ) or "" ).lower ()
393- if tag in commit_msg :
397+ if tag in body :
394398 print ( # noqa: T201
395- "[is_full_ci_test] Detected @full_test in commit message ."
399+ "[is_full_ci_test] Detected @full_test in PR title ."
396400 )
397401 return True
398402
399403 print ("[is_full_ci_test] @full_test not found." ) # noqa: T201
400404 return False
405+
406+
407+ def _get_last_commit_message_or_empty () -> str :
408+ try :
409+ result = subprocess .run (
410+ ["git" , "log" , "-1" , "--pretty=%B" ],
411+ capture_output = True ,
412+ text = True ,
413+ check = True ,
414+ )
415+ return result .stdout .strip ().lower ()
416+ except Exception :
417+ return ""
0 commit comments