Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update integration tests, fix some networking bugs #19

Merged
merged 9 commits into from
Jan 29, 2025

Conversation

Ash-L2L
Copy link
Collaborator

@Ash-L2L Ash-L2L commented Jan 28, 2025

No description provided.

@Ash-L2L Ash-L2L force-pushed the 2025-01-24-integration-tests branch 2 times, most recently from b992ced to bcada81 Compare January 28, 2025 18:15
@Ash-L2L Ash-L2L force-pushed the 2025-01-24-integration-tests branch from 4a343cb to 774a171 Compare January 29, 2025 15:24
@Ash-L2L Ash-L2L marked this pull request as ready for review January 29, 2025 15:44
@Ash-L2L Ash-L2L merged commit 1fd5f5f into master Jan 29, 2025
13 checks passed
Copy link
Contributor

@torkelrogstad torkelrogstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see now that I forgot to submit my review earlier 😅

///
/// - a stream of incoming QUIC connections
/// - server certificate serialized into DER format
#[allow(unused)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allow attribute can be deleted?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, should be fixed in a follow-up commit

lib/net/mod.rs Show resolved Hide resolved
#[allow(unused)]
pub fn make_server_endpoint(
bind_addr: SocketAddr,
) -> Result<(Endpoint, Vec<u8>), Error> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should drop the Vec<u8> parameter here imo, as it's just swallowed in Net::new

Comment on lines -156 to +254
let connecting = self.client.connect(addr, "localhost")?;
let connecting = self.server.connect(addr, "localhost")?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is the actual "meat" of the commit? For next time it'd be grand to have those things in separate commits

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spent some time poking around here before I actually understood what's new, and what's just refactors

Comment on lines +15 to +46
/// Saturating predecessor of a log level
fn saturating_pred_level(log_level: tracing::Level) -> tracing::Level {
match log_level {
tracing::Level::TRACE => tracing::Level::DEBUG,
tracing::Level::DEBUG => tracing::Level::INFO,
tracing::Level::INFO => tracing::Level::WARN,
tracing::Level::WARN => tracing::Level::ERROR,
tracing::Level::ERROR => tracing::Level::ERROR,
}
}

/// The empty string target `""` can be used to set a default level.
fn targets_directive_str<'a, Targets>(targets: Targets) -> String
where
Targets: IntoIterator<Item = (&'a str, tracing::Level)>,
{
targets
.into_iter()
.map(|(target, level)| {
let level = level.as_str().to_ascii_lowercase();
if target.is_empty() {
level
} else {
format!("{target}={level}")
}
})
.collect::<Vec<_>>()
.join(",")
}

// Configure logger.
fn set_tracing_subscriber(log_level: tracing::Level) -> anyhow::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of this log configuration logic feels like it should be possible to deduplicate. Aren't we doing more or less the exact same thing multiple places now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants