Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
rust: [stable]
extraFeatures: [vsock]
include:
- rust: stable
os: windows-latest
extraFeatures: ""
- rust: 1.74.0
os: ubuntu-latest
extraFeatures: vsock
# Try to build on the latest nightly. This job is allowed to fail, but
# it's useful to help catch bugs in upcoming Rust versions.
- rust: nightly
os: ubuntu-latest
extraFeatures: vsock
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -95,14 +101,8 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Run cargo test (API)
run: cargo test -p console-api

- name: Run cargo test (subscriber)
run: cargo test -p console-subscriber

- name: Run cargo test (console)
run: cargo test -p tokio-console --locked
- name: Run cargo test
run: cargo test --workspace --locked --features "transport,grpc-web,${{ matrix.extraFeatures }}"

lints:
name: Lints
Expand All @@ -122,7 +122,7 @@ jobs:
run: cargo fmt --all -- --check

- name: Run cargo clippy
run: cargo clippy --workspace --all-targets --no-deps -- -D warnings
run: cargo clippy --workspace --all-features --all-targets --no-deps -- -D warnings

docs:
name: Docs
Expand Down
6 changes: 2 additions & 4 deletions console-subscriber/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ keywords = [
default = ["env-filter"]
parking_lot = ["dep:parking_lot", "tracing-subscriber/parking_lot"]
env-filter = ["tracing-subscriber/env-filter"]
grpc-web = ["dep:tonic-web"]
grpc-web = []
vsock = ["dep:tokio-vsock"]

[dependencies]
Expand All @@ -54,9 +54,6 @@ serde = { version = "1.0.145", features = ["derive"] }
serde_json = "1"
crossbeam-channel = "0.5"

# Only for the web feature:
tonic-web = { version = "0.13", optional = true }

# Only for the vsock feature:
tokio-vsock = { version = "0.7.1", optional = true, features = ["tonic013"]}

Expand All @@ -66,6 +63,7 @@ tower = { version = "0.4.12", default-features = false, features = ["util"] }
futures = "0.3"
http = "1.1"
tower-http = { version = "0.5", features = ["cors"] }
tonic-web = "0.13"

[lints.rust.unexpected_cfgs]
level = "warn"
Expand Down
2 changes: 1 addition & 1 deletion console-subscriber/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl Builder {
/// ```
/// # use console_subscriber::Builder;
/// # #[cfg(feature = "vsock")]
/// let builder = Builder::default().server_addr((tokio_vsock::VMADDR_CID_ANY, 6669));
/// let builder = Builder::default().server_addr(tokio_vsock::VsockAddr::new(tokio_vsock::VMADDR_CID_ANY, 6669));
/// ```
///
/// [environment variable]: `Builder::with_default_env`
Expand Down
14 changes: 1 addition & 13 deletions console-subscriber/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,16 +974,6 @@ impl Server {
///
/// # Examples
///
/// To serve the instrument server with gRPC-Web support with the default
/// settings:
///
/// ```rust
/// # async fn docs() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
/// # let (_, server) = console_subscriber::ConsoleLayer::new();
/// server.serve_with_grpc_web(tonic::transport::Server::default()).await
/// # }
/// ```
///
/// To serve the instrument server with gRPC-Web support and a custom CORS configuration, use the
/// following code:
///
Expand Down Expand Up @@ -1076,9 +1066,7 @@ impl Server {
instrument_server,
aggregator,
} = self.into_parts();
let router = builder
.accept_http1(true)
.add_service(tonic_web::enable(instrument_server));
let router = builder.accept_http1(true).add_service(instrument_server);
let aggregate = spawn_named(aggregator.run(), "console::aggregate");
let res = match addr {
ServerAddr::Tcp(addr) => {
Expand Down
3 changes: 1 addition & 2 deletions console-subscriber/tests/support/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,7 @@ async fn console_client(client_stream: DuplexStream, mut test_state: TestState)
// We need to return a Result from this async block, which is
// why we don't unwrap the `client` here.
client.map(TokioIo::new).ok_or_else(|| {
std::io::Error::new(
std::io::ErrorKind::Other,
std::io::Error::other(
"console-test error: client already taken. This shouldn't happen.",
)
})
Expand Down
2 changes: 1 addition & 1 deletion tokio-console/src/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl Connection {
}
}

pub fn render(&self, styles: &crate::view::Styles) -> ratatui::text::Line {
pub fn render(&self, styles: &crate::view::Styles) -> ratatui::text::Line<'_> {
use ratatui::{
style::{Color, Modifier},
text::{Line, Span},
Expand Down
Loading