Page MenuHomePhabricator

[commtest] Add tests for Identity device list
ClosedPublic

Authored by bartek on Dec 21 2023, 2:15 AM.
Tags
None
Referenced Files
F2148818: D10422.id34896.diff
Sun, Jun 30, 6:27 AM
F2148377: D10422.id35630.diff
Sun, Jun 30, 4:46 AM
F2145910: D10422.id35616.diff
Sat, Jun 29, 10:56 PM
Unknown Object (File)
Sat, Jun 29, 2:03 PM
Unknown Object (File)
Tue, Jun 25, 3:24 PM
Unknown Object (File)
Tue, Jun 25, 12:04 PM
Unknown Object (File)
Tue, Jun 25, 12:04 PM
Unknown Object (File)
Tue, Jun 25, 12:04 PM
Subscribers

Details

Summary

Added integration tests for device list. I ended up with a single integration test that tests the following:

  • Adding devices during register
  • Adding devices during login
  • Removing devices on logout
  • Reordering devices so mobile is the primary device when possible
  • Getting device list updates for another user and verifying their order

Depends on D10421

Test Plan

CommTest, CI

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Dec 21 2023, 3:48 AM
kamil added 1 blocking reviewer(s): varun.

Looks good, but probably it's better for @varun to have a final look

services/commtest/tests/identity_device_list_tests.rs
25–26 ↗(On Diff #34902)

to make it a bit more readable I would probably do something like this

30 ↗(On Diff #34902)

just wondering, are you sure this is not interfering with tests that we use the same keys (DEFAULT_CLIENT_KEYS) during registration? (here for the viewer and later for Android device)

42 ↗(On Diff #34902)

probably can be removed?

72 ↗(On Diff #34902)

I would use here and in line 64 android to make it obvious we are using the same user but different devices, or maybe put both generated username and user_id in meaningful variables, but it is just a test so if you think it's okay this also looks fine

services/commtest/tests/identity_device_list_tests.rs
25–26 ↗(On Diff #34902)

good idea

30 ↗(On Diff #34902)

No, keys need to be unique per-user. Nothing in Identity Service treats them "globally" (e.g. sync between users or sth)

42 ↗(On Diff #34902)

yep

72 ↗(On Diff #34902)

Makes sense. The only reason I used ios.user_id was to avoid cloning 😅

varun added inline comments.
services/commtest/tests/identity_device_list_tests.rs
51 ↗(On Diff #34902)

Log in (applies to other comments too)

This revision is now accepted and ready to land.Jan 7 2024, 8:11 PM