Skip to content

Commit 0b99ee1

Browse files
add aoai assistants streaming/v2 tests (#35443)
* add aoai assistants streaming tests * update to 2024-05-01-preview and add assistants v2 tests * fix some tests * fix * try to fix flaky assistants tests * more updates to fix flakiness * fix more flakiness and only run openai on weekly
1 parent 6bb9e47 commit 0b99ee1

File tree

5 files changed

+885
-168
lines changed

5 files changed

+885
-168
lines changed

sdk/openai/azure-openai/tests/conftest.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
DefaultAzureCredential as AsyncDefaultAzureCredential,
1717
get_bearer_token_provider as get_bearer_token_provider_async,
1818
)
19+
from ci_tools.variables import in_ci
1920

2021

2122
# for pytest.parametrize
2223
GA = "2024-02-01"
23-
PREVIEW = "2024-03-01-preview"
24+
PREVIEW = "2024-05-01-preview"
2425
LATEST = PREVIEW
2526

2627
AZURE = "azure"
@@ -65,8 +66,15 @@
6566
ENV_OPENAI_TTS_MODEL = "tts-1"
6667

6768

69+
def skip_openai_test(api_type) -> bool:
70+
return in_ci() and "openai" in api_type and "tests-weekly" not in os.getenv("SYSTEM_DEFINITIONNAME", "")
71+
72+
6873
@pytest.fixture
6974
def client(api_type, api_version):
75+
if skip_openai_test(api_type):
76+
pytest.skip("Skipping openai tests - they only run on tests-weekly.")
77+
7078
if api_type == "azure":
7179
client = openai.AzureOpenAI(
7280
azure_endpoint=os.getenv(ENV_AZURE_OPENAI_ENDPOINT),
@@ -100,6 +108,9 @@ def client(api_type, api_version):
100108

101109
@pytest.fixture
102110
def client_async(api_type, api_version):
111+
if skip_openai_test(api_type):
112+
pytest.skip("Skipping openai tests - they only run on tests-weekly.")
113+
103114
if api_type == "azure":
104115
client = openai.AsyncAzureOpenAI(
105116
azure_endpoint=os.getenv(ENV_AZURE_OPENAI_ENDPOINT),

0 commit comments

Comments
 (0)