mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
more cleanup
This commit is contained in:
parent
31091350c9
commit
ec97ebd4e7
4 changed files with 3 additions and 58 deletions
|
|
@ -1,49 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="PYTHON_MODULE" version="4">
|
|
||||||
<component name="FacetManager">
|
|
||||||
<facet type="django" name="Django">
|
|
||||||
<configuration>
|
|
||||||
<option name="rootFolder" value="$MODULE_DIR$/django/aiservice" />
|
|
||||||
<option name="settingsModule" value="aiservice/settings.py" />
|
|
||||||
<option name="manageScript" value="manage.py" />
|
|
||||||
<option name="environment" value="<map/>" />
|
|
||||||
<option name="doNotUseTestRunner" value="false" />
|
|
||||||
<option name="trackFilePattern" value="" />
|
|
||||||
</configuration>
|
|
||||||
</facet>
|
|
||||||
</component>
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/cli/tests" isTestSource="true" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/django/aiservice" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/js/cf-api" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/js/cf-webapp" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/js/common" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/cli" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/django/aiservice/tests" isTestSource="true" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.aider.ident.cache.v1" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.aider.tags.cache.v1" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.mypy_cache" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.pytest_cache" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/cli/dist" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/.aider.tags.cache.v3" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/js/cf-api/node_modules" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/js/cf-webapp/node_modules" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/js/common/node_modules" />
|
|
||||||
<excludeFolder url="file://$MODULE_DIR$/cli/.venv" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="jdk" jdkName="uv (codeflash-internal)" jdkType="Python SDK" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
<orderEntry type="module" module-name="langchain" />
|
|
||||||
</component>
|
|
||||||
<component name="PackageRequirementsSettings">
|
|
||||||
<option name="requirementsPath" value="" />
|
|
||||||
</component>
|
|
||||||
<component name="TemplatesService">
|
|
||||||
<option name="TEMPLATE_CONFIGURATION" value="Django" />
|
|
||||||
</component>
|
|
||||||
<component name="TestRunnerService">
|
|
||||||
<option name="PROJECT_TEST_RUNNER" value="py.test" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
|
|
@ -280,8 +280,8 @@ def validate_javascript_testgen_request_data(data: TestGenSchema) -> None:
|
||||||
HttpError: If validation fails
|
HttpError: If validation fails
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if data.test_framework not in ["jest", "mocha"]:
|
if data.test_framework not in ["jest"]:
|
||||||
raise HttpError(400, "Invalid test framework for JavaScript/TypeScript. We only support jest and mocha.")
|
raise HttpError(400, "Invalid test framework for JavaScript/TypeScript. We only support jest.")
|
||||||
if not data.function_to_optimize:
|
if not data.function_to_optimize:
|
||||||
raise HttpError(400, "Invalid function to optimize. It is empty.")
|
raise HttpError(400, "Invalid function to optimize. It is empty.")
|
||||||
if not validate_trace_id(data.trace_id):
|
if not validate_trace_id(data.trace_id):
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ class TestGenSchema(Schema):
|
||||||
dependent_function_names: list[str] | None = None # Only for backwards compatibility
|
dependent_function_names: list[str] | None = None # Only for backwards compatibility
|
||||||
module_path: str
|
module_path: str
|
||||||
test_module_path: str
|
test_module_path: str
|
||||||
test_framework: str # "pytest", "unittest", "jest", "mocha"
|
test_framework: str # "pytest", "jest"
|
||||||
test_timeout: int
|
test_timeout: int
|
||||||
trace_id: str
|
trace_id: str
|
||||||
python_version: str | None = None # Made optional for multi-language support
|
python_version: str | None = None # Made optional for multi-language support
|
||||||
|
|
|
||||||
|
|
@ -465,15 +465,9 @@ async def testgen(
|
||||||
request: AuthenticatedRequest, data: TestGenSchema
|
request: AuthenticatedRequest, data: TestGenSchema
|
||||||
) -> tuple[int, TestGenResponseSchema | TestGenErrorResponseSchema]:
|
) -> tuple[int, TestGenResponseSchema | TestGenErrorResponseSchema]:
|
||||||
# Route based on language
|
# Route based on language
|
||||||
logging.warning(
|
|
||||||
f"[TESTGEN DEBUG] Received request with language='{data.language}', framework='{data.test_framework}'"
|
|
||||||
)
|
|
||||||
if data.language in ("javascript", "typescript"):
|
if data.language in ("javascript", "typescript"):
|
||||||
logging.warning("[TESTGEN DEBUG] Routing to testgen_javascript")
|
|
||||||
return await testgen_javascript(request, data)
|
return await testgen_javascript(request, data)
|
||||||
|
|
||||||
# Default: Python test generation
|
# Default: Python test generation
|
||||||
logging.warning("[TESTGEN DEBUG] Routing to testgen_python")
|
|
||||||
return await testgen_python(request, data)
|
return await testgen_python(request, data)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue