mirror of
https://github.com/tokio-rs/tracing.git
synced 2025-10-01 15:00:33 +00:00
ci: add tracing_unstable
to CI (#1894)
* ci: add `tracing_unstable` to CI Currently, the `valuable` support requires the `tracing_unstable` cfg to be set. Because none of our current CI jobs set this, we aren't currently testing that code, and have no way of even ensuring that it compiles. This is Bad. This PR adds a CI job to run tests with the unstable cfg enabled. * core: fix wrong `self` types with `valuable` This should fix the build. Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
parent
08dc62cd5e
commit
1a9ee003ce
20
.github/workflows/CI.yml
vendored
20
.github/workflows/CI.yml
vendored
@ -270,6 +270,26 @@ jobs:
|
||||
command: test
|
||||
args: --all
|
||||
|
||||
test-unstable:
|
||||
# Test the `tracing-unstable` cfg flags
|
||||
env:
|
||||
RUSTFLAGS: "--cfg tracing_unstable"
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@main
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: stable
|
||||
profile: minimal
|
||||
override: true
|
||||
- name: Run tests
|
||||
uses: actions-rs/cargo@v1
|
||||
with:
|
||||
command: test
|
||||
args: --all --features "valuable"
|
||||
|
||||
|
||||
features-stable:
|
||||
# Feature flag tests that run on stable Rust.
|
||||
# TODO(david): once tracing's MSRV goes up to Rust 1.51, we should be able to switch to
|
||||
|
@ -2,7 +2,7 @@
|
||||
mod app {
|
||||
use std::collections::HashMap;
|
||||
use tracing::field::valuable;
|
||||
use tracing::{info, info_span, instrument};
|
||||
use tracing::{info, instrument};
|
||||
use valuable::Valuable;
|
||||
|
||||
#[derive(Valuable)]
|
||||
|
@ -643,7 +643,7 @@ impl crate::sealed::Sealed for valuable::Value<'_> {}
|
||||
#[cfg_attr(docsrs, doc(cfg(all(tracing_unstable, feature = "valuable"))))]
|
||||
impl Value for valuable::Value<'_> {
|
||||
fn record(&self, key: &Field, visitor: &mut dyn Visit) {
|
||||
visitor.record_value(key, self)
|
||||
visitor.record_value(key, *self)
|
||||
}
|
||||
}
|
||||
|
||||
@ -654,7 +654,7 @@ impl crate::sealed::Sealed for &'_ dyn valuable::Valuable {}
|
||||
#[cfg_attr(docsrs, doc(cfg(all(tracing_unstable, feature = "valuable"))))]
|
||||
impl Value for &'_ dyn valuable::Valuable {
|
||||
fn record(&self, key: &Field, visitor: &mut dyn Visit) {
|
||||
visitor.record_value(key, &self.as_value())
|
||||
visitor.record_value(key, self.as_value())
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user