-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ViewerContext
test harness 0.1
#6432
Conversation
7d70f5d
to
12fb2a1
Compare
63d213b
to
e24d803
Compare
12fb2a1
to
adbc477
Compare
e24d803
to
ceb1dce
Compare
ceb1dce
to
afd3a8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we could instead have a "null context" on re_renderer, but that would be a lot more work I reckon. Not happy how we have to skip over so much code right now.
That said, approving it regardless since it's a huge improvement of what type of unit tests we can write 👍, TestContext
and utility methods that we might add later to it will be invaluable
let Some(render_ctx) = ctx.render_ctx else { | ||
return Err(SpaceViewSystemExecutionError::NoRenderContextError); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a better way that's not super tricky to implement right now, but this kind of early out here makes this approach a lot less viable for benchmarks. It would be great if we could still some logic of the visualizers, at least including the queries
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. In this case though, literally the next line needs a render_ctx
, and it can't be moved further down... 🤷
@@ -20,6 +20,7 @@ mod space_view; | |||
mod store_context; | |||
pub mod store_hub; | |||
mod tensor; | |||
pub mod test_context; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be protected by cfg test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like it should, but then cargo clippy --all-features --all-targets
fails. I'll leave a todo.
What
render_context
field ofViewerContext
anOption
to make it easier to crate aViewerContext
in a test environment.ViewerContext
for use in unit test.SelectionPanel::show_panel()
Chained to #6431
There are many improvements that could be added:
ViewportBlueprint
re_log::warn/err
assert: Add testability features tore_log
#6450Checklist
main
build: rerun.io/viewernightly
build: rerun.io/viewerTo run all checks from
main
, comment on the PR with@rerun-bot full-check
.