🧪4️⃣ test: level 4 cleanup

This commit is contained in:
Florian Hönicke
2023-05-02 23:02:33 +02:00
parent 2f152dd7f7
commit e4c680d20c
3 changed files with 17 additions and 5 deletions

View File

@@ -42,7 +42,10 @@ BLACKLISTED_PACKAGES = [
# 'Pyrender', 'Trimesh',
'moderngl', 'pyopengl', 'pyglet', 'pythreejs', 'panda3d', # because they need a screen,
'tika', # because it needs java
'fastapi', 'uvicorn', 'starlette', # because we use jina executors
'fastapi', 'uvicorn', 'starlette',
]
UNNECESSARY_PACKAGES = [
'fastapi', 'uvicorn', 'starlette' # because the wrappers are used instead
]
LANGUAGE_PACKAGES = [

View File

@@ -18,7 +18,7 @@ from src.apis.pypi import is_package_on_pypi
from src.constants import FILE_AND_TAG_PAIRS, NUM_IMPLEMENTATION_STRATEGIES, MAX_DEBUGGING_ITERATIONS, \
BLACKLISTED_PACKAGES, EXECUTOR_FILE_NAME, TEST_EXECUTOR_FILE_NAME, TEST_EXECUTOR_FILE_TAG, \
REQUIREMENTS_FILE_NAME, REQUIREMENTS_FILE_TAG, DOCKER_FILE_NAME, IMPLEMENTATION_FILE_NAME, \
IMPLEMENTATION_FILE_TAG, LANGUAGE_PACKAGES
IMPLEMENTATION_FILE_TAG, LANGUAGE_PACKAGES, UNNECESSARY_PACKAGES
from src.options.generate.templates_system import system_task_iteration, system_task_introduction, system_test_iteration
from src.options.generate.templates_user import template_generate_microservice_name, \
template_generate_possible_packages, \
@@ -297,7 +297,7 @@ pytest
log_hubble = push_executor(previous_microservice_path)
error = process_error_message(log_hubble)
if error:
print('An error occurred during the build process. Feeding the error back to the assistent...')
print('An error occurred during the build process. Feeding the error back to the assistant...')
self.do_debug_iteration(error, next_microservice_path, previous_microservice_path)
if i == MAX_DEBUGGING_ITERATIONS - 1:
raise self.MaxDebugTimeReachedException('Could not debug the microservice.')
@@ -544,7 +544,16 @@ Test scenario:
@staticmethod
def filter_packages_list(packages_list):
# filter out complete package lists
packages_list = [
[package for package in packages if package not in BLACKLISTED_PACKAGES and is_package_on_pypi(package)] for packages in packages_list
packages for packages in packages_list if all([
is_package_on_pypi(pkg) # all packages must be on pypi
and pkg not in BLACKLISTED_PACKAGES # no package is allowed to be blacklisted
for pkg in packages
])
]
# filter out single packages
packages_list = [
[package for package in packages if package not in UNNECESSARY_PACKAGES] for packages in packages_list
]
return packages_list

View File

@@ -87,7 +87,7 @@ def test_generation_level_3(tmpdir):
6. Return the summary as a string.
Example input: 'AAPL'
''',
str(tmpdir) + 'microservice',
str(tmpdir),
'gpt-3.5-turbo'
)
assert generator.generate() == 0