qa: Enable `interface_gui.py` on macOS
What changed, and why it matters
This commit re-enables a GUI test on macOS by changing the visual style used during automated testing. It is a quality-assurance/testing change, not a security fix. There is no indication it addresses a vulnerability or changes how real users run Bitcoin Core.
No security action needed. Treat as a normal test-infrastructure change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch removes the SkipTest for Darwin in interface_gui.py and sets QT_STYLE_OVERRIDE=fusion in test_node.py when running the GUI test on macOS. This works around a Qt/Cocoa issue (QTBUG-49686) where QMacStyle expects a native platform window that the minimal Qt platform plugin does not provide. The change is confined to the functional test framework and only affects test execution.
Changed components
test/functional/interface_gui.pytest/functional/test_framework/test_node.pyInspect captured patch +8 / −5
diff --git a/test/functional/interface_gui.py b/test/functional/interface_gui.py
index 7f05d720..7383bb65 100755
--- a/test/functional/interface_gui.py
+++ b/test/functional/interface_gui.py
@@ -21,11 +21,9 @@ class GuiTest(BitcoinTestFramework):
self.skip_if_no_gui()
# On Windows, bitcoin.exe exits immediately when launching bitcoin-gui.exe,
# causing the test framework's process monitor to see a premature node exit.
- # On macOS, bitcoin-qt's Cocoa code assumes NSApp is initialized, but the
- # minimal Qt platform plugin skips that, causing crashes.
- # Both issues are likely fixable.
- if platform.system() in ("Windows", "Darwin"):
- raise SkipTest("bitcoin-gui test not supported on Windows or macOS")
+ # This issue is likely fixable.
+ if platform.system() == "Windows":
+ raise SkipTest("bitcoin-gui test not supported on Windows")
def setup_nodes(self):
self.extra_init = [{"use_gui": True}]
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index de96cc60..24c76564 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -282,6 +282,11 @@ class TestNode():
subp_env = dict(os.environ, LIBC_FATAL_STDERR_="1")
if self.use_gui:
subp_env.setdefault("QT_QPA_PLATFORM", "minimal")
+ if platform.system() == "Darwin":
+ # QMacStyle assumes a Cocoa platform window, which the minimal platform
+ # does not provide. In particular, painting a QGroupBox can make Qt call
+ # addSubview: on an invalid native object (QTBUG-49686).
+ subp_env.setdefault("QT_STYLE_OVERRIDE", "fusion")
subp_env.setdefault("LC_ALL", "nl_NL.UTF-8") # Set language to try to trigger translation bugs
if sys.platform.startswith("linux") and "XDG_RUNTIME_DIR" not in subp_env:
# Qt prints warnings to stderr when XDG_RUNTIME_DIR is unset or has wrong
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.