Skip to content

chore: add tests #5128

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

Merged
merged 1 commit into from
May 14, 2025
Merged

chore: add tests #5128

merged 1 commit into from
May 14, 2025

Conversation

kostasrim
Copy link
Contributor

Fixes a bunch of bugs around command replies for tdigest functions and adds tests.

  • fix bugs around command replies
  • add tests

Signed-off-by: kostas <[email protected]>
@kostasrim kostasrim self-assigned this May 14, 2025
@kostasrim kostasrim changed the base branch from main to prob_base May 14, 2025 10:31
@@ -457,8 +462,15 @@ void TDigestFamily::Quantile(CmdArgList args, const CommandContext& cmd_cntx) {
};

auto res = cmd_cntx.tx->ScheduleSingleHopT(cb);
// SendError covers ok
return cmd_cntx.rb->SendError(res.status());
if (!res) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will extract those in a function at some point 🤣

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. So my previous comment can be ignored.

@@ -20,7 +20,14 @@ class TDigestFamilyTest : public BaseFamilyTest {
protected:
};

TEST_F(TDigestFamilyTest, TDigestBasic) {
TEST_F(TDigestFamilyTest, Basic) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have tests for all TDIGEST commands :)

@kostasrim
Copy link
Contributor Author

only serialization is left and this is feature complete.

// SendError covers ok
return cmd_cntx.rb->SendError(res.status());
if (!res) {
return cmd_cntx.rb->SendError(res.status());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move it below auto* rb = static_cast<facade::RedisReplyBuilder*>(cmd_cntx.rb);

@@ -457,8 +462,15 @@ void TDigestFamily::Quantile(CmdArgList args, const CommandContext& cmd_cntx) {
};

auto res = cmd_cntx.tx->ScheduleSingleHopT(cb);
// SendError covers ok
return cmd_cntx.rb->SendError(res.status());
if (!res) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay. So my previous comment can be ignored.

@kostasrim kostasrim merged commit 7bf7f98 into prob_base May 14, 2025
10 checks passed
@kostasrim kostasrim deleted the kpr6 branch May 14, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants