linebender / linebender/android_trace
Tests for AndroidTraceLayer (`tracing_android_trace`)
- Dominant language
- Rust
- Stars
- 13
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
The [sync layer](https://github.com/linebender/android_trace/blob/main/tracing_android_trace/src/sync_layer.rs) has some nasty code to manage the stack. E.g. (up-to-date at the time of writing):
https://github.com/linebender/android_trace/blob/d4bd04d6ad70a8e7f833cf0bfe9b1b712fd48e11/tracing_android_trace/src/sync_layer.rs#L227-L239
We should find a way to test this code. This would involve:
1) Enabling mocking AndroidTrace for testing, somehow (either with a trait, or by specifying the function calls directly)
2) Creating a layer which uses this mocked AndroidTrace
3) Running tests with different timings of enabled/disabled and span creation/exiting
4) Saving the resulting trees, and seeing if they make sense (probably with a kind of snapshot testing), + that each open of a span is met with a matching close
This is not a high priority
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in tracing_android_trace/src/sync_layer.rs, especially the stack-management code linked around lines 227-239, and inspect how AndroidTrace calls are made. Exercise enabled/disabled timing and span creation/exiting through a mockable AndroidTrace. Done means saved trees are sensible and every opened span has a matching close.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, rust
- Domain
- mobile-dev, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100