mirror of
https://github.com/nextcloud/twofactor_gateway.git
synced 2026-04-25 00:55:52 +03:00
[GH-ISSUE #672] RFC: Integration Tests -- How To? #129
Labels
No labels
0. to triage
1. to develop
3. to review
blocked
bug
discussion
duplicate
enhancement
enhancement
gateway:signal
gateway:signal
gateway:signal
gateway:sms
gateway:telegram
hacktoberfest
help wanted
invalid
needs info
php
pull-request
question
technical debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/twofactor_gateway-nextcloud#129
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rotdrop on GitHub (Sep 23, 2025).
Original GitHub issue: https://github.com/nextcloud/twofactor_gateway/issues/672
Just some brain-storming: this app adds means to obtain the second authentication factor via various service providers. It would be nice to have some "integration tests" -- ideally for all service providers. How could this be done? As most of the service providers require some sort of registration I suppose that this would require a test-account for each service provider (Signal, various SMS-Provides, Ouch WhatsApp etc.).
Perhaps one could ask for sponsoring? Concerning Signal one just needs any telephone number. For other services it might be different.
It would be cool to be able to perform real usage tests against the set of the currently -- perhaps -- supported providers.
Just writing this as an RFC (Request For Comments).
@vitormattos commented on GitHub (Sep 24, 2025):
One possible approach is to use unit tests, generating mocks of API responses. The LibreSign app has some tests similar to this, which I've done using the project https://github.com/donatj/mock-webserver. I'll think about this further and perhaps create a pull request as a proof of concept.
@rotdrop commented on GitHub (Sep 24, 2025):
Yes, but this adds another bunch of things that need to be kept in sync with the numerous providers. It also does not cover changes in the API which may or may not be announced by the providers. I think that "real integration tests" which access the currently implemented APIs of the numerous providers are easier to maintain and more likely to catch errors as this would be closer to the real-life usage.
@vitormattos commented on GitHub (Sep 24, 2025):
Real integration tests have some complexities because they depend on managing access credentials. This can create a security issue, as it will allow messages to be sent by multiple providers by anyone with permission to create a pull request that automatically executes CI. Another point is that they are highly susceptible to failures because the external service may not be working for some reason.
If we assume that the code is compatible with the provider's version at the time of the code creation, mocking may not be a problem but a solution to signalize that the implementation respect the API contract. New versions of the providers will certainly break (or are already broken, as there's no way to validate all existing ones) and at this case, opening an issue could be easier and safe.