Skip to content

Commit 61e5c4e

Browse files
author
Mohammod Al Amin Ashik
committed
updates tests
1 parent 31e3266 commit 61e5c4e

139 files changed

Lines changed: 6968 additions & 4344 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 91 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,69 @@ on:
66
pull_request:
77
branches: [main]
88

9+
# Cancel in-progress runs when a new commit is pushed to the same PR.
10+
# PR: same group per PR so new push cancels previous run. Push to main: unique group so no cancel.
911
concurrency:
10-
group: ${{ github.workflow }}-${{ github.ref }}
11-
cancel-in-progress: true
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
13+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
1214

1315
env:
1416
CARGO_TERM_COLOR: always
1517
RUST_BACKTRACE: 1
1618
# Cache keys for better hit rates
1719
RUST_CACHE_KEY: v1
1820
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.cache/ms-playwright
21+
# Linux: pkg-config must find glib-2.0.pc (set before any cargo step; only used on Linux)
22+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
1923

2024
jobs:
2125
# ─────────────────────────────────────────────────────────────
2226
# Rust Checks (fast, single platform)
2327
# ─────────────────────────────────────────────────────────────
2428
rust-check:
25-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-22.04
2630
steps:
2731
- uses: actions/checkout@v4
28-
- uses: dtolnay/rust-toolchain@stable
29-
with:
30-
components: rustfmt, clippy
31-
- uses: Swatinem/rust-cache@v2
3232

3333
- name: Install Linux deps
3434
run: |
3535
sudo apt-get update
36-
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev
36+
sudo apt-get install -y build-essential pkg-config libglib2.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev
37+
echo "=== Verifying glib-2.0 installation ==="
38+
dpkg -l | grep libglib2.0-dev || echo "libglib2.0-dev not installed"
39+
find /usr -name 'glib-2.0.pc' 2>/dev/null || echo "glib-2.0.pc not found"
40+
pkg-config --modversion glib-2.0 || echo "pkg-config cannot find glib-2.0"
41+
pkg-config --exists 'glib-2.0 >= 2.70' && echo "glib-2.0 >= 2.70 found" || (echo "ERROR: glib-2.0 >= 2.70 not found"; exit 1)
42+
echo "PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config)" >> $GITHUB_ENV
43+
44+
- uses: dtolnay/rust-toolchain@stable
45+
with:
46+
components: rustfmt, clippy
47+
env:
48+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
49+
50+
- uses: Swatinem/rust-cache@v2
51+
env:
52+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
3753

3854
- name: Format check
3955
run: cargo fmt --all --check
4056

4157
- name: Clippy
4258
run: cargo clippy --workspace -- -D warnings
59+
env:
60+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
4361

4462
- name: Check (no features)
4563
run: cargo check --workspace
64+
env:
65+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
4666

4767
# ─────────────────────────────────────────────────────────────
4868
# TypeScript Checks (fast)
4969
# ─────────────────────────────────────────────────────────────
5070
ts-check:
51-
runs-on: ubuntu-latest
71+
runs-on: ubuntu-22.04
5272
steps:
5373
- uses: actions/checkout@v4
5474
- uses: pnpm/action-setup@v4
@@ -72,7 +92,7 @@ jobs:
7292
fail-fast: false
7393
matrix:
7494
include:
75-
- os: ubuntu-latest
95+
- os: ubuntu-22.04
7696
target: x86_64-unknown-linux-gnu
7797
- os: windows-latest
7898
target: x86_64-pc-windows-msvc
@@ -82,20 +102,27 @@ jobs:
82102
runs-on: ${{ matrix.os }}
83103
steps:
84104
- uses: actions/checkout@v4
105+
106+
- name: Install Linux deps
107+
if: matrix.os == 'ubuntu-22.04'
108+
run: |
109+
sudo apt-get update
110+
sudo apt-get install -y build-essential pkg-config libglib2.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev
111+
echo "=== Verifying glib-2.0 installation ==="
112+
dpkg -l | grep libglib2.0-dev || echo "libglib2.0-dev not installed"
113+
find /usr -name 'glib-2.0.pc' 2>/dev/null || echo "glib-2.0.pc not found"
114+
pkg-config --modversion glib-2.0 || echo "pkg-config cannot find glib-2.0"
115+
pkg-config --exists 'glib-2.0 >= 2.70' && echo "glib-2.0 >= 2.70 found" || (echo "ERROR: glib-2.0 >= 2.70 not found"; exit 1)
116+
echo "PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config)" >> $GITHUB_ENV
117+
85118
- uses: dtolnay/rust-toolchain@stable
86119
with:
87120
targets: ${{ matrix.target }}
121+
88122
- uses: Swatinem/rust-cache@v2
89123
with:
90124
key: ${{ matrix.target }}
91125

92-
# Linux dependencies for Tauri
93-
- name: Install Linux deps
94-
if: matrix.os == 'ubuntu-latest'
95-
run: |
96-
sudo apt-get update
97-
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev
98-
99126
# Install cargo-nextest
100127
- name: Install nextest
101128
uses: taiki-e/install-action@nextest
@@ -121,7 +148,7 @@ jobs:
121148
fail-fast: false
122149
matrix:
123150
include:
124-
- os: ubuntu-latest
151+
- os: ubuntu-22.04
125152
target: x86_64-unknown-linux-gnu
126153
- os: windows-latest
127154
target: x86_64-pc-windows-msvc
@@ -131,27 +158,40 @@ jobs:
131158
runs-on: ${{ matrix.os }}
132159
steps:
133160
- uses: actions/checkout@v4
161+
162+
- name: Install Linux deps
163+
if: matrix.os == 'ubuntu-22.04'
164+
run: |
165+
sudo apt-get update
166+
sudo apt-get install -y build-essential pkg-config libglib2.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev
167+
echo "=== Verifying glib-2.0 installation ==="
168+
dpkg -l | grep libglib2.0-dev || echo "libglib2.0-dev not installed"
169+
find /usr -name 'glib-2.0.pc' 2>/dev/null || echo "glib-2.0.pc not found"
170+
pkg-config --modversion glib-2.0 || echo "pkg-config cannot find glib-2.0"
171+
pkg-config --exists 'glib-2.0 >= 2.70' && echo "glib-2.0 >= 2.70 found" || (echo "ERROR: glib-2.0 >= 2.70 not found"; exit 1)
172+
echo "PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config)" >> $GITHUB_ENV
173+
134174
- uses: dtolnay/rust-toolchain@stable
135175
with:
136176
targets: ${{ matrix.target }}
177+
env:
178+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
179+
137180
- uses: Swatinem/rust-cache@v2
138181
with:
139182
key: ${{ matrix.target }}-build
183+
env:
184+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
140185
- uses: pnpm/action-setup@v4
141186
- uses: actions/setup-node@v4
142187
with:
143188
node-version: 20
144189
cache: 'pnpm'
145190

146-
- name: Install Linux deps
147-
if: matrix.os == 'ubuntu-latest'
148-
run: |
149-
sudo apt-get update
150-
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev
151-
152191
- run: pnpm install --frozen-lockfile
153192
- run: pnpm build
154193
env:
194+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
155195
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
156196

157197
# ─────────────────────────────────────────────────────────────
@@ -161,7 +201,7 @@ jobs:
161201
e2e-web:
162202
needs: [ts-check]
163203
if: "!contains(github.event.head_commit.message, '[skip e2e]')"
164-
runs-on: ubuntu-latest
204+
runs-on: ubuntu-22.04
165205
steps:
166206
- uses: actions/checkout@v4
167207
- uses: pnpm/action-setup@v4
@@ -208,28 +248,41 @@ jobs:
208248
fail-fast: false
209249
matrix:
210250
include:
211-
- os: ubuntu-latest
251+
- os: ubuntu-22.04
212252
- os: windows-latest
213253
# macOS NOT supported - no WKWebView driver
214254

215255
runs-on: ${{ matrix.os }}
216256
steps:
217257
- uses: actions/checkout@v4
258+
259+
- name: Install Linux deps
260+
if: matrix.os == 'ubuntu-22.04'
261+
run: |
262+
sudo apt-get update
263+
sudo apt-get install -y build-essential pkg-config libglib2.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev webkit2gtk-driver xvfb
264+
echo "=== Verifying glib-2.0 installation ==="
265+
dpkg -l | grep libglib2.0-dev || echo "libglib2.0-dev not installed"
266+
find /usr -name 'glib-2.0.pc' 2>/dev/null || echo "glib-2.0.pc not found"
267+
pkg-config --modversion glib-2.0 || echo "pkg-config cannot find glib-2.0"
268+
pkg-config --exists 'glib-2.0 >= 2.70' && echo "glib-2.0 >= 2.70 found" || (echo "ERROR: glib-2.0 >= 2.70 not found"; exit 1)
269+
echo "PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config)" >> $GITHUB_ENV
270+
218271
- uses: dtolnay/rust-toolchain@stable
219-
- uses: Swatinem/rust-cache@v2
220-
with:
221-
key: ${{ matrix.os }}-e2e
272+
env:
273+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
274+
222275
- uses: pnpm/action-setup@v4
223276
- uses: actions/setup-node@v4
224277
with:
225278
node-version: 20
226279
cache: 'pnpm'
227280

228-
- name: Install Linux deps
229-
if: matrix.os == 'ubuntu-latest'
230-
run: |
231-
sudo apt-get update
232-
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev webkit2gtk-driver xvfb
281+
- uses: Swatinem/rust-cache@v2
282+
with:
283+
key: ${{ matrix.os }}-e2e
284+
env:
285+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
233286

234287
# Cache tauri-driver binary
235288
- name: Cache tauri-driver
@@ -242,16 +295,19 @@ jobs:
242295
- name: Install tauri-driver
243296
if: steps.tauri-driver-cache.outputs.cache-hit != 'true'
244297
run: cargo install tauri-driver --locked
298+
env:
299+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
245300

