-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CM-8738] improve request exception handling (#103)
* Add env setup to openai tests workflow * Remove old fixture usage * Move env setup to tests step * Add debug print for integration test * Add -ss arg to pytest * Add debug print for integration test * Fix log call * Add log * Move env setup to 1 level above * Move env setup to 1 level above * Delete env setup from runner * Move env setup to runner * Revert last change * Add secrets: inherit * Remove debug logs * Remove -ss arg in pytest command * Reorganize request exception handling logic * Remove odd comment * [CM-9020] add config for disabling TLS verification (#107) * Add new configuration for tls verification, inject Session dependency into RestApiClient class * Fix lint errors * Refactor session object setup * Bypass cache decorator in tests * Change log message in module loader
- Loading branch information
1 parent
2aa3f8f
commit d5a6b57
Showing
6 changed files
with
61 additions
and
35 deletions.
There are no files selected for viewing
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
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
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
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
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,21 @@ | ||
import json | ||
|
||
import box | ||
import pytest | ||
from testix import * | ||
|
||
from comet_llm.exceptions import exceptions | ||
from comet_llm.experiment_api import failed_response_handler | ||
|
||
|
||
def test_wrap__request_exception_non_llm_project_sdk_code__log_specifc_message_in_exception(): | ||
exception = Exception() | ||
exception.response = box.Box(text=json.dumps({"sdk_error_code": 34323})) | ||
|
||
expected_log_message = "Failed to send prompt to the specified project as it is not an LLM project, please specify a different project name." | ||
|
||
|
||
with pytest.raises(exceptions.CometLLMException) as excinfo: | ||
failed_response_handler.handle(exception) | ||
|
||
assert excinfo.value.args == (expected_log_message, ) |
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