Skip to content

test: improve handwritten test doubles #258

test: improve handwritten test doubles

test: improve handwritten test doubles #258

# Copyright (c) 2026 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
name: GUI Functional Tests
on:
pull_request:
push:
branches:
- "**"
tags-ignore:
- "**"
workflow_dispatch:
jobs:
qml-functional-tests:
runs-on: ubuntu-24.04
env:
LEGACY_BITCOIND_VERSION: "28.0"
QT_COMPAT_VERSION: "31.0"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential cmake curl pkgconf python3 \
xvfb xauth \
libevent-dev libboost-dev libsqlite3-dev libgl-dev libqrencode-dev \
qt6-qpa-plugins \
qt6-base-dev qt6-tools-dev qt6-l10n-tools qt6-tools-dev-tools \
qt6-declarative-dev \
qml6-module-qtqml qml6-module-qtqml-models qml6-module-qtqml-workerscript qml6-module-qt-labs-settings \
qml6-module-qtquick qml6-module-qtquick-window \
qml6-module-qtquick-layouts qml6-module-qtquick-controls \
qml6-module-qtquick-dialogs qml6-module-qtquick-templates
- name: Restore legacy bitcoind cache
uses: actions/cache/restore@v4
id: legacy-bitcoind-cache
with:
path: releases/v${{ env.LEGACY_BITCOIND_VERSION }}
key: ${{ runner.os }}-legacy-bitcoind-v${{ env.LEGACY_BITCOIND_VERSION }}
- name: Install legacy bitcoind
run: |
archive="bitcoin-${LEGACY_BITCOIND_VERSION}-x86_64-linux-gnu.tar.gz"
base_url="https://bitcoincore.org/bin/bitcoin-core-${LEGACY_BITCOIND_VERSION}"
legacy_dir="${GITHUB_WORKSPACE}/releases/v${LEGACY_BITCOIND_VERSION}"
mkdir -p "${legacy_dir}"
if [ ! -x "${legacy_dir}/bin/bitcoind" ]; then
workdir="$(mktemp -d)"
trap 'rm -rf "${workdir}"' EXIT
curl -fsSLo "${workdir}/${archive}" "${base_url}/${archive}"
curl -fsSLo "${workdir}/SHA256SUMS" "${base_url}/SHA256SUMS"
(
cd "${workdir}"
grep " ${archive}$" "SHA256SUMS" | sha256sum -c -
)
tar -xzf "${workdir}/${archive}" \
--strip-components=1 \
-C "${legacy_dir}" \
"bitcoin-${LEGACY_BITCOIND_VERSION}/bin"
fi
"${legacy_dir}/bin/bitcoind" --version | head -n 1
- name: Save legacy bitcoind cache
uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.legacy-bitcoind-cache.outputs.cache-hit != 'true'
with:
path: releases/v${{ env.LEGACY_BITCOIND_VERSION }}
key: ${{ runner.os }}-legacy-bitcoind-v${{ env.LEGACY_BITCOIND_VERSION }}
- name: Restore bitcoin-qt compatibility cache
uses: actions/cache/restore@v4
id: bitcoin-qt-compat-cache
with:
path: releases/v${{ env.QT_COMPAT_VERSION }}
key: ${{ runner.os }}-bitcoin-qt-v${{ env.QT_COMPAT_VERSION }}
- name: Install bitcoin-qt compatibility binary
run: |
archive="bitcoin-${QT_COMPAT_VERSION}-x86_64-linux-gnu.tar.gz"
base_url="https://bitcoincore.org/bin/bitcoin-core-${QT_COMPAT_VERSION}"
compat_dir="${GITHUB_WORKSPACE}/releases/v${QT_COMPAT_VERSION}"
mkdir -p "${compat_dir}"
if [ ! -x "${compat_dir}/bin/bitcoin-qt" ]; then
workdir="$(mktemp -d)"
trap 'rm -rf "${workdir}"' EXIT
curl -fsSLo "${workdir}/${archive}" "${base_url}/${archive}"
curl -fsSLo "${workdir}/SHA256SUMS" "${base_url}/SHA256SUMS"
(
cd "${workdir}"
grep " ${archive}$" "SHA256SUMS" | sha256sum -c -
)
tar -xzf "${workdir}/${archive}" \
--strip-components=1 \
-C "${compat_dir}" \
"bitcoin-${QT_COMPAT_VERSION}/bin"
fi
"${compat_dir}/bin/bitcoin-qt" --version | head -n 1
- name: Save bitcoin-qt compatibility cache
uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.bitcoin-qt-compat-cache.outputs.cache-hit != 'true'
with:
path: releases/v${{ env.QT_COMPAT_VERSION }}
key: ${{ runner.os }}-bitcoin-qt-v${{ env.QT_COMPAT_VERSION }}
- name: Configure
run: |
cmake -B build \
-DBUILD_APP_TESTS=OFF \
-DENABLE_TEST_AUTOMATION=ON \
-DBUILD_DAEMON=ON \
-DENABLE_IPC=OFF
- name: Build
run: |
cmake --build build -j"$(nproc)"
- name: Run QML test automation suite
env:
QT_QUICK_BACKEND: software
LIBGL_ALWAYS_SOFTWARE: "1"
run: |
export BITCOIND_LEGACY="${GITHUB_WORKSPACE}/releases/v${LEGACY_BITCOIND_VERSION}/bin/bitcoind"
export BITCOIN_QT_COMPAT="${GITHUB_WORKSPACE}/releases/v${QT_COMPAT_VERSION}/bin/bitcoin-qt"
export BITCOIN_QT_RUNNER="xvfb-run -a"
python3 test/functional/qml_test_bridge_sanity.py
python3 test/functional/qml_test_onboarding.py
python3 test/functional/qml_test_preinit_onboarding.py
python3 test/functional/qml_test_disablewallet_boot.py
python3 test/functional/qml_test_blockclock.py
python3 test/functional/qml_test_blocksonly_settings.py
python3 test/functional/qml_test_external_signer.py
python3 test/functional/qml_test_peers.py
python3 test/functional/qml_test_proxy.py
python3 test/functional/qml_test_debug_log.py
python3 test/functional/qml_test_node_runtime_dialogs.py
python3 test/functional/qml_test_settings_display.py
python3 test/functional/qml_test_resetguisettings.py
python3 test/functional/qml_test_receive.py
python3 test/functional/qml_test_activity_filter_export.py
python3 test/functional/qml_test_password_wallet.py
python3 test/functional/qml_test_send_receive.py
python3 test/functional/qml_test_addresses.py
python3 test/functional/qml_test_send_review.py
python3 test/functional/qml_test_psbt.py
python3 test/functional/qml_test_wallet_migration.py
python3 test/functional/qml_test_wallet_qt_compat.py
python3 test/functional/qml_test_wallet_rbf.py
python3 test/functional/qml_test_wallet_restore.py
python3 test/functional/qml_test_uri_import.py
python3 test/functional/qml_test_wallet_settings.py
python3 test/functional/qml_test_watchonly_wallet.py
python3 test/functional/qml_test_create_wallet_name.py
python3 test/functional/qml_test_wallet_selector_load.py
python3 test/functional/qml_test_shutdown.py
python3 test/functional/qml_test_console.py
python3 test/functional/qml_test_tray.py
python3 test/functional/qml_test_window_geometry.py