Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import pytest
from devtools_testutils import EnvironmentVariableLoader

# Environment variable keys
ENV_ENDPOINT = "CONVERSATIONS_ENDPOINT"
ENV_KEY = "CONVERSATIONS_KEY"

# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method
@pytest.fixture(scope="session")
def conversations_endpoint(environment_variables: EnvironmentVariableLoader) -> str:
"""Endpoint for Conversations tests."""
return environment_variables.get(ENV_ENDPOINT)

@pytest.fixture(scope="session")
def conversations_key(environment_variables: EnvironmentVariableLoader) -> str:
"""API key for Conversations tests."""
return environment_variables.get(ENV_KEY)

# autouse=True will trigger this fixture on each pytest run
# test_proxy auto-starts the test proxy
# patch_sleep and patch_async_sleep streamline tests by disabling wait times during LRO polling
# patch_sleep and patch_async_sleep remove wait times during polling
@pytest.fixture(scope="session", autouse=True)
def start_proxy(test_proxy, patch_sleep, patch_async_sleep):
return
return
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
import pytest
from devtools_testutils import EnvironmentVariableLoader

# Environment variable keys
ENV_ENDPOINT = "AUTHORING_ENDPOINT"
ENV_KEY = "AUTHORING_KEY"

# autouse=True will trigger this fixture on each pytest run, even if it's not explicitly used by a test method
@pytest.fixture(scope="session")
def authoring_endpoint(environment_variables: EnvironmentVariableLoader) -> str:
"""Endpoint for Authoring tests."""
return environment_variables.get(ENV_ENDPOINT)

@pytest.fixture(scope="session")
def authoring_key(environment_variables: EnvironmentVariableLoader) -> str:
"""API key for Authoring tests."""
return environment_variables.get(ENV_KEY)

# autouse=True will trigger this fixture on each pytest run
# test_proxy auto-starts the test proxy
# patch_sleep and patch_async_sleep streamline tests by disabling wait times during LRO polling
# patch_sleep and patch_async_sleep remove wait times during polling
@pytest.fixture(scope="session", autouse=True)
def start_proxy(test_proxy, patch_sleep, patch_async_sleep):
return
return
6 changes: 6 additions & 0 deletions sdk/cognitivelanguage/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ extends:
AZURE_CONVERSATIONS_DEPLOYMENT_NAME: $(clu-project-deployment)
AZURE_CONVERSATIONS_WORKFLOW_PROJECT_NAME: $(clu-workflow-project)
AZURE_CONVERSATIONS_WORKFLOW_DEPLOYMENT_NAME: $(clu-workflow-project-deployment)
CONVERSATIONS_ENDPOINT: $(clu-uri)
CONVERSATIONS_KEY: $(clu-key)
AUTHORING_ENDPOINT: $(clu-uri)
AUTHORING_KEY: $(clu-key)
TEXT_ANALYSIS_ENDPOINT: $(ta-uri)
TEXT_ANALYSIS_KEY: $(ta-key)
AZURE_SUBSCRIPTION_ID: $(COGNITIVELANGUAGE_SUBSCRIPTION_ID)
TEST_MODE: "RunLiveNoRecord" # use when allowing preparers to create the rgs for you
AZURE_TEST_RUN_LIVE: 'true'
Expand Down
Loading