Page MenuHomePhabricator

[services] Tunnelbroker - Database PublicKeyItem tests
ClosedPublic

Authored by max on Apr 11 2022, 3:45 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 29, 11:40 AM
Unknown Object (File)
Fri, Nov 15, 5:09 AM
Unknown Object (File)
Thu, Nov 14, 8:58 AM
Unknown Object (File)
Wed, Nov 13, 2:09 AM
Unknown Object (File)
Thu, Nov 7, 5:51 PM
Unknown Object (File)
Sun, Nov 3, 4:07 PM
Unknown Object (File)
Sun, Nov 3, 4:07 PM
Unknown Object (File)
Sun, Nov 3, 4:07 PM

Details

Summary

Database (DynamoDB) item tests. For the PublicKeyItem 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:20 AM

We also need to clarify our approach to randomness in D3654

services/tunnelbroker/test/DatabaseManagerTest.cpp
39–44 ↗(On Diff #11275)
This revision now requires changes to proceed.Apr 11 2022, 5:20 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 in case of failure was added.

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

We're not testing operations on this item - we're doing that on the db manager and then we verify if it matched the one we've put.

This revision now requires changes to proceed.Apr 19 2022, 2:33 AM
max added inline comments.
services/tunnelbroker/test/DatabaseManagerTest.cpp
26 ↗(On Diff #11582)

We're not testing operations on this item - we're doing that on the db manager and then we verify if it matched the one we've put.

Changed the test names to reflect the actions inside.

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

Rebase on master.