-
Notifications
You must be signed in to change notification settings - Fork 31
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
Modifier les tests qui utilisent le réseau #2287
Comments
@fchabouis pour info en lien relatif, je suis en train de gérer celui-ci: #1751 ; j'édite la description pour l'ajouter |
* Stop using network during tests (#1751, #2287) This creates a failing test, more refactoring will come. * Add clean test * Mix format * Add wip alternate implementation coverage * Add test-case for the other implementation * Setup behaviour (with a slightly different signature on purpose) The boolean flag is partially a trick to cope with the lack of proper testing setup. I remove it so that it can signal (via compilation errors) where it is used. * Setup configuration * Setup mock * Modify controller to use higher level interface * Fix test * Fix test * Use new behaviour I'm filtering when is_blank is true * Add moduledoc * Add todos * Replace implementation by wrapper * Mix format * Replace mock by mox (now that the behaviour is in place) * Email should not be sent * Remove legacy code used for testing or skipping send * Mark impl * Remove now obsolete test * Remove unused import * Add systematic verify (to fix a test checking this but also make sure it happens) * Remove all the "blanks" After discussing with Francis & Antoine, it seems that it is more a testing technique than anything else. I am moving to raw calls, then will adapt tests & relevant APIs, to ensure we can have more transparent code. * Adapt test API (no more blank) and add TODO * Adapt test API (no more blank) and add TODO * Adapt test API (no more blank) and add TODO * Run "mix format" * Bring back meaningful test * Bring back another meaningful test * Bring back yet another test * Remove import * Fix credo warning * Remove todo for now (I will add a PR comment that this isn't tested yet) * Remove dead code * Remove dead code (already muted in #1189) * Add todos * Add sample config file to make it easy to work locally * Add a dummy implementation for dev * Remove unused alias * Clarify confusing (to me) code * Make dev dummy email work * Add note * Replace HTTPoison call by wrapper for testability * Implement test for obscure inactive_data code * Remove TODO * Add doc * outdated_data should not send empty email * Format code * Document inactive_data in full (doc + tests) * Add missing test for outdated_data overall behaviour * Restructure test into describe block * Rename file to match module name * Try to trigger CircleCI * Trigger build * Add verify! * Update apps/transport/test/transport/mailjet_client_test.exs Co-authored-by: Antoine Augusti <[email protected]> * Rename topic to subject Co-authored-by: Antoine Augusti <[email protected]>
Il en reste, je réouvre et je vais donner des éléments (découvert en travaillant sur #1853). |
Les joyeux coupables sont tous les tests qui font une de ces invocations : Mox.stub_with(Transport.HTTPoison.Mock, HTTPoison)
Mox.stub_with(Transport.AvailabilityChecker.Mock, Transport.AvailabilityChecker) Ca cela fait que le mock invoque du vrai code qui requête. |
@etalab/transport-tech c'est résolu ça non ? |
@AntoineAugusti je crois que oui, on pourra réouvrir au besoin. |
Les appels que j'avais mentionné plus haut sont toujours potentiellement problématiques, mais je pense qu'on doit faire autre chose à côté qui fait que ça ne dérange pas. On verra si ça se représente ! |
J'ai remarqué qu'en lançant certains tests, on utilise le réseau. Ce n'est probablement pas voulu.
Je vais lister ici au fur et à mesure les fichiers concernés :
The text was updated successfully, but these errors were encountered: