Fedir Zadniprovskyi 2024-09-22
ci: do not run tests which require OpenAI API key
@12ffdda9f0e07e8f13beae5ed616a1ab0873fa61
.github/workflows/test.yaml
--- .github/workflows/test.yaml
+++ .github/workflows/test.yaml
@@ -20,4 +20,4 @@
       - run: uv python install 3.12
       - run: uv sync --extra dev
       # TODO: figure out why `pytest` doesn't discover tests in `faster_whisper_server` directory by itself
-      - run: uv run pytest src/faster_whisper_server/* tests
+      - run: uv run pytest -m "not requires_openai" src/faster_whisper_server/* tests
tests/openai_timestamp_granularities_test.py
--- tests/openai_timestamp_granularities_test.py
+++ tests/openai_timestamp_granularities_test.py
@@ -6,6 +6,7 @@
 
 
 @pytest.mark.asyncio()
+@pytest.mark.requires_openai()
 @pytest.mark.parametrize("timestamp_granularities", TIMESTAMP_GRANULARITIES_COMBINATIONS)
 async def test_openai_json_response_format_and_timestamp_granularities_combinations(
     actual_openai_client: AsyncOpenAI,
@@ -28,6 +29,7 @@
 
 
 @pytest.mark.asyncio()
+@pytest.mark.requires_openai()
 @pytest.mark.parametrize("timestamp_granularities", TIMESTAMP_GRANULARITIES_COMBINATIONS)
 async def test_openai_verbose_json_response_format_and_timestamp_granularities_combinations(
     actual_openai_client: AsyncOpenAI,
Add a comment
List