Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial tests on the authentication service. #6229

Merged
merged 2 commits into from
Jun 6, 2022

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented May 31, 2022

Most of the authentication service was untested (and some of the tests were temporarily using live servers). This PR adds a MockAuthenticationRestClient and tests for login/registration. There is room for more tests (and adding an email/MSISDN identifier still needs implementation), but these tests cover the majority of the flow/state and can be added to over time.

Part of #6179 depends on matrix-org/matrix-ios-sdk#1484

@pixlwave pixlwave requested review from a team, stefanceriu and aringenbach and removed request for a team May 31, 2022 18:16
@pixlwave pixlwave force-pushed the doug/6179_mock_auth_client branch from 8464619 to e889804 Compare May 31, 2022 18:30
@github-actions
Copy link

github-actions bot commented May 31, 2022

📱 Scan the QR code below to install the build for this PR.
🔒 This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.

QR code

If you can't scan the QR code you can install the build via this link: https://i.diawi.com/2J1fg6

Copy link
Contributor

@aringenbach aringenbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Not sure what's up with the GH Action though as I fail loading logs, tests did run successfully for me.

@pixlwave
Copy link
Member Author

pixlwave commented Jun 1, 2022

Thanks, yeah I'm confused too. Didn't get time to look into it today so will have to have a look next week when I'm back.

Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests look good to me but a lot of them crash (EXC_BAD_ACCESS) now inside the MXRestClient (they work on develop). I believe the same thing happens on the CI but isn't handled properly.
I imagine it's linked to the sessionCreator but I haven't really looked into it.

@pixlwave
Copy link
Member Author

pixlwave commented Jun 6, 2022

I imagine it's linked to the sessionCreator but I haven't really looked into it.

Bingo! I've added an empty handler in the init as this seems to be expected when the credentials are set (and not checked for nullability) in MXRestClient's init.

@pixlwave pixlwave requested a review from stefanceriu June 6, 2022 11:35
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍

@pixlwave pixlwave merged commit a9beeac into develop Jun 6, 2022
@pixlwave pixlwave deleted the doug/6179_mock_auth_client branch June 6, 2022 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants