-
Notifications
You must be signed in to change notification settings - Fork 746
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding test to check fro PF eval dependencies on private API's (#3135)
# Description Please add an informative description that covers that changes made by the pull request and link all relevant issues. # All Promptflow Contribution checklist: - [ ] **The pull request does not introduce [breaking changes].** - [ ] **CHANGELOG is updated for new features, bug fixes or other significant changes.** - [ ] **I have read the [contribution guidelines](../CONTRIBUTING.md).** - [ ] **Create an issue and link to the pull request to get dedicated review from promptflow team. Learn more: [suggested workflow](../CONTRIBUTING.md#suggested-workflow).** ## General Guidelines and Best Practices - [ ] Title of the pull request is clear and informative. - [ ] There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, [see this page](https://github.com/Azure/azure-powershell/blob/master/documentation/development-docs/cleaning-up-commits.md). ### Testing Guidelines - [ ] Pull request includes test coverage for the included changes. --------- Co-authored-by: Clement Wang <47586720+wangchao1230@users.noreply.github.com>
- Loading branch information
1 parent
912d05f
commit 0690f41
Showing
4 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/promptflow-azure/promptflow/azure/_dependencies/_pf_evals.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# --------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# --------------------------------------------------------- | ||
|
||
# This file captures promptflow-evals dependencies on private API of promptflow. | ||
# In case changes are made please reach out to promptflow-evals team to update the dependencies. | ||
|
||
# flake8: noqa | ||
from promptflow.azure.operations._async_run_uploader import AsyncRunUploader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/promptflow-devkit/promptflow/_dependencies/_pf_evals.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# --------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# --------------------------------------------------------- | ||
|
||
# This file captures promptflow-evals dependencies on private API of promptflow. | ||
# In case changes are made please reach out to promptflow-evals team to update the dependencies. | ||
|
||
# flake8: noqa | ||
from promptflow._sdk._constants import LINE_NUMBER, Local2Cloud | ||
from promptflow._sdk._configuration import Configuration |
27 changes: 27 additions & 0 deletions
27
src/promptflow-devkit/tests/unittests/_sdk/_utilities/test_pf_eval_dependencies.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from unittest.mock import patch | ||
|
||
import pytest | ||
from promptflow._dependencies._pf_evals import LINE_NUMBER, Local2Cloud, Configuration | ||
|
||
DUMMY_TRACE_DESTINATION = ("azureml://subscriptions/sub_id/resourceGroups/resource_group_name" | ||
"/providers/Microsoft.MachineLearningServices/workspaces/workspace_name") | ||
|
||
|
||
@pytest.fixture | ||
def patch_config_validation(): | ||
with patch("promptflow._sdk._configuration.Configuration._validate", return_value=None): | ||
yield | ||
|
||
|
||
@pytest.mark.unittest | ||
class TestPromptflowEvalsDependencies: | ||
|
||
def test_pf_eval_constants_dependencies(self): | ||
assert LINE_NUMBER == "line_number" | ||
assert Local2Cloud.FLOW_INSTANCE_RESULTS_FILE_NAME == "instance_results.jsonl" | ||
assert Local2Cloud.BLOB_ROOT_PROMPTFLOW == "promptflow" | ||
assert Local2Cloud.BLOB_ARTIFACTS == "PromptFlowArtifacts" | ||
|
||
def test_pf_eval_configuration_dependencies(self, patch_config_validation): | ||
config = Configuration(overrides={"trace.destination": DUMMY_TRACE_DESTINATION}) | ||
assert config.get_trace_destination() == DUMMY_TRACE_DESTINATION |