Page MenuHomePhabricator

[commtest] Add tests for Identity device list
ClosedPublic

Authored by bartek on Dec 21 2023, 2:15 AM.
Tags
None
Referenced Files
F2170939: D10422.diff
Tue, Jul 2, 4:28 PM
Unknown Object (File)
Sun, Jun 30, 7:29 PM
Unknown Object (File)
Sun, Jun 30, 6:27 AM
Unknown Object (File)
Sun, Jun 30, 4:46 AM
Unknown Object (File)
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
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
No Lint Coverage
Unit
No Test Coverage

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

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

30

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

probably can be removed?

72

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

good idea

30

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

42

yep

72

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

Log in (applies to other comments too)

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