infrahub-testcontainers 1.2.9rc0__py3-none-any.whl → 1.3.0a0__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.
@@ -28,7 +28,6 @@ INFRAHUB_SERVICES: dict[str, ContainerService] = {
28
28
  }
29
29
 
30
30
  PROJECT_ENV_VARIABLES: dict[str, str] = {
31
- "NEO4J_DOCKER_IMAGE": "neo4j:5.20.0-community",
32
31
  "MESSAGE_QUEUE_DOCKER_IMAGE": "rabbitmq:3.13.7-management",
33
32
  "CACHE_DOCKER_IMAGE": "redis:7.2.4",
34
33
  "INFRAHUB_TESTING_DOCKER_IMAGE": "registry.opsmill.io/opsmill/infrahub",
@@ -50,21 +50,21 @@ services:
50
50
  limits:
51
51
  cpus: ${INFRAHUB_TESTING_DB_CPU_LIMIT:-0.0}
52
52
  memory: ${INFRAHUB_TESTING_DB_MEMORY_LIMIT:-0}
53
- image: ${NEO4J_DOCKER_IMAGE:-neo4j:5.20.0-community}
53
+ image: ${NEO4J_DOCKER_IMAGE:-neo4j:2025.03.0-community}
54
54
  restart: unless-stopped
55
55
  environment:
56
56
  NEO4J_AUTH: neo4j/admin
57
57
  NEO4J_dbms_security_procedures_unrestricted: "apoc.*"
58
58
  NEO4J_dbms_security_auth__minimum__password__length: 4
59
59
  NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
60
- NEO4J_dbms_memory_heap_initial__size: ${INFRAHUB_TESTING_DB_HEAP_INITIAL_SIZE}
61
- NEO4J_dbms_memory_heap_max__size: ${INFRAHUB_TESTING_DB_HEAP_MAX_SIZE}
60
+ NEO4J_server_memory_heap_initial__size: ${INFRAHUB_TESTING_DB_HEAP_INITIAL_SIZE}
61
+ NEO4J_server_memory_heap_max__size: ${INFRAHUB_TESTING_DB_HEAP_MAX_SIZE}
62
62
  volumes:
63
63
  - "database_data:/data"
64
64
  - "database_logs:/logs"
65
65
  - "./${INFRAHUB_TESTING_LOCAL_DB_BACKUP_DIRECTORY}:${INFRAHUB_TESTING_INTERNAL_DB_BACKUP_DIRECTORY}"
66
66
  healthcheck:
67
- test: wget http://localhost:7474 || exit 1
67
+ test: wget -O /dev/null http://localhost:7474 || exit 1
68
68
  interval: 2s
69
69
  timeout: 10s
70
70
  retries: 20
@@ -1,8 +1,10 @@
1
1
  import os
2
2
  import subprocess # noqa: S404
3
+ import uuid
3
4
  from pathlib import Path
4
5
 
5
6
  import pytest
7
+ from prefect.client.orchestration import PrefectClient
6
8
 
7
9
  from infrahub_testcontainers import __version__ as infrahub_version
8
10
 
@@ -38,8 +40,8 @@ class TestInfrahubDocker:
38
40
 
39
41
  @pytest.fixture(scope="class")
40
42
  def tmp_directory(self, tmpdir_factory: pytest.TempdirFactory) -> Path:
41
- directory = Path(str(tmpdir_factory.getbasetemp().strpath))
42
- return directory
43
+ name = f"{self.__class__.__name__.lower()}_{uuid.uuid4().hex}"
44
+ return Path(str(tmpdir_factory.mktemp(name)))
43
45
 
44
46
  @pytest.fixture(scope="class")
45
47
  def remote_repos_dir(self, tmp_directory: Path) -> Path:
@@ -91,3 +93,7 @@ class TestInfrahubDocker:
91
93
  @pytest.fixture(scope="class")
92
94
  def task_manager_port(self, infrahub_app: dict[str, int]) -> int:
93
95
  return infrahub_app["task-manager"]
96
+
97
+ @pytest.fixture(scope="class")
98
+ def prefect_client(self, task_manager_port: int) -> PrefectClient:
99
+ return PrefectClient(api=f"http://localhost:{task_manager_port}/api/")
@@ -158,9 +158,12 @@ class InfrahubPerformanceTest:
158
158
  "kind": PERFORMANCE_TEST_KIND,
159
159
  "payload_format": PERFORMANCE_TEST_VERSION,
160
160
  "data": data,
161
- "checksum": hashlib.sha256(json.dumps(data).encode()).hexdigest(),
161
+ "checksum": hashlib.sha256(json.dumps(data, separators=(",", ":")).encode()).hexdigest(),
162
162
  }
163
163
 
164
164
  with httpx.Client() as client:
165
- response = client.post(self.results_url, json=payload)
166
- response.raise_for_status()
165
+ try:
166
+ response = client.post(self.results_url, json=payload)
167
+ response.raise_for_status()
168
+ except Exception as exc:
169
+ print(exc)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: infrahub-testcontainers
3
- Version: 1.2.9rc0
3
+ Version: 1.3.0a0
4
4
  Summary: Testcontainers instance for Infrahub to easily build integration tests
5
5
  Home-page: https://opsmill.com
6
6
  License: Apache-2.0
@@ -0,0 +1,16 @@
1
+ infrahub_testcontainers/__init__.py,sha256=oPpmesGgYBSdKTg1L37FGwYBeao1EHury5SJGul-CT8,216
2
+ infrahub_testcontainers/constants.py,sha256=mZ4hLvcf4rKk9wC7EId4MQxAY0sk4V99deB04N0J2bg,85
3
+ infrahub_testcontainers/container.py,sha256=V_xMdUfzOeHZWc2y7jP5VSwWt6L0jaB4aFvdQeV45LA,12256
4
+ infrahub_testcontainers/docker-compose.test.yml,sha256=N-bz6k7KvjVPAW-acRZ_IxWKIjnWnto_Mq9sOEMDkB8,8485
5
+ infrahub_testcontainers/haproxy.cfg,sha256=QUkG2Xu-hKoknPOeYKAkBT_xJH6U9CfIS0DTMFZJsnk,1305
6
+ infrahub_testcontainers/helpers.py,sha256=pVmNjrs42q1lI2klBL-qeaY_UXeZdvwlDQSKR3Tr1EA,3863
7
+ infrahub_testcontainers/host.py,sha256=Z4_gGoGKKeM_HGVS7SdYL1FTNGyLBk8wzicdSKHpfmM,1486
8
+ infrahub_testcontainers/measurements.py,sha256=gR-uTasSIFCXrwvnNpIpfsQIopKftT7pBiarCgIShaQ,2214
9
+ infrahub_testcontainers/models.py,sha256=ASYyvl7d_WQz_i7y8-3iab9hwwmCl3OCJavqVbe8nXU,954
10
+ infrahub_testcontainers/performance_test.py,sha256=hvwiy6tc_lWniYqGkqfOXVGAmA_IV15VOZqbiD9ezno,6149
11
+ infrahub_testcontainers/plugin.py,sha256=g24SMg4EAqVe2N8i9F66EV34cNqIdDU4mRP7OeOJO1w,5381
12
+ infrahub_testcontainers/prometheus.yml,sha256=610xQEyj3xuVJMzPkC4m1fRnCrjGpiRBrXA2ytCLa54,599
13
+ infrahub_testcontainers-1.3.0a0.dist-info/METADATA,sha256=oHMmlYdo9mltVh5XFZpAgoPVe-fgbPCv61IZraeMKvg,983
14
+ infrahub_testcontainers-1.3.0a0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
15
+ infrahub_testcontainers-1.3.0a0.dist-info/entry_points.txt,sha256=gHOERdtVE0P8dYz6FHkn2KplpbXvCDJQnuWg_IP0-qQ,76
16
+ infrahub_testcontainers-1.3.0a0.dist-info/RECORD,,
@@ -1,16 +0,0 @@
1
- infrahub_testcontainers/__init__.py,sha256=oPpmesGgYBSdKTg1L37FGwYBeao1EHury5SJGul-CT8,216
2
- infrahub_testcontainers/constants.py,sha256=mZ4hLvcf4rKk9wC7EId4MQxAY0sk4V99deB04N0J2bg,85
3
- infrahub_testcontainers/container.py,sha256=-NccmHKJw8rnGY4nSgqIJdGBrX8eObi9kq7q7mQz1zs,12308
4
- infrahub_testcontainers/docker-compose.test.yml,sha256=3rUOn2UB_n5z_XlYykO6c6j35OMgyvZXwVSFqlem54Y,8465
5
- infrahub_testcontainers/haproxy.cfg,sha256=QUkG2Xu-hKoknPOeYKAkBT_xJH6U9CfIS0DTMFZJsnk,1305
6
- infrahub_testcontainers/helpers.py,sha256=zsvBOql5qM2OX1ybPcklqF-nzWYHkZI3Gk3KZhxWOtU,3578
7
- infrahub_testcontainers/host.py,sha256=Z4_gGoGKKeM_HGVS7SdYL1FTNGyLBk8wzicdSKHpfmM,1486
8
- infrahub_testcontainers/measurements.py,sha256=gR-uTasSIFCXrwvnNpIpfsQIopKftT7pBiarCgIShaQ,2214
9
- infrahub_testcontainers/models.py,sha256=ASYyvl7d_WQz_i7y8-3iab9hwwmCl3OCJavqVbe8nXU,954
10
- infrahub_testcontainers/performance_test.py,sha256=CZ0YeGqnc9RCEPPk5-jFh0b0zFz-DYweOBF-Lfo0bc8,6037
11
- infrahub_testcontainers/plugin.py,sha256=g24SMg4EAqVe2N8i9F66EV34cNqIdDU4mRP7OeOJO1w,5381
12
- infrahub_testcontainers/prometheus.yml,sha256=610xQEyj3xuVJMzPkC4m1fRnCrjGpiRBrXA2ytCLa54,599
13
- infrahub_testcontainers-1.2.9rc0.dist-info/METADATA,sha256=HSLk0Dv1DlKyp0xseLxk-CN_mqyof7T36ReEkADCKAM,984
14
- infrahub_testcontainers-1.2.9rc0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
15
- infrahub_testcontainers-1.2.9rc0.dist-info/entry_points.txt,sha256=gHOERdtVE0P8dYz6FHkn2KplpbXvCDJQnuWg_IP0-qQ,76
16
- infrahub_testcontainers-1.2.9rc0.dist-info/RECORD,,