cds-snc / notification-planning

Project planning for GC Notify Team
5 stars 0 forks source link

Admin unit test uses 3rd party service #772

Open sastels opened 2 years ago

sastels commented 2 years ago

The test in admin test_blocklist1_can_contact_hibp_api() actually goes out to pwnedpasswords. This leads to test failures if there's a problem with pwnedpasswords' api.

It's not a great practice to have unit tests that require internet resources. We should consider eliminating this test, and instead adding a warning to Blocklist.__call__() when the code falls back to using our stored list of bad passwords.

Tasks:

jimleroyer commented 2 years ago

Could we categorize these tests with pytest and run these separate? I am not sure we'll check the warnings; if the site goes down, how do we surface it?

andrewleith commented 2 years ago

Yes - for example, we could have a suite of tests that assess third party services we rely on? One that wouldn't cause our build pipeline to fail?