Skip to content

Commit cdbc82d

Browse files
committed
chore: exclude test-only code from coverage analysis
re-run checks
1 parent 6cb0c1b commit cdbc82d

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ url = { version = "2.4", features = ["serde"] }
5454
[workspace.metadata]
5555
crane.name = "apollo-mcp"
5656

57+
[workspace.lints.rust]
58+
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(coverage_nightly)'] }
59+
5760
[workspace.lints.clippy]
5861
exit = "deny"
5962
expect_used = "deny"

crates/apollo-mcp-server/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg_attr(coverage_nightly, feature(coverage_attribute))]
2+
13
pub mod auth;
24
pub mod cors;
35
pub mod custom_scalar_map;

crates/apollo-mcp-server/src/runtime/filtering_exporter.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ mod tests {
6767
use std::future::ready;
6868
use std::time::SystemTime;
6969

70+
#[cfg_attr(coverage_nightly, coverage(off))]
7071
fn create_mock_span_data() -> SpanData {
7172
let span_context: SpanContext = SpanContext::new(
7273
TraceId::from_u128(1),
@@ -102,6 +103,7 @@ mod tests {
102103
#[derive(Debug)]
103104
struct TestExporter {}
104105

106+
#[cfg_attr(coverage_nightly, coverage(off))]
105107
impl SpanExporter for TestExporter {
106108
fn export(&self, batch: Vec<SpanData>) -> impl Future<Output = OTelSdkResult> + Send {
107109
batch.into_iter().for_each(|span| {
@@ -145,6 +147,7 @@ mod tests {
145147
#[derive(Debug)]
146148
struct TestExporter {}
147149

150+
#[cfg_attr(coverage_nightly, coverage(off))]
148151
impl SpanExporter for TestExporter {
149152
fn export(&self, _batch: Vec<SpanData>) -> impl Future<Output = OTelSdkResult> + Send {
150153
ready(Err(OTelSdkError::InternalFailure(
@@ -176,6 +179,7 @@ mod tests {
176179
#[derive(Debug)]
177180
struct TestExporter {}
178181

182+
#[cfg_attr(coverage_nightly, coverage(off))]
179183
impl SpanExporter for TestExporter {
180184
fn export(&self, _batch: Vec<SpanData>) -> impl Future<Output = OTelSdkResult> + Send {
181185
ready(Err(OTelSdkError::InternalFailure(
@@ -207,6 +211,7 @@ mod tests {
207211
#[derive(Debug)]
208212
struct TestExporter {}
209213

214+
#[cfg_attr(coverage_nightly, coverage(off))]
210215
impl SpanExporter for TestExporter {
211216
fn export(&self, _batch: Vec<SpanData>) -> impl Future<Output = OTelSdkResult> + Send {
212217
ready(Err(OTelSdkError::InternalFailure(

0 commit comments

Comments
 (0)