Skip to content

Commit d803f10

Browse files
committed
chore: M5 CI/Workflow Sweep - final synchronisation
1 parent 6052506 commit d803f10

9 files changed

Lines changed: 33 additions & 33 deletions

File tree

crates/rpa-config/src/loader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,12 @@ mod tests {
106106

107107
#[test]
108108
fn test_load_json() {
109-
let mut tmp = NamedTempFile::with_suffix(".json").unwrap();
110-
writeln!(tmp, r#"{{"name": "test", "version": 1}}"#).unwrap();
111-
tmp.flush().unwrap();
109+
let mut tmp = NamedTempFile::with_suffix(".json").expect("TODO: handle error");
110+
writeln!(tmp, r#"{{"name": "test", "version": 1}}"#).expect("TODO: handle error");
111+
tmp.flush().expect("TODO: handle error");
112112

113113
let loader = ConfigLoader::new();
114-
let value = loader.load_json(tmp.path()).unwrap();
114+
let value = loader.load_json(tmp.path()).expect("TODO: handle error");
115115
assert_eq!(value["name"], "test");
116116
assert_eq!(value["version"], 1);
117117
}

crates/rpa-events/src/groove.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl GrooveNotifyHook {
7676

7777
let addr = format!("127.0.0.1:{}", BURBLE_PORT);
7878
let stream = match TcpStream::connect_timeout(
79-
&addr.parse().unwrap(),
79+
&addr.parse().expect("TODO: handle error"),
8080
CONNECT_TIMEOUT,
8181
) {
8282
Ok(s) => s,
@@ -97,7 +97,7 @@ impl GrooveNotifyHook {
9797
fn send_alert(&self, json: &str) {
9898
let addr = format!("127.0.0.1:{}", BURBLE_PORT);
9999
let mut stream = match TcpStream::connect_timeout(
100-
&addr.parse().unwrap(),
100+
&addr.parse().expect("TODO: handle error"),
101101
CONNECT_TIMEOUT,
102102
) {
103103
Ok(s) => s,

crates/rpa-events/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ mod tests {
269269
count: count.clone(),
270270
}));
271271

272-
let result = bus.publish(test_event()).await.unwrap();
272+
let result = bus.publish(test_event()).await.expect("TODO: handle error");
273273
assert_eq!(result.handlers_invoked, 1);
274274
assert_eq!(result.handlers_succeeded, 1);
275275
assert_eq!(count.load(Ordering::SeqCst), 1);
@@ -290,7 +290,7 @@ mod tests {
290290
count: count2.clone(),
291291
}));
292292

293-
bus.publish(test_event()).await.unwrap();
293+
bus.publish(test_event()).await.expect("TODO: handle error");
294294
assert_eq!(count1.load(Ordering::SeqCst), 1);
295295
assert_eq!(count2.load(Ordering::SeqCst), 1);
296296
}
@@ -308,12 +308,12 @@ mod tests {
308308

309309
// Manual event should be filtered
310310
let manual_event = Event::new(EventKind::Manual, "manual");
311-
let result = bus.publish(manual_event).await.unwrap();
311+
let result = bus.publish(manual_event).await.expect("TODO: handle error");
312312
assert!(result.filtered);
313313
assert_eq!(count.load(Ordering::SeqCst), 0);
314314

315315
// File event should pass through
316-
let result = bus.publish(test_event()).await.unwrap();
316+
let result = bus.publish(test_event()).await.expect("TODO: handle error");
317317
assert!(!result.filtered);
318318
assert_eq!(count.load(Ordering::SeqCst), 1);
319319
}
@@ -323,8 +323,8 @@ mod tests {
323323
let bus = EventBus::new();
324324
let mut rx = bus.receiver();
325325

326-
bus.publish(test_event()).await.unwrap();
327-
let received = rx.recv().await.unwrap();
326+
bus.publish(test_event()).await.expect("TODO: handle error");
327+
let received = rx.recv().await.expect("TODO: handle error");
328328
assert!(received.id.starts_with("evt_"));
329329
}
330330

crates/rpa-fs-workflow/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ mod tests {
231231
#[test]
232232
fn test_json_roundtrip() {
233233
let config = WorkflowConfig::example();
234-
let json = serde_json::to_string_pretty(&config).unwrap();
235-
let parsed: WorkflowConfig = serde_json::from_str(&json).unwrap();
234+
let json = serde_json::to_string_pretty(&config).expect("TODO: handle error");
235+
let parsed: WorkflowConfig = serde_json::from_str(&json).expect("TODO: handle error");
236236
assert_eq!(parsed.workflow.name, config.workflow.name);
237237
}
238238
}

crates/rpa-fs-workflow/src/watcher.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ mod tests {
166166

167167
#[test]
168168
fn test_watch_directory() {
169-
let dir = tempdir().unwrap();
170-
let mut watcher = FsWatcher::new(false).unwrap();
169+
let dir = tempdir().expect("TODO: handle error");
170+
let mut watcher = FsWatcher::new(false).expect("TODO: handle error");
171171

172172
let result = watcher.watch(dir.path());
173173
assert!(result.is_ok());

crates/rpa-plugin/src/sandbox.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ impl Sandbox {
367367

368368
match func.call(&mut store, &[], &mut results) {
369369
Ok(_) => {
370-
let state = state.lock().unwrap();
370+
let state = state.lock().expect("TODO: handle error");
371371
let elapsed = start.elapsed();
372372

373373
debug!("Plugin action '{}' completed in {:?}", action, elapsed);

crates/rpa-resources/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ mod tests {
205205
let pool = ResourcePool::new("test", 2);
206206
assert_eq!(pool.available_permits(), 2);
207207

208-
let lease1 = pool.acquire().await.unwrap();
208+
let lease1 = pool.acquire().await.expect("TODO: handle error");
209209
assert_eq!(pool.available_permits(), 1);
210210

211-
let lease2 = pool.acquire().await.unwrap();
211+
let lease2 = pool.acquire().await.expect("TODO: handle error");
212212
assert_eq!(pool.available_permits(), 0);
213213

214214
drop(lease1);
@@ -243,8 +243,8 @@ mod tests {
243243
assert!(manager.pool("connections").is_some());
244244
assert!(manager.pool("nonexistent").is_none());
245245

246-
let lease = manager.acquire("connections").await.unwrap();
247-
assert_eq!(manager.pool("connections").unwrap().available_permits(), 4);
246+
let lease = manager.acquire("connections").await.expect("TODO: handle error");
247+
assert_eq!(manager.pool("connections").expect("TODO: handle error").available_permits(), 4);
248248
drop(lease);
249249
}
250250

crates/rpa-scheduler/src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,25 +245,25 @@ mod tests {
245245

246246
#[test]
247247
fn test_cron_every_minute() {
248-
let expr = CronExpr::parse("* * * * *").unwrap();
249-
let dt = Utc.with_ymd_and_hms(2026, 3, 17, 10, 30, 0).unwrap();
248+
let expr = CronExpr::parse("* * * * *").expect("TODO: handle error");
249+
let dt = Utc.with_ymd_and_hms(2026, 3, 17, 10, 30, 0).expect("TODO: handle error");
250250
assert!(expr.matches(&dt));
251251
}
252252

253253
#[test]
254254
fn test_cron_weekday_morning() {
255-
let expr = CronExpr::parse("0 9 * * 1-5").unwrap();
256-
let monday = Utc.with_ymd_and_hms(2026, 3, 16, 9, 0, 0).unwrap();
255+
let expr = CronExpr::parse("0 9 * * 1-5").expect("TODO: handle error");
256+
let monday = Utc.with_ymd_and_hms(2026, 3, 16, 9, 0, 0).expect("TODO: handle error");
257257
assert!(expr.matches(&monday));
258-
let sunday = Utc.with_ymd_and_hms(2026, 3, 15, 9, 0, 0).unwrap();
258+
let sunday = Utc.with_ymd_and_hms(2026, 3, 15, 9, 0, 0).expect("TODO: handle error");
259259
assert!(!expr.matches(&sunday));
260260
}
261261

262262
#[test]
263263
fn test_cron_list() {
264-
let expr = CronExpr::parse("0,30 * * * *").unwrap();
265-
let at_0 = Utc.with_ymd_and_hms(2026, 3, 17, 10, 0, 0).unwrap();
266-
let at_15 = Utc.with_ymd_and_hms(2026, 3, 17, 10, 15, 0).unwrap();
264+
let expr = CronExpr::parse("0,30 * * * *").expect("TODO: handle error");
265+
let at_0 = Utc.with_ymd_and_hms(2026, 3, 17, 10, 0, 0).expect("TODO: handle error");
266+
let at_15 = Utc.with_ymd_and_hms(2026, 3, 17, 10, 15, 0).expect("TODO: handle error");
267267
assert!(expr.matches(&at_0));
268268
assert!(!expr.matches(&at_15));
269269
}
@@ -276,14 +276,14 @@ mod tests {
276276

277277
#[test]
278278
fn test_schedule_entry() {
279-
let entry = ScheduleEntry::new("test", "* * * * *").unwrap();
279+
let entry = ScheduleEntry::new("test", "* * * * *").expect("TODO: handle error");
280280
let now = Utc::now();
281281
assert!(entry.should_fire(&now));
282282
}
283283

284284
#[test]
285285
fn test_no_double_fire() {
286-
let mut entry = ScheduleEntry::new("test", "* * * * *").unwrap();
286+
let mut entry = ScheduleEntry::new("test", "* * * * *").expect("TODO: handle error");
287287
let now = Utc::now();
288288
assert!(entry.should_fire(&now));
289289
entry.last_run = Some(now);

crates/rpa-state/src/backend.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ mod tests {
185185
let backend = JsonFileBackend::new(tmp.path().to_path_buf());
186186

187187
backend.put("deleteme", b"data").await.expect("put failed");
188-
assert!(backend.get("deleteme").await.unwrap().is_some());
188+
assert!(backend.get("deleteme").await.expect("TODO: handle error").is_some());
189189

190190
backend.delete("deleteme").await.expect("delete failed");
191-
assert_eq!(backend.get("deleteme").await.unwrap(), None);
191+
assert_eq!(backend.get("deleteme").await.expect("TODO: handle error"), None);
192192
}
193193

194194
#[tokio::test]

0 commit comments

Comments
 (0)