testit-cli 2.9.0__tar.gz → 2.9.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {testit_cli-2.9.0 → testit_cli-2.9.1}/PKG-INFO +2 -1
  2. {testit_cli-2.9.0 → testit_cli-2.9.1}/README.md +1 -0
  3. {testit_cli-2.9.0 → testit_cli-2.9.1}/setup.py +1 -1
  4. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/apiclient.py +5 -1
  5. testit_cli-2.9.1/src/testit_cli/http_retry.py +32 -0
  6. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli.egg-info/PKG-INFO +2 -1
  7. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli.egg-info/SOURCES.txt +1 -0
  8. {testit_cli-2.9.0 → testit_cli-2.9.1}/LICENSE +0 -0
  9. {testit_cli-2.9.0 → testit_cli-2.9.1}/setup.cfg +0 -0
  10. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/__init__.py +0 -0
  11. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/__main__.py +0 -0
  12. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/autotests_filter.py +0 -0
  13. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/click_commands.py +0 -0
  14. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/converter.py +0 -0
  15. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/dir_worker.py +0 -0
  16. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/file_worker.py +0 -0
  17. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/filter_factory.py +0 -0
  18. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/html_escape_utils.py +0 -0
  19. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/importer.py +0 -0
  20. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/logger.py +0 -0
  21. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/models/__init__.py +0 -0
  22. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/models/config.py +0 -0
  23. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/models/mode.py +0 -0
  24. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/models/status_type.py +0 -0
  25. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/models/testcase.py +0 -0
  26. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/models/testrun.py +0 -0
  27. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/parser.py +0 -0
  28. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/service.py +0 -0
  29. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/service_factory.py +0 -0
  30. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli/validation.py +0 -0
  31. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli.egg-info/dependency_links.txt +0 -0
  32. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli.egg-info/entry_points.txt +0 -0
  33. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli.egg-info/requires.txt +0 -0
  34. {testit_cli-2.9.0 → testit_cli-2.9.1}/src/testit_cli.egg-info/top_level.txt +0 -0
  35. {testit_cli-2.9.0 → testit_cli-2.9.1}/tests/test_click.py +0 -0
  36. {testit_cli-2.9.0 → testit_cli-2.9.1}/tests/test_service.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testit-cli
3
- Version: 2.9.0
3
+ Version: 2.9.1
4
4
  Summary: This tool is the command line wrapper of Test IT allowing you to upload the test results in real time to Test IT
5
5
  Home-page: https://pypi.org/project/testit-cli/
6
6
  Author: Integration team
@@ -56,6 +56,7 @@ You can see more information in [official documentation](https://docs.testit.sof
56
56
  | 5.4 | 2.4.11.post540 |
57
57
  | 5.5 | 2.7.2.post550 |
58
58
  | 5.6 | 2.8.1.post560 |
59
+ | 5.7 | 2.9.0.post570 |
59
60
  | Cloud | 2.8.0 + |
60
61
 
61
62
  1. For current versions, see the releases tab.
@@ -23,6 +23,7 @@ You can see more information in [official documentation](https://docs.testit.sof
23
23
  | 5.4 | 2.4.11.post540 |
24
24
  | 5.5 | 2.7.2.post550 |
25
25
  | 5.6 | 2.8.1.post560 |
26
+ | 5.7 | 2.9.0.post570 |
26
27
  | Cloud | 2.8.0 + |
27
28
 
28
29
  1. For current versions, see the releases tab.
@@ -1,6 +1,6 @@
1
1
  from setuptools import find_packages, setup
2
2
 
3
- VERSION = "2.9.0"
3
+ VERSION = "2.9.1"
4
4
 
5
5
  setup(
6
6
  name='testit-cli',
@@ -30,6 +30,7 @@ from testit_api_client.models import (
30
30
  )
31
31
 
32
32
  from .converter import Converter
33
+ from .http_retry import with_http_retries
33
34
  from .models.testrun import TestRun
34
35
  from .html_escape_utils import HtmlEscapeUtils
35
36
 
@@ -60,7 +61,10 @@ class ApiClient:
60
61
  model = HtmlEscapeUtils.escape_html_in_object(model)
61
62
  logging.debug(f"Creating test run with model: {model}")
62
63
 
63
- test_run: TestRunV2ApiResult = self.__test_run_api.create_empty(create_empty_request=model)
64
+ test_run: TestRunV2ApiResult = with_http_retries(
65
+ lambda: self.__test_run_api.create_empty(create_empty_request=model),
66
+ label="Create test run",
67
+ )
64
68
 
65
69
  logging.info(f'Created new testrun (ID: {test_run.id})')
66
70
  logging.debug(f"Test run created: {test_run}")
@@ -0,0 +1,32 @@
1
+ """Retry transient HTTP/connection failures (extend RETRYABLE for other calls)."""
2
+ import logging
3
+ import ssl
4
+ from typing import Callable, Tuple, Type, TypeVar
5
+
6
+ import urllib3.exceptions
7
+
8
+ T = TypeVar("T")
9
+
10
+ # Add exception types here when wrapping more API calls.
11
+ RETRYABLE: Tuple[Type[BaseException], ...] = (
12
+ urllib3.exceptions.ProtocolError,
13
+ urllib3.exceptions.MaxRetryError,
14
+ ConnectionError,
15
+ TimeoutError,
16
+ ssl.SSLError,
17
+ )
18
+
19
+
20
+ def with_http_retries(
21
+ fn: Callable[[], T],
22
+ max_attempts: int = 3,
23
+ label: str = "Request",
24
+ ) -> T:
25
+ """Run fn up to max_attempts times; log each failure; re-raise the last error."""
26
+ for attempt in range(1, max_attempts + 1):
27
+ try:
28
+ return fn()
29
+ except RETRYABLE as exc:
30
+ logging.error("%s failed (attempt %s/%s): %s", label, attempt, max_attempts, exc)
31
+ if attempt == max_attempts:
32
+ raise
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: testit-cli
3
- Version: 2.9.0
3
+ Version: 2.9.1
4
4
  Summary: This tool is the command line wrapper of Test IT allowing you to upload the test results in real time to Test IT
5
5
  Home-page: https://pypi.org/project/testit-cli/
6
6
  Author: Integration team
@@ -56,6 +56,7 @@ You can see more information in [official documentation](https://docs.testit.sof
56
56
  | 5.4 | 2.4.11.post540 |
57
57
  | 5.5 | 2.7.2.post550 |
58
58
  | 5.6 | 2.8.1.post560 |
59
+ | 5.7 | 2.9.0.post570 |
59
60
  | Cloud | 2.8.0 + |
60
61
 
61
62
  1. For current versions, see the releases tab.
@@ -11,6 +11,7 @@ src/testit_cli/dir_worker.py
11
11
  src/testit_cli/file_worker.py
12
12
  src/testit_cli/filter_factory.py
13
13
  src/testit_cli/html_escape_utils.py
14
+ src/testit_cli/http_retry.py
14
15
  src/testit_cli/importer.py
15
16
  src/testit_cli/logger.py
16
17
  src/testit_cli/parser.py
File without changes
File without changes