updater hotfix
tests / package-smoke-linux (push) Skipped
tests / package-smoke-windows (push) Skipped
tests / package-smoke-macos (push) Skipped
tests / macos (push) Successful in 1m15s
tests / linux (push) Failing after 2m3s
tests / windows (push) Failing after 2m7s
release / create-release (push) Failing after 2s
release / build-linux (push) Skipped
release / build-windows (push) Skipped
release / build-macos (push) Skipped
release / publish (push) Skipped

Signed-off-by: galeon <dertiellis@gmail.com>
This commit is contained in:
galeon committed 2026-11-05 23:36:58 +03:00
1 parent f57d6d02fe
commit efb56a8411
5 files changed
+127 -23

No files matched your search

+66 -5
View File
@@ -8,14 +8,19 @@
#include "fixtures.h"
#include "launcherpaths.h"
#include "launcherupdates.h"
#include "launcherversion.h"
#include "localization.h"
#include <QGuiApplication>
#include <QJSValue>
#include <QJsonArray>
#include <QJsonDocument>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QQuickStyle>
#include <QQuickWindow>
#include <QSignalSpy>
#include <QtQml/qqmlextensionplugin.h>
Q_IMPORT_QML_PLUGIN(BiLauncherPlugin)
@@ -71,9 +76,22 @@ private slots:
const QString releasesUrl = QStringLiteral(
"https://projects-live.galeonworx.com/api/v1/repos/galeon/BiLauncher/releases");
const bool candidate = QStringLiteral(LAUNCHER_CHANNEL) == "rc";
const auto release = candidate
? R"([{"tag_name":"v1.0.0-rc1","prerelease":true,"published_at":"2026-10-14T10:52:02Z"}])"
: R"([{"tag_name":"v1.0.0","prerelease":false,"published_at":"2026-10-14T10:52:02Z"}])";
const QString version = candidate ? QStringLiteral("1.0.0-rc1") : QStringLiteral("1.0.0");
const QString tag = "v" + version;
QJsonArray assets;
for (const QString &suffix : {QStringLiteral("-win64-setup.exe"), QStringLiteral("-macOS-universal.dmg"),
QStringLiteral("-x86_64.AppImage")}) {
const QString name = "BiLauncher-" + version + suffix;
const QString url = "https://projects-live.galeonworx.com/galeon/BiLauncher/releases/download/"
+ tag + "/" + name;
assets.append(QJsonObject{{"name", name}, {"browser_download_url", url}, {"size", 1024}});
FakeResponse pending;
pending.hang = true;
m_net.route(url, pending);
}
const auto release = QJsonDocument(QJsonArray{QJsonObject{
{"tag_name", tag}, {"prerelease", candidate}, {"published_at", "2026-10-14T10:52:02Z"}, {"assets", assets}
}}).toJson();
m_net.route(releasesUrl, [candidate, release](const FakeRequest &request) {
const auto query = request.queryItems();
if (query.queryItemValue("pre-release") != (candidate ? "true" : "false"))
@@ -107,9 +125,52 @@ private slots:
? entriesProperty.value<QJSValue>().toVariant().toList()
: entriesProperty.toList();
QCOMPARE(entries.size(), 1);
QCOMPARE(entries.first().toMap().value("version").toString(),
candidate ? QStringLiteral("1.0.0-rc1") : QStringLiteral("1.0.0"));
QCOMPARE(entries.first().toMap().value("version").toString(), version);
#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) || (defined(Q_OS_LINUX) && defined(Q_PROCESSOR_X86_64))
auto *mainContext = qmlContext(window);
auto *updates = qobject_cast<LauncherUpdates *>(mainContext->objectForName("launcherUpdates"));
auto *panel = mainContext->objectForName("downloadPanel");
auto *content = versions->property("contentItem").value<QObject *>();
QVERIFY(content);
auto *dialogContext = qmlContext(content);
auto *installButton = dialogContext->objectForName("installButton");
auto *closeButton = dialogContext->objectForName("closeButton");
QVERIFY(updates);
QVERIFY(panel);
QVERIFY(installButton);
QVERIFY(closeButton);
QSignalSpy failed(updates, &LauncherUpdates::installationFailed);
QVERIFY(versions->setProperty("selectedVersion", version));
QVERIFY(installButton->property("enabled").toBool());
QVERIFY(QMetaObject::invokeMethod(installButton, "clicked"));
const auto url = entries.first().toMap().value("download").toString();
QTRY_COMPARE(m_net.hits(url), 1);
QVERIFY(!installButton->property("enabled").toBool());
QVERIFY(installButton->property("opacity").toDouble() < 1.0);
QVERIFY(closeButton->property("enabled").toBool());
QVERIFY(QMetaObject::invokeMethod(closeButton, "clicked"));
QTRY_VERIFY(!versions->property("visible").toBool());
QVERIFY(updates->installing());
QVERIFY(panel->property("visible").toBool());
QVERIFY(panel->property("title").toString().contains(version));
for (const auto *id : {"button", "profileBox", "buildButton", "folderButton", "settingsButton", "seasonsButton"}) {
auto *control = mainContext->objectForName(QString::fromLatin1(id));
QVERIFY(control);
QVERIFY2(!control->property("enabled").toBool(), id);
}
auto *seasonsButton = mainContext->objectForName("seasonsButton");
QCOMPARE(seasonsButton->property("opacity").toDouble(), 0.45);
QVERIFY(QMetaObject::invokeMethod(panel, "cancelRequested"));
QTRY_VERIFY(!updates->installing());
QVERIFY(!panel->property("visible").toBool());
QVERIFY(seasonsButton->property("enabled").toBool());
QCOMPARE(seasonsButton->property("opacity").toDouble(), 1.0);
QCOMPARE(failed.count(), 0);
#else
QVERIFY(QMetaObject::invokeMethod(versions, "close"));
#endif
// Смена языка на лету перестраивает Loc.t — биндинги не должны ломаться.
const QString titleEn = window->title();