Page MenuHomePhabricator

[services] Tunnelbroker - Fix message `from` and `to` swap in AMQP tests
ClosedPublic

Authored by max on Aug 4 2022, 11:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 2:16 AM
Unknown Object (File)
Mon, Oct 28, 2:06 PM
Unknown Object (File)
Sun, Oct 27, 6:16 AM
Unknown Object (File)
Sun, Oct 27, 6:16 AM
Unknown Object (File)
Sun, Oct 27, 6:16 AM
Unknown Object (File)
Sun, Oct 27, 6:12 AM
Unknown Object (File)
Oct 13 2024, 10:26 PM
Unknown Object (File)
Oct 7 2024, 5:00 AM

Details

Summary

This diff is a fix.

The constructor for the MessageItem entity was changed (fromDeviceID and `toDeviceID was swapped in places), but the tests have not reflected these changes. This diff fixes tests for the message items to reflect these changes.

Related Linear task: ENG-1491

Test Plan

Tests in DatabaseManagerTest.cpp was successfully built and passed in a sandbox.

Diff Detail

Repository
rCOMM Comm
Branch
fix-amqp-tests-from-to-swap
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

max held this revision as a draft.
max published this revision for review.Aug 4 2022, 12:33 PM
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)
max added reviewers: karol, tomek.
max edited the summary of this revision. (Show Details)
max edited the test plan for this revision. (Show Details)
tomek added inline comments.
services/tunnelbroker/test/AmqpManagerTest.cpp
38–39

Is there a way to avoid this confusion in the future? I guess we could use https://en.cppreference.com/w/cpp/language/aggregate_initialization#Designated_initializers but that requires C++20. We can also consider using a builder pattern, where every property needs to be set by using a method with meaningful name.

This revision is now accepted and ready to land.Aug 5 2022, 5:35 AM
max added inline comments.
services/tunnelbroker/test/AmqpManagerTest.cpp
38–39

Is there a way to avoid this confusion in the future? I guess we could use https://en.cppreference.com/w/cpp/language/aggregate_initialization#Designated_initializers but that requires C++20.

I think there is some problem with switching to C++20 related to React Native ?

Is there a way to avoid this confusion in the future?

Running unit tests in CI will solve such sort of problems because it will just fail.

I think there is some problem with switching to C++20 related to React Native ?

Yeah. @varun is looking into this right now... @varun, can you document your attempts / progress in a Linear task, so other people have context?