246301
- run: pnpm install --frozen-lockfile
247302

248303
- name: Build app
249304
run: pnpm build
250305
env:
306+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
251307
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
252308

253309
- name: Run Tauri E2E tests (Linux)
254-
if: matrix.os == 'ubuntu-latest'
310+
if: matrix.os == 'ubuntu-22.04'
255311
run: xvfb-run --auto-servernum pnpm test:e2e
256312

257313
- name: Run Tauri E2E tests (Windows)

.github/workflows/e2e-tauri-comment.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
issue_comment:
88
types: [created]
99

10+
env:
11+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
12+
1013
jobs:
1114
e2e-tauri:
1215
# Only run when comment on a PR contains /e2e-tauri
@@ -17,7 +20,7 @@ jobs:
1720
fail-fast: false
1821
matrix:
1922
include:
20-
- os: ubuntu-latest
23+
- os: ubuntu-22.04
2124
- os: windows-latest
2225

2326
runs-on: ${{ matrix.os }}
@@ -43,23 +46,34 @@ jobs:
4346
with:
4447
ref: ${{ steps.pr.outputs.sha }}
4548

49+
- name: Install Linux deps
50+
if: matrix.os == 'ubuntu-22.04'
51+
run: |
52+
sudo apt-get update
53+
sudo apt-get install -y build-essential pkg-config libglib2.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev webkit2gtk-driver xvfb
54+
echo "=== Verifying glib-2.0 installation ==="
55+
dpkg -l | grep libglib2.0-dev || echo "libglib2.0-dev not installed"
56+
find /usr -name 'glib-2.0.pc' 2>/dev/null || echo "glib-2.0.pc not found"
57+
pkg-config --modversion glib-2.0 || echo "pkg-config cannot find glib-2.0"
58+
pkg-config --exists 'glib-2.0 >= 2.70' && echo "glib-2.0 >= 2.70 found" || (echo "ERROR: glib-2.0 >= 2.70 not found"; exit 1)
59+
echo "PKG_CONFIG_PATH=$(pkg-config --variable pc_path pkg-config)" >> $GITHUB_ENV
60+
4661
- uses: dtolnay/rust-toolchain@stable
62+
env:
63+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
64+
4765
- uses: Swatinem/rust-cache@v2
4866
with:
4967
key: ${{ matrix.os }}-e2e-comment
68+
env:
69+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
5070

5171
- uses: pnpm/action-setup@v4
5272
- uses: actions/setup-node@v4
5373
with:
5474
node-version: 20
5575
cache: 'pnpm'
5676

57-
- name: Install Linux deps
58-
if: matrix.os == 'ubuntu-latest'
59-
run: |
60-
sudo apt-get update
61-
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libsecret-1-dev webkit2gtk-driver xvfb
62-
6377
- name: Cache tauri-driver
6478
uses: actions/cache@v4
6579
id: tauri-driver-cache
@@ -70,16 +84,19 @@ jobs:
7084
- name: Install tauri-driver
7185
if: steps.tauri-driver-cache.outputs.cache-hit != 'true'
7286
run: cargo install tauri-driver --locked
87+
env:
88+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
7389

7490
- run: pnpm install --frozen-lockfile
7591

7692
- name: Build app
7793
run: pnpm build
7894
env:
95+
PKG_CONFIG_PATH: /usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
7996
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
8097

8198
- name: Run Tauri E2E tests (Linux)
82-
if: matrix.os == 'ubuntu-latest'
99+
if: matrix.os == 'ubuntu-22.04'
83100
run: xvfb-run --auto-servernum pnpm test:e2e
84101

85102
- name: Run Tauri E2E tests (Windows)

apps/desktop/src-tauri/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ fn main() {
1212
}
1313
}
1414
}
15-
15+
1616
// Tell Cargo to re-run this script if tauri.conf.json changes
1717
println!("cargo:rerun-if-changed=tauri.conf.json");
18-
18+
1919
tauri_build::build()
2020
}

apps/desktop/src-tauri/src/commands/client.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use tauri::State;
1010
use tokio::sync::RwLock;
1111
use uuid::Uuid;
1212

13-
use crate::state::AppState;
1413
use crate::commands::gateway::GatewayAppState;
14+
use crate::state::AppState;
1515

1616
/// Response for client listing
1717
#[derive(Debug, Serialize)]
@@ -28,7 +28,9 @@ pub struct ClientResponse {
2828
impl From<Client> for ClientResponse {
2929
fn from(c: Client) -> Self {
3030
let (mode, locked_id) = match &c.connection_mode {
31-
ConnectionMode::Locked { space_id } => ("locked".to_string(), Some(space_id.to_string())),
31+
ConnectionMode::Locked { space_id } => {
32+
("locked".to_string(), Some(space_id.to_string()))
33+
}
3234
ConnectionMode::FollowActive => ("follow_active".to_string(), None),
3335
ConnectionMode::AskOnChange { .. } => ("ask_on_change".to_string(), None),
3436
};

0 commit comments

Comments
 (0)