testgenie-py 0.2.7__py3-none-any.whl → 0.2.9__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.
- testgen/controller/docker_controller.py +13 -16
- {testgenie_py-0.2.7.dist-info → testgenie_py-0.2.9.dist-info}/METADATA +1 -1
- {testgenie_py-0.2.7.dist-info → testgenie_py-0.2.9.dist-info}/RECORD +5 -5
- {testgenie_py-0.2.7.dist-info → testgenie_py-0.2.9.dist-info}/WHEEL +0 -0
- {testgenie_py-0.2.7.dist-info → testgenie_py-0.2.9.dist-info}/entry_points.txt +0 -0
@@ -1,4 +1,3 @@
|
|
1
|
-
import importlib
|
2
1
|
import os
|
3
2
|
import sys
|
4
3
|
from argparse import Namespace
|
@@ -6,7 +5,10 @@ import docker
|
|
6
5
|
from docker import DockerClient, client
|
7
6
|
from docker import errors
|
8
7
|
from docker.models.containers import Container
|
9
|
-
import importlib.resources
|
8
|
+
import importlib.resources as pkg_resources
|
9
|
+
import tempfile
|
10
|
+
import shutil
|
11
|
+
|
10
12
|
from testgen.service.logging_service import get_logger
|
11
13
|
from testgen.service.service import Service
|
12
14
|
|
@@ -134,14 +136,9 @@ class DockerController:
|
|
134
136
|
print(f"Docker args: {docker_args}")
|
135
137
|
print(f"Project root: {project_root}")
|
136
138
|
|
137
|
-
# Debug command to find file and then run testgenie with args
|
138
|
-
debug_cmd = f'find /controller -type f -name "*.py" | grep -i boolean || echo "File not found"; ' \
|
139
|
-
f'ls -la /controller; ' \
|
140
|
-
f'testgenie /controller/testgen/code_to_test/boolean.py --test-mode=fuzz --test-format=pytest'
|
141
|
-
|
142
139
|
return docker_client.containers.run(
|
143
140
|
image=image_name,
|
144
|
-
command=["
|
141
|
+
command=["testgenie"] + docker_args,
|
145
142
|
volumes={
|
146
143
|
os.path.abspath(project_root): {
|
147
144
|
"bind": "/controller",
|
@@ -196,23 +193,23 @@ class DockerController:
|
|
196
193
|
return False
|
197
194
|
|
198
195
|
def get_dockerfile_path(self) -> str:
|
199
|
-
|
196
|
+
# First, try local development path
|
200
197
|
local_dockerfile = os.path.join(os.path.dirname(__file__), "docker", "Dockerfile")
|
201
|
-
print(f"Checking local path: {local_dockerfile}")
|
202
198
|
if os.path.exists(local_dockerfile):
|
199
|
+
self.debug(f"Found local Dockerfile at: {local_dockerfile}")
|
203
200
|
return local_dockerfile
|
204
201
|
|
205
202
|
# If not found locally, try inside installed package
|
206
203
|
try:
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
return str(dockerfile_path)
|
204
|
+
dockerfile_resource = pkg_resources.files('testgen').joinpath('docker/Dockerfile')
|
205
|
+
if dockerfile_resource.is_file():
|
206
|
+
self.debug(f"Found package-installed Dockerfile at: {dockerfile_resource}")
|
207
|
+
return str(dockerfile_resource)
|
212
208
|
except Exception as e:
|
213
209
|
print(f"Error locating Dockerfile in package resources: {e}")
|
214
210
|
|
215
|
-
|
211
|
+
print("Dockerfile not found in local project or package.")
|
212
|
+
sys.exit(1)
|
216
213
|
|
217
214
|
@staticmethod
|
218
215
|
def is_inside_docker() -> bool:
|
@@ -12,7 +12,7 @@ testgen/analyzer/test_case_analyzer.py,sha256=0qLcRKOrQ4Uyh1ZMecVTkY9bWjNnx7Orid
|
|
12
12
|
testgen/analyzer/test_case_analyzer_context.py,sha256=7umDPHBjoTaCRvZOdNynpnWsr14Gy0E2hpMBPK8mz3Q,2128
|
13
13
|
testgen/controller/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
14
|
testgen/controller/cli_controller.py,sha256=A3TsJQT20UI2TlBqC7SyI8TG0n1vP_Itd1K8TRoD3ps,8735
|
15
|
-
testgen/controller/docker_controller.py,sha256=
|
15
|
+
testgen/controller/docker_controller.py,sha256=M6Q_tiAGX8j4lH1NLUFMTCreKXmoKTEpgo60z-KWVRg,8343
|
16
16
|
testgen/docker/Dockerfile,sha256=6mutzP0ZkVueuvMLCOy2bsyGxWjLHU-cq7RFkuC8r5Y,781
|
17
17
|
testgen/generated_boolean.py,sha256=i5at_BZ7YHtveTMYB0JKMFIkBe7cwhCeF5AViLhNoWA,1146
|
18
18
|
testgen/generated_samplecodebin.py,sha256=pf_aYtcfpjZzgiZ_FiBOxfug_ii3dRX0jnozBgQm7Xw,17030
|
@@ -63,7 +63,7 @@ testgen/util/z3_utils/branch_condition.py,sha256=N9FNR-iJmxIC62NpDQNVZ1OP14rXXqY
|
|
63
63
|
testgen/util/z3_utils/constraint_extractor.py,sha256=RXJLpmk6dAvHZ27839VXKXNtdy9St1F-17-pSEFu4bM,1285
|
64
64
|
testgen/util/z3_utils/variable_finder.py,sha256=dUh3F9_L_BDMz1ybiGss09LLcM_egbitgj0FT5Nh9u4,245
|
65
65
|
testgen/util/z3_utils/z3_test_case.py,sha256=yF4oJOrXMLzOwDUqXdoeg83MOTl3pvc_lYaZcS01CuQ,4983
|
66
|
-
testgenie_py-0.2.
|
67
|
-
testgenie_py-0.2.
|
68
|
-
testgenie_py-0.2.
|
69
|
-
testgenie_py-0.2.
|
66
|
+
testgenie_py-0.2.9.dist-info/METADATA,sha256=x8FM6FoDZMDEwwrMGBT3JN_FXGA2edB4sNl2SQkWjcs,4350
|
67
|
+
testgenie_py-0.2.9.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
68
|
+
testgenie_py-0.2.9.dist-info/entry_points.txt,sha256=OUN4GqB4zHlHWwWGjwIPbur4E_ZqQgkeeqaCLhzRZgg,47
|
69
|
+
testgenie_py-0.2.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|