Page MenuHomePhabricator

[services] Tunnelbroker - Database MessageItem tests
ClosedPublic

Authored by max on Apr 11 2022, 3:50 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 1:09 PM
Unknown Object (File)
Mon, Nov 4, 1:09 PM
Unknown Object (File)
Sun, Nov 3, 4:01 PM
Unknown Object (File)
Sat, Nov 2, 9:59 AM
Unknown Object (File)
Sat, Nov 2, 9:59 AM
Unknown Object (File)
Sat, Nov 2, 9:59 AM
Unknown Object (File)
Sat, Nov 2, 7:48 AM
Unknown Object (File)
Sat, Nov 2, 7:48 AM

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

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

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.