Skip to content

Commit

Permalink
Tests: Replace broken flaky with pytest-rerunfailures
Browse files Browse the repository at this point in the history
  • Loading branch information
roekatz committed Mar 4, 2024
1 parent 76fd0bf commit 9e2116f
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest pytest-asyncio
python -m pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f ./tests/requirements.txt ]; then pip install -r ./tests/requirements.txt; fi
- name: Lint with flake8
Expand Down
3 changes: 1 addition & 2 deletions packages/opal-client/opal_client/tests/data_updater_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import uvicorn
from aiohttp import ClientSession
from fastapi_websocket_pubsub import PubSubClient
from flaky import flaky
from pydantic.json import pydantic_encoder

# Add parent path to use local src as package for tests
Expand Down Expand Up @@ -161,7 +160,7 @@ async def run():
asyncio.run(run())


@flaky
@pytest.mark.flaky(reruns=1)
@pytest.mark.asyncio
async def test_data_updater(server):
"""Disable auto-update on connect (fetch_on_connect=False) Connect to OPAL-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import pytest
import uvicorn
from fastapi import Depends, FastAPI, Header, HTTPException
from flaky import flaky
from opal_common.fetcher import FetchingEngine
from opal_common.fetcher.providers.http_fetch_provider import HttpFetcherConfig

Expand Down Expand Up @@ -124,7 +123,7 @@ async def callback(data):
assert got_data_event.is_set()


@flaky
@pytest.mark.flaky(reruns=1)
@pytest.mark.asyncio
async def test_external_http_get():
"""Test simple http get on external (https://freegeoip.app/) site Checking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from aiohttp import ClientSession
from fastapi import Depends
from fastapi_websocket_pubsub import PubSubClient
from flaky import flaky
from opal_common.schemas.webhook import GitWebhookRequestParams
from opal_common.tests.test_utils import wait_for_server
from opal_server.policy.webhook.api import get_webhook_router, is_matching_webhook_url
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
ipython
pytest
pytest-asyncio
flaky
pytest-rerunfailures
wheel
twine
setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability

0 comments on commit 9e2116f

Please sign in to comment.