-
Notifications
You must be signed in to change notification settings - Fork 160
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
test(rpc): rpc unit tests with db snapshot #5034
Conversation
4a2bd96
to
2936e3d
Compare
@@ -0,0 +1,2 @@ | |||
f3_gettipsetbyepoch_1730952732441851.json.zst |
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.
The list is to be expanded.
}; | ||
let snapshot: RpcCallSnapshot = serde_json::from_slice(snapshot_bytes.as_slice())?; | ||
let db_bytes = BASE64_STANDARD.decode(&snapshot.db)?; | ||
let db = Arc::new(match MemoryDB::deserialize_from(db_bytes.as_slice()) { |
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.
Can we use CAR files rather than serialized memory-dbs?
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.
Yes, that's doable. The only downside is that CAR DB is not capable of storing non-content-addressable data(e.g. HEAD -> head_tsk) thus at least 2 files(CAR db, and setting DB+request+desired response) are required for a test case, while with the current solution a single test-snap file is sufficient.
9ae33bd
to
5a74d49
Compare
5a74d49
to
f5d98d7
Compare
Superseded by #5074 (Keep open for now just for referencing review comments) |
Summary of changes
Part of #5046
Changes introduced in this pull request:
forest-tool api test [RPC_SNAPSHOTS]
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist