ci: run more Rust tests on all platforms (#10927)

Running only the unit-tests of select crates on some platforms is
problematic. We are unlikely to update this list of crates as we
introduce new ones. It is a better default to run the tests of all
crates on all platforms and selectively exclude the ones that can't run
because they are unsupported.
This commit is contained in:
Thomas Eizinger
2025-11-25 03:06:30 +11:00
committed by GitHub
parent d70d6168e2
commit 6d01fa6c70
6 changed files with 11 additions and 8 deletions

View File

@@ -26,8 +26,8 @@ outputs:
description: Testable packages for the current OS
value: ${{
(runner.os == 'Linux' && '--workspace') ||
(runner.os == 'macOS' && '-p client-ffi -p client-shared -p firezone-tunnel -p snownet') ||
(runner.os == 'Windows' && '-p client-shared -p connlib-model -p firezone-bin-shared -p firezone-gui-client -p firezone-headless-client -p firezone-logging -p firezone-telemetry -p firezone-tunnel -p gui-smoke-test -p http-test-server -p ip-packet -p phoenix-channel -p snownet -p socket-factory -p tun') }}
(runner.os == 'macOS' && '--workspace --exclude firezone-bin-shared --exclude firezone-gui-client') ||
(runner.os == 'Windows' && '--workspace --exclude client-ffi') }}
nightly_version:
description: The nightly version of Rust
value: ${{ steps.nightly.outputs.nightly }}

View File

@@ -350,7 +350,7 @@ mod tests {
let buffer2 = pool.pull_initialised(b"hello world");
let buffer3 = pool.pull_initialised(b"hello world");
tokio::time::sleep(Duration::from_millis(10)).await; // Wait for metrics to be exported.
tokio::time::sleep(Duration::from_millis(100)).await; // Wait for metrics to be exported.
assert_eq!(get_num_buffers(&exporter), 3);
@@ -359,7 +359,7 @@ mod tests {
drop(buffer2);
drop(buffer3);
tokio::time::sleep(Duration::from_millis(10)).await; // Wait for metrics to be exported.
tokio::time::sleep(Duration::from_millis(100)).await; // Wait for metrics to be exported.
assert_eq!(get_num_buffers(&exporter), 0);
}

View File

@@ -15,10 +15,12 @@ rand = { workspace = true }
tracing = { workspace = true }
[dev-dependencies]
firezone-bin-shared = { workspace = true }
futures = { workspace = true }
ip_network = { workspace = true }
tokio = { workspace = true, features = ["process", "rt", "macros"] }
[target.'cfg(target_os = "linux")'.dev-dependencies]
firezone-bin-shared = { workspace = true }
ip_network = { workspace = true }
tun = { workspace = true }
[lints]

View File

@@ -1,4 +1,5 @@
#![allow(clippy::unwrap_used)]
#![cfg(not(any(target_os = "macos", target_os = "windows")))] // The DNS-over-TCP server is sans-IO so it doesn't matter where the IP packets come from. Testing it only on Linux is therefore fine.
use std::{
collections::BTreeSet,

View File

@@ -196,7 +196,7 @@ mod tests {
async fn smoke_ipv4() {
let mut server = Server::default();
let socket = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 127), 8080));
let socket = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080));
let server_task = tokio::spawn(async move {
server.rebind(socket).unwrap();

View File

@@ -183,7 +183,7 @@ mod tests {
async fn smoke_ipv4() {
let mut server = Server::default();
let socket = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 127), 8080));
let socket = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(127, 0, 0, 1), 8080));
let server_task = tokio::spawn(async move {
server.rebind(socket).unwrap();