Backport pause/resume test observation fix for 0.0.3-2
This commit is contained in:
1 parent
9543da587c
commit
7043dc72d3
2 files changed
+73
-3
No files matched your search
@@ -2,7 +2,7 @@
|
||||
# Maintainer: Tom Ballard (tcballard)
|
||||
pkgname=omarchy-task-manager
|
||||
pkgver=0.0.3
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
url='https://github.com/tcballard/omarchy-task-manager'
|
||||
pkgdesc='Floating native task manager for Omarchy (preview)'
|
||||
arch=('x86_64')
|
||||
@@ -11,8 +11,16 @@ depends=('qt6-base' 'qt6-declarative' 'qt6-wayland' 'qt6-svg' 'hicolor-icon-them
|
||||
optdepends=('gdb: live process core dumps' 'nvidia-utils: NVIDIA device telemetry')
|
||||
makedepends=('cmake' 'ninja' 'rust' 'cargo')
|
||||
checkdepends=('python' 'desktop-file-utils')
|
||||
source=("$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz")
|
||||
sha256sums=('cc3e24a0bb8fad2b7ce0d4fb780aa774d32b53b8de924b488b55674bdb936c85')
|
||||
source=("$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz"
|
||||
"pause-resume-test.patch")
|
||||
sha256sums=('cc3e24a0bb8fad2b7ce0d4fb780aa774d32b53b8de924b488b55674bdb936c85'
|
||||
'ee97d57fed9f9d8b542b934f177560c8a6f0801642767d4d0787a183deafd09a')
|
||||
|
||||
# Backport the test observation fix from upstream PR #11.
|
||||
prepare() {
|
||||
cd "$srcdir/$pkgname-$pkgver"
|
||||
patch -Np1 -i "$srcdir/pause-resume-test.patch"
|
||||
}
|
||||
|
||||
build() {
|
||||
cmake -S "$srcdir/$pkgname-$pkgver" -B build -G Ninja \
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
diff --git a/tests/bridge_test.cpp b/tests/bridge_test.cpp
|
||||
index bab79f2..9c9a38e 100644
|
||||
--- a/tests/bridge_test.cpp
|
||||
+++ b/tests/bridge_test.cpp
|
||||
@@ -79,37 +79,52 @@ private slots:
|
||||
const auto before = bridge.history().size();
|
||||
QTest::qWait(1100);
|
||||
QCOMPARE(bridge.history().size(), before);
|
||||
- QSignalSpy samples(&bridge, &Bridge::snapshotChanged);
|
||||
+ // Capture at emission: QTRY processes events, so another timer sample can
|
||||
+ // replace bridge.snapshot() before the waiting assertion runs.
|
||||
+ QVariantList samples;
|
||||
+ QList<int> historySizes;
|
||||
+ connect(&bridge, &Bridge::snapshotChanged, &bridge, [&] {
|
||||
+ samples.append(bridge.snapshot());
|
||||
+ historySizes.append(bridge.history().size());
|
||||
+ });
|
||||
bridge.setPaused(false);
|
||||
QTRY_VERIFY_WITH_TIMEOUT(samples.count() > 0, 8000);
|
||||
- QVERIFY(!bridge.snapshot()
|
||||
+ QVERIFY(!samples.first().toMap()
|
||||
.value("system")
|
||||
.toMap()
|
||||
.value("continuous")
|
||||
.toBool());
|
||||
- QCOMPARE(bridge.history().size(), 1);
|
||||
+ QCOMPARE(historySizes.first(), 1);
|
||||
bridge.active(false);
|
||||
QTest::qWait(600);
|
||||
samples.clear();
|
||||
+ historySizes.clear();
|
||||
bridge.active(true);
|
||||
QTRY_VERIFY_WITH_TIMEOUT(samples.count() > 0, 8000);
|
||||
- QVERIFY(!bridge.snapshot()
|
||||
+ QVERIFY(!samples.first().toMap()
|
||||
.value("system")
|
||||
.toMap()
|
||||
.value("continuous")
|
||||
.toBool());
|
||||
QTRY_VERIFY_WITH_TIMEOUT(!bridge.busy(), 8000);
|
||||
samples.clear();
|
||||
+ historySizes.clear();
|
||||
bridge.refresh();
|
||||
QVERIFY(bridge.busy());
|
||||
bridge.setPaused(true);
|
||||
bridge.setPaused(false);
|
||||
QTRY_VERIFY_WITH_TIMEOUT(samples.count() > 0, 8000);
|
||||
- QVERIFY(!bridge.snapshot()
|
||||
+ QVERIFY(!samples.first().toMap()
|
||||
.value("system")
|
||||
.toMap()
|
||||
.value("continuous")
|
||||
.toBool());
|
||||
+ QCOMPARE(historySizes.first(), 1);
|
||||
+ // Keep automatic refresh enabled. The baseline must be followed by a
|
||||
+ // continuous sample; inspecting only the latest snapshot misses this order.
|
||||
+ QTRY_VERIFY_WITH_TIMEOUT(samples.count() >= 2, 8000);
|
||||
+ QVERIFY(samples.at(1).toMap().value("system").toMap()
|
||||
+ .value("continuous").toBool());
|
||||
QTRY_VERIFY_WITH_TIMEOUT(!bridge.busy(), 8000);
|
||||
QVERIFY(bridge.prepareManagement({{"category", "startup"}}).isEmpty());
|
||||
QVERIFY(
|
||||
Reference in new issue
Block a user