Page MenuHomePhabricator

[commtest] Add tests for Identity device list
ClosedPublic

Authored by bartek on Dec 21 2023, 2:15 AM.
Tags
None
Referenced Files
F3389874: D10422.id35630.diff
Fri, Nov 29, 8:53 PM
F3389866: D10422.id34902.diff
Fri, Nov 29, 8:52 PM
F3389800: D10422.id35616.diff
Fri, Nov 29, 8:37 PM
F3389397: D10422.diff
Fri, Nov 29, 6:56 PM
Unknown Object (File)
Tue, Nov 26, 12:27 AM
Unknown Object (File)
Wed, Nov 13, 2:08 AM
Unknown Object (File)
Fri, Nov 8, 4:16 AM
Unknown Object (File)
Thu, Nov 7, 5:35 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