Parcourir la source

Skip id-redirect tests on CI (Cloudflare block)

Zed il y a 3 semaines
Parent
commit
2ccebaf22a
1 fichiers modifiés avec 8 ajouts et 0 suppressions
  1. 8 0
      tests/test_profile.py

+ 8 - 0
tests/test_profile.py

@@ -1,3 +1,6 @@
+import os
+import unittest
+
 from base import BaseTestCase, Profile
 from parameterized import parameterized
 
@@ -101,6 +104,11 @@ class ProfileTest(BaseTestCase):
         self.assertIn(url, banner.get_attribute('src'))
 
 
+# UserByRestId clears Cloudflare from residential IPs and via the cloaking
+# proxy, but CF's edge rule on that endpoint rejects GitHub Actions' datacenter
+# ASN regardless of headers, so these live redirects can't pass in CI (#1433).
+@unittest.skipIf(os.environ.get('GITHUB_ACTIONS') == 'true',
+                 'UserByRestId is Cloudflare-blocked from GitHub datacenter IPs')
 class UserIdRedirectTest(BaseTestCase):
     @parameterized.expand(id_redirects)
     def test_i_user_redirect(self, user_id, username):