Page MenuHomePhabricator

[services] Tunnelbroker - Database MessageItem tests
ClosedPublic

Authored by max on Apr 11 2022, 3:50 AM.
Tags
None
Referenced Files
F5110410: D3689.id11701.diff
Tue, Apr 1, 11:38 PM
F5107162: D3689.id11581.diff
Tue, Apr 1, 10:32 AM
F5107139: D3689.id11544.diff
Tue, Apr 1, 10:31 AM
Unknown Object (File)
Tue, Apr 1, 12:51 AM
Unknown Object (File)
Mon, Mar 31, 10:59 PM
Unknown Object (File)
Mon, Mar 31, 5:10 PM
Unknown Object (File)
Sun, Mar 30, 9:25 PM
Unknown Object (File)
Sat, Mar 29, 11:52 PM

Details

Summary

Database (DynamoDB) item tests. For the MessageItem database entity we perform:

  • Check if the table is available,
  • Create and fulfill database item entity,
  • Put into the database table,
  • Find the record using the primary key,
  • Compare record fields of created item and item from database record,
  • Remove the testing record from the database.

Related linear task: ENG-686

Test Plan

Run yarn test-tunnelbroker-service all tests are run and succeed.

Diff Detail

Repository
rCOMM Comm
Branch
tunnelbroker-tests-database-messageitem
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek requested changes to this revision.Apr 11 2022, 5:55 AM

We also need to clarify our approach to randomness in D3654

services/tunnelbroker/test/DatabaseManagerTest.cpp
43–48 ↗(On Diff #11276)
This revision now requires changes to proceed.Apr 11 2022, 5:55 AM

Switch from memcmp to a simple EQ.

max marked an inline comment as done.

Switching to the Plan changes until we clarify the random/non-random value for tests.

Added tests with static variables along with generated ones following D3654#102087.

Verbose output for generated values was added.

Remove == equality to EQ only.

tomek requested changes to this revision.Apr 19 2022, 2:35 AM
tomek added inline comments.
services/tunnelbroker/test/DatabaseManagerTest.cpp
26 ↗(On Diff #11586)

We're testing db manager by putting a message item and checking if find returns a similar item - please update the test name

This revision now requires changes to proceed.Apr 19 2022, 2:35 AM

Changed the test names to reflect the actions inside.

max added inline comments.
services/tunnelbroker/test/DatabaseManagerTest.cpp
26 ↗(On Diff #11586)

We're testing db manager by putting a message item and checking if find returns a similar item - please update the test name

Agree, names were changed.

This revision is now accepted and ready to land.Apr 21 2022, 2:37 AM
max marked an inline comment as done.

Rebase on master.