Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix matrix, using recording even if it doesn't use it. #2999

Merged
merged 7 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 2 additions & 9 deletions .github/workflows/promptflow-release-testing-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,11 @@ jobs:
run: |
poetry run pip install $(python -c "import glob; print(glob.glob('**/promptflow_tracing-*.whl', recursive=True)[0])")
poetry run pip install $(python -c "import glob; print(glob.glob('**/promptflow_core-*.whl', recursive=True)[0])")
poetry run pip install -e ../promptflow-recording
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install test dependency group
run: poetry install --only test
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install recording
run: poetry install
working-directory: ${{ env.RECORD_DIRECTORY }}
- name: run core tests
run: poetry run pytest ./tests/core
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down Expand Up @@ -209,13 +207,11 @@ jobs:
run: |
poetry run pip install $(python -c "import glob; print(glob.glob('**/promptflow_tracing-*.whl', recursive=True)[0])")
poetry run pip install $(python -c "import glob; print(glob.glob('**/promptflow_core-*.whl', recursive=True)[0]+'[azureml-serving]')")
poetry run pip install -e ../promptflow-recording
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install test dependency group
run: poetry install --only test
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install recording
run: poetry install
working-directory: ${{ env.RECORD_DIRECTORY }}
- name: run azureml-serving tests
run: poetry run pytest ./tests/azureml-serving
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down Expand Up @@ -274,9 +270,6 @@ jobs:
- name: install test dependency group
run: poetry install --only test
working-directory: ${{ env.WORKING_DIRECTORY }}
- name: install recording
run: poetry install
working-directory: ${{ env.RECORD_DIRECTORY }}
- name: run devkit tests
run: poetry run pytest ./tests/sdk_cli_test ./tests/sdk_pfs_test -n auto -m "unittest or e2etest"
working-directory: ${{ env.WORKING_DIRECTORY }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)
from promptflow.core._model_configuration import AzureOpenAIModelConfiguration
from promptflow.core._prompty_utils import convert_model_configuration_to_connection
from promptflow.recording.record_mode import is_live, is_record, is_replay

TEST_ROOT = PROMPTFLOW_ROOT / "tests"
DATA_DIR = TEST_ROOT / "test_configs/datas"
Expand Down Expand Up @@ -242,11 +241,11 @@ def test_prompty_format_output(self, pf: PFClient):
assert isinstance(result, ChatCompletion)

def test_prompty_with_stream(self, pf: PFClient):
if is_live():
if pytest.is_live:
# When running multiple test cases, the type is generator type.
# When running alone this case, the type is Stream.
stream_type = (types.GeneratorType, Stream)
elif is_record() or is_replay():
elif pytest.is_record or pytest.is_replay:
stream_type = types.GeneratorType
# Test text format with stream=true
prompty = Prompty.load(source=f"{PROMPTY_DIR}/prompty_example.prompty", model={"parameters": {"stream": True}})
Expand Down
Loading