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)
Sat, Jul 6, 11:31 PM
Unknown Object (File)
Thu, Jul 4, 2:55 PM
Unknown Object (File)
Sat, Jun 29, 10:37 PM
Unknown Object (File)
Sat, Jun 29, 10:37 PM
Unknown Object (File)
Sat, Jun 29, 10:37 PM
Unknown Object (File)
Sat, Jun 29, 10:37 PM
Unknown Object (File)
Sat, Jun 29, 10:37 PM
Unknown Object (File)
Sat, Jun 29, 10:37 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.