delta-io / delta-kernel-rs

A native Delta implementation for integration with any query engine
Apache License 2.0
144 stars 41 forks source link

Adding some more miri tests #503

Open nicklan opened 23 hours ago

nicklan commented 23 hours ago

What changes are proposed in this pull request?

Add more tests to ffi so we're using miri to test more things.

Also, add a testing only clone_ptr method to handles. This creates a new Handle just by cloning the interior pointer value .

Functions like snapshot want to take an owned Handle<SharedExternEngine>, which means we can't "reuse" a handle from rust code. But the semantics are actually that dropping the handle (which will happen after calling snapshot) does not drop the underlying data, so if we call snapshot from "regular" rust code, we actually leak it. So to "simulate" what happens in c/c++ we can clone_ptr which just makes another pointer, so you don't have to lose access to the original. This is really not safe, so it's only available in #[cfg(test)]

codecov[bot] commented 23 hours ago

Codecov Report

Attention: Patch coverage is 97.10145% with 2 lines in your changes missing coverage. Please review.

Project coverage is 80.73%. Comparing base (67cc099) to head (245404c). Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
ffi/src/lib.rs 96.77% 0 Missing and 2 partials :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #503 +/- ## ========================================== + Coverage 79.82% 80.73% +0.90% ========================================== Files 57 61 +4 Lines 12591 13375 +784 Branches 12591 13375 +784 ========================================== + Hits 10051 10798 +747 - Misses 2006 2027 +21 - Partials 534 550 +16 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.