-
Notifications
You must be signed in to change notification settings - Fork 373
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
API examples overhaul & roundtrip tests #3204
Conversation
185f377
to
ed46e8e
Compare
ed46e8e
to
cc34319
Compare
@@ -1097,7 +1144,12 @@ impl RecordingStream { | |||
/// terms of data durability and ordering. | |||
/// See [`Self::set_sink`] for more information. | |||
pub fn connect(&self, addr: std::net::SocketAddr, flush_timeout: Option<std::time::Duration>) { | |||
self.set_sink(Box::new(crate::log_sink::TcpSink::new(addr, flush_timeout))); | |||
// NOTE: `forced_sink` is only used for tests, it's ok to unwrap. |
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.
🙈
Really all of our sink APIs should uniformly return a RecordingStreamResult
. Having connect actually fail if it can't talk to the server with an option for our current "keep retrying in a background thread" behavior would be a more predictable user experience.
@@ -1,28 +1,37 @@ | |||
import rerun as rr | |||
import rerun.experimental as rr2 | |||
from rerun.experimental import dt as rrd |
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.
from rerun.experimental import dt as rrd | |
from rerun.experimental import dt as rrd |
I think we should avoid rrd
as the convention here due to name collision with rrd
the file extension.
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.
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.
Aside from the tensorid/meshid thing this looks great.
I also added an issue to check for TODOs in code examples (#3224). I think it's fine to have TODOs in main, we just need to be careful about not deploying them.
{0.f, 1.f, 1.f}, | ||
}; | ||
rr_stream.log("segments", rr::LineStrips3D(points)); | ||
// TODO(#3202): I want to do this! |
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.
Nit: we don't want to leak these kinds of TODOs into the embedded snippets in the doc-pages.
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 won't do anything about that for now; we'll cleanup during the pre-release doc pass.
#3224 is there to make sure we don't forget!
|
cc34319
to
ba22d22
Compare
ba22d22
to
06f10da
Compare
b1ccb69
to
42991df
Compare
42991df
to
3d6ebc5
Compare
Size changes
|
Commit by commit
This PR overhauls API examples to make them roundtrippable and checks those roundtrips on CI.
These roundtrips serve two purposes: A) the obvious one: they make sure that using our different SDKs in similar ways actually yield similar data, but more importantly B) they act as regression tests since it is highly unlikely that two or more tests written in different languages fail in the exact same way at the exact same time.
As I've painfully found out during the
MsgSender
migration, a lot of our tests had bitrotten and simply did not work in one way or another anymore (in fact I ended up fixing yet another batch for this PR).This PR should provide the foundations so that this doesn't happen again.
A nice side-effect of this is the introduction of the
_RERUN_TEST_FORCE_SAVE
environment variable, which forces allRecordingStream
s instantiated across all 3 languages to write to an rrd file on disk rather than do whatever they were asked to do.This makes testing things much easier.
What
Checklist