You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The weaver_semconv crate describes the data model used to represent a semantic convention registry. To validate that the model aligns with the official version of the OpenTelemetry semantic convention, we can create an integration test that ensures parsing all the files in the registry produces no errors.
Several things are necessary to implement this integration test:
Ensure that each Rust structure used to represent an object from the registry is annotated with #[serde(deny_unknown_fields)]. This ensures that there are no fields in the official registry (yaml file) that are not described in the corresponding Rust structures. This should already be the case, but it would be useful to verify.
Create a tests directory at the root of the weaver project to add an integration test for validating the parsing of all files from the official registry. See Rust Integration Test doc.
Use the weaver_cache crate in combination with the weaver_semconv crate to 1) locally retrieve the registry files (see unit test in weaver_cache/src/lib.rs) and 2) parse these files with the load_from_file method of the SemConvSpecs structure.
Note: I think that for now, it's better to postpone testing the registry resolution process until this process is finalized in weaver_resolver (see registry.rs).
The text was updated successfully, but these errors were encountered:
The
weaver_semconv
crate describes the data model used to represent a semantic convention registry. To validate that the model aligns with the official version of the OpenTelemetry semantic convention, we can create an integration test that ensures parsing all the files in the registry produces no errors.Several things are necessary to implement this integration test:
#[serde(deny_unknown_fields)]
. This ensures that there are no fields in the official registry (yaml file) that are not described in the corresponding Rust structures. This should already be the case, but it would be useful to verify.tests
directory at the root of theweaver
project to add an integration test for validating the parsing of all files from the official registry. See Rust Integration Test doc.weaver_cache
crate in combination with theweaver_semconv
crate to 1) locally retrieve the registry files (see unit test inweaver_cache/src/lib.rs
) and 2) parse these files with theload_from_file
method of theSemConvSpecs
structure.Note: I think that for now, it's better to postpone testing the registry resolution process until this process is finalized in
weaver_resolver
(see registry.rs).The text was updated successfully, but these errors were encountered: