infrahub-testcontainers 1.2.3__py3-none-any.whl → 1.2.5__py3-none-any.whl
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.
- infrahub_testcontainers/container.py +4 -0
- infrahub_testcontainers/helpers.py +1 -1
- infrahub_testcontainers/models.py +2 -2
- infrahub_testcontainers/performance_test.py +4 -4
- {infrahub_testcontainers-1.2.3.dist-info → infrahub_testcontainers-1.2.5.dist-info}/METADATA +1 -1
- {infrahub_testcontainers-1.2.3.dist-info → infrahub_testcontainers-1.2.5.dist-info}/RECORD +8 -8
- {infrahub_testcontainers-1.2.3.dist-info → infrahub_testcontainers-1.2.5.dist-info}/WHEEL +0 -0
- {infrahub_testcontainers-1.2.3.dist-info → infrahub_testcontainers-1.2.5.dist-info}/entry_points.txt +0 -0
|
@@ -57,6 +57,7 @@ PROJECT_ENV_VARIABLES: dict[str, str] = {
|
|
|
57
57
|
"INFRAHUB_TESTING_API_SERVER_COUNT": "2",
|
|
58
58
|
"INFRAHUB_TESTING_TASK_WORKER_COUNT": "2",
|
|
59
59
|
"INFRAHUB_TESTING_PREFECT_UI_ENABLED": "true",
|
|
60
|
+
"INFRAHUB_TESTING_DOCKER_PULL": "true",
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
|
|
@@ -173,6 +174,9 @@ class InfrahubDockerCompose(DockerCompose):
|
|
|
173
174
|
|
|
174
175
|
up_cmd = [*base_cmd, "up"]
|
|
175
176
|
|
|
177
|
+
if self.get_env_var("INFRAHUB_TESTING_DOCKER_PULL") == "false":
|
|
178
|
+
up_cmd.extend(["--pull", "never"])
|
|
179
|
+
|
|
176
180
|
# build means modifying the up command
|
|
177
181
|
if self.wait:
|
|
178
182
|
up_cmd.append("--wait")
|
|
@@ -12,7 +12,7 @@ from .container import PROJECT_ENV_VARIABLES, InfrahubDockerCompose
|
|
|
12
12
|
class TestInfrahubDocker:
|
|
13
13
|
@pytest.fixture(scope="class")
|
|
14
14
|
def infrahub_version(self) -> str:
|
|
15
|
-
return infrahub_version
|
|
15
|
+
return os.getenv("INFRAHUB_TESTING_IMAGE_VER") or infrahub_version
|
|
16
16
|
|
|
17
17
|
@staticmethod
|
|
18
18
|
def execute_ctl_run(address: str, script: str) -> str:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from datetime import
|
|
1
|
+
from datetime import datetime, timezone
|
|
2
2
|
from enum import Enum
|
|
3
3
|
from typing import Any
|
|
4
4
|
|
|
@@ -27,7 +27,7 @@ class InfrahubResultContext(BaseModel):
|
|
|
27
27
|
|
|
28
28
|
class InfrahubActiveMeasurementItem(BaseModel):
|
|
29
29
|
definition: MeasurementDefinition
|
|
30
|
-
start_time: datetime = datetime.now(
|
|
30
|
+
start_time: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
|
|
31
31
|
context: dict[str, Any] = Field(default_factory=dict)
|
|
32
32
|
|
|
33
33
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import hashlib
|
|
2
2
|
import json
|
|
3
|
-
from datetime import
|
|
3
|
+
from datetime import datetime, timezone
|
|
4
4
|
from types import TracebackType
|
|
5
5
|
from typing import Any
|
|
6
6
|
|
|
@@ -35,7 +35,7 @@ class InfrahubPerformanceTest:
|
|
|
35
35
|
self.env_vars = {}
|
|
36
36
|
self.project_name = ""
|
|
37
37
|
self.test_info = {}
|
|
38
|
-
self.start_time = datetime.now(
|
|
38
|
+
self.start_time = datetime.now(timezone.utc)
|
|
39
39
|
self.end_time: datetime | None = None
|
|
40
40
|
self.results_url = results_url
|
|
41
41
|
self.scraper_endpoint = ""
|
|
@@ -57,7 +57,7 @@ class InfrahubPerformanceTest:
|
|
|
57
57
|
|
|
58
58
|
def finalize(self, session: pytest.Session) -> None:
|
|
59
59
|
if self.initialized:
|
|
60
|
-
self.end_time = datetime.now(
|
|
60
|
+
self.end_time = datetime.now(timezone.utc)
|
|
61
61
|
self.extract_test_session_information(session)
|
|
62
62
|
self.send_results()
|
|
63
63
|
|
|
@@ -129,7 +129,7 @@ class InfrahubPerformanceTest:
|
|
|
129
129
|
if not exc_type and self.active_measurements:
|
|
130
130
|
self.add_measurement(
|
|
131
131
|
definition=self.active_measurements.definition,
|
|
132
|
-
value=(datetime.now(
|
|
132
|
+
value=(datetime.now(timezone.utc) - self.active_measurements.start_time).total_seconds() * 1000,
|
|
133
133
|
context=self.active_measurements.context,
|
|
134
134
|
)
|
|
135
135
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
infrahub_testcontainers/__init__.py,sha256=oPpmesGgYBSdKTg1L37FGwYBeao1EHury5SJGul-CT8,216
|
|
2
2
|
infrahub_testcontainers/constants.py,sha256=mZ4hLvcf4rKk9wC7EId4MQxAY0sk4V99deB04N0J2bg,85
|
|
3
|
-
infrahub_testcontainers/container.py,sha256=
|
|
3
|
+
infrahub_testcontainers/container.py,sha256=FUkEVkPwUtYGfjHd6brLkI_3D4-qYmH5BGAOlyJrFU4,10652
|
|
4
4
|
infrahub_testcontainers/docker-compose.test.yml,sha256=MqN8TPIAWNOZg93m_P2HH5etyYvtgYmwR92SyHR_GDQ,7017
|
|
5
5
|
infrahub_testcontainers/haproxy.cfg,sha256=QUkG2Xu-hKoknPOeYKAkBT_xJH6U9CfIS0DTMFZJsnk,1305
|
|
6
|
-
infrahub_testcontainers/helpers.py,sha256=
|
|
6
|
+
infrahub_testcontainers/helpers.py,sha256=zsvBOql5qM2OX1ybPcklqF-nzWYHkZI3Gk3KZhxWOtU,3578
|
|
7
7
|
infrahub_testcontainers/host.py,sha256=Z4_gGoGKKeM_HGVS7SdYL1FTNGyLBk8wzicdSKHpfmM,1486
|
|
8
8
|
infrahub_testcontainers/measurements.py,sha256=gR-uTasSIFCXrwvnNpIpfsQIopKftT7pBiarCgIShaQ,2214
|
|
9
|
-
infrahub_testcontainers/models.py,sha256=
|
|
10
|
-
infrahub_testcontainers/performance_test.py,sha256=
|
|
9
|
+
infrahub_testcontainers/models.py,sha256=ASYyvl7d_WQz_i7y8-3iab9hwwmCl3OCJavqVbe8nXU,954
|
|
10
|
+
infrahub_testcontainers/performance_test.py,sha256=PSE03jevzv63n-v5rxNIzuQsbtCR-pVqLVpJddjCHhs,6025
|
|
11
11
|
infrahub_testcontainers/plugin.py,sha256=vk33oG44MA2zxZwqMsS8_CkScm5LwuwwFmSOtmeAdMU,5357
|
|
12
12
|
infrahub_testcontainers/prometheus.yml,sha256=610xQEyj3xuVJMzPkC4m1fRnCrjGpiRBrXA2ytCLa54,599
|
|
13
|
-
infrahub_testcontainers-1.2.
|
|
14
|
-
infrahub_testcontainers-1.2.
|
|
15
|
-
infrahub_testcontainers-1.2.
|
|
16
|
-
infrahub_testcontainers-1.2.
|
|
13
|
+
infrahub_testcontainers-1.2.5.dist-info/METADATA,sha256=XRcGdOcQvTzGYZOegFvLY_BO-QPqzhby22uf7hO5E5A,981
|
|
14
|
+
infrahub_testcontainers-1.2.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
15
|
+
infrahub_testcontainers-1.2.5.dist-info/entry_points.txt,sha256=gHOERdtVE0P8dYz6FHkn2KplpbXvCDJQnuWg_IP0-qQ,76
|
|
16
|
+
infrahub_testcontainers-1.2.5.dist-info/RECORD,,
|
|
File without changes
|
{infrahub_testcontainers-1.2.3.dist-info → infrahub_testcontainers-1.2.5.dist-info}/entry_points.txt
RENAMED
|
File without changes
|