Skip to content

Commit 9d848b5

Browse files
Merge pull request #13 from utkarsh232005/main
test: synchronize dashboard tests with a mutex and update GitHub work…
2 parents 8e6c703 + aee7cb6 commit 9d848b5

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ jobs:
5656
persist-credentials: false
5757

5858
- name: Install Rust toolchain
59-
uses: dtolnay/rust-toolchain@a54c08fd6ec450103756d6dc20d2d48332156d7f # master
59+
uses: dtolnay/rust-toolchain@efa25f7f19611383d5b0ccf2d1c8914531636bf9 # master
6060
with:
6161
targets: ${{ matrix.target }}
6262

6363
- name: Cache Cargo registry and target
64-
uses: Swatinem/rust-cache@23bde28c093e9ae8b3b402174d994c9d924d0eb8 # v2.7.5
64+
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
6565
with:
6666
key: ${{ matrix.target }}
6767

6868
- name: Install cross
6969
if: matrix.use_cross
70-
uses: taiki-e/install-action@93a027fc80e60808cf702e5e4fa0eb13e01fccf2 # v2.1.20
70+
uses: taiki-e/install-action@d12e869b89167df346dd0ff65da342d1fb1202fb # v2.53.2
7171
with:
7272
tool: cross
7373

@@ -81,7 +81,7 @@ jobs:
8181
shell: bash
8282

8383
- name: Upload Binary Artifact
84-
uses: actions/upload-artifact@60119845307540294e774020a87424eeac47d7e6 # v4.4.1
84+
uses: actions/upload-artifact@0b2256b8c012f0878cc391196ead6427b322a30d # v4.3.3
8585
with:
8686
name: kdc-${{ matrix.target }}
8787
path: target/${{ matrix.target }}/release/${{ matrix.bin_name }}
@@ -119,7 +119,7 @@ jobs:
119119
shell: bash
120120

121121
- name: Download all artifacts
122-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372ec806f1c # v4.1.7
122+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
123123
with:
124124
path: bin-artifacts
125125

@@ -159,7 +159,7 @@ jobs:
159159
generate_release_notes: true
160160

161161
- name: Upload packaging artifacts
162-
uses: actions/upload-artifact@60119845307540294e774020a87424eeac47d7e6 # v4.4.1
162+
uses: actions/upload-artifact@0b2256b8c012f0878cc391196ead6427b322a30d # v4.3.3
163163
with:
164164
name: release-dist
165165
path: dist/
@@ -178,13 +178,13 @@ jobs:
178178
persist-credentials: false
179179

180180
- name: Download release-dist artifact
181-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372ec806f1c # v4.1.7
181+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
182182
with:
183183
name: release-dist
184184
path: dist
185185

186186
- name: Download compiled binaries
187-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372ec806f1c # v4.1.7
187+
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
188188
with:
189189
path: bin-artifacts
190190

src/ui/dashboard.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,9 +975,13 @@ mod tests {
975975
use super::*;
976976
use ratatui::crossterm::event::KeyCode;
977977
use ratatui::{backend::TestBackend, Terminal};
978+
use std::sync::Mutex;
979+
980+
static TEST_MUTEX: Mutex<()> = Mutex::new(());
978981

979982
#[test]
980983
fn test_render_all_phases() {
984+
let _guard = TEST_MUTEX.lock().unwrap();
981985
crate::utils::test_support::set_mock_path();
982986
let backend = TestBackend::new(120, 40);
983987
let mut terminal = Terminal::new(backend).unwrap();
@@ -1007,6 +1011,7 @@ mod tests {
10071011

10081012
#[test]
10091013
fn test_handle_first_launch_key() {
1014+
let _guard = TEST_MUTEX.lock().unwrap();
10101015
crate::utils::test_support::set_mock_path();
10111016
let mut state = crate::app::startup::initialize(std::path::PathBuf::from(".")).unwrap();
10121017
state.ui.first_launch_choice = 0;
@@ -1024,6 +1029,7 @@ mod tests {
10241029

10251030
#[test]
10261031
fn test_cycle_theme() {
1032+
let _guard = TEST_MUTEX.lock().unwrap();
10271033
crate::utils::test_support::set_mock_path();
10281034
let mut state = crate::app::startup::initialize(std::path::PathBuf::from(".")).unwrap();
10291035
let initial_theme = state.ui.active_theme;

0 commit comments

Comments
 (0)