Skip to content

Commit

Permalink
Mark some websites as flaky
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Dec 3, 2024
1 parent e257811 commit bc899b8
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tests/test_platform_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,22 @@

from __future__ import annotations

from operator import attrgetter
from string import ascii_lowercase, digits

from extra_platforms import ALL_OS_LABELS, ALL_PLATFORMS

import pytest
import requests

from extra_platforms import ALL_OS_LABELS, ALL_PLATFORMS

flaky_websites = {"raspbian", "midnightbsd"}
"""List of platforms whose websites are expected to not always respond.
Because they block access from GitHub Actions, or can't take the load of requests.
"""


@pytest.mark.parametrize("platform", ALL_PLATFORMS.platforms)
@pytest.mark.parametrize("platform", ALL_PLATFORMS.platforms, ids=attrgetter("id"))
def test_platform_definitions(platform):
assert platform

Expand Down Expand Up @@ -52,8 +59,8 @@ def test_platform_definitions(platform):
# URL.
assert platform.url
assert platform.url.startswith("https://")
if platform.id == "raspbian":
pytest.xfail("raspberrypi.com is blocking access from GitHub Actions")
if platform.id in flaky_websites:
pytest.xfail(f"{platform.url} is known to be flaky and not responding")
with requests.get(platform.url) as response:
assert response.ok, f"{platform.url} is not reachable: {response}"

Expand Down

0 comments on commit bc899b8

Please sign in to comment.