Spaces:
Sleeping
Sleeping
Update definitions.py
Browse files- definitions.py +10 -8
definitions.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import platform
|
|
|
2 |
import psutil
|
3 |
from typing import List, Dict, Optional, Any, Tuple
|
4 |
from dataclasses import dataclass
|
@@ -531,30 +532,27 @@ if __name__ == "__main__":
|
|
531 |
try:
|
532 |
# Generate tests
|
533 |
test_generation = await self.tool_manager.execute_tool(
|
534 |
-
"test_generator",
|
535 |
-
context.get("generated_code", "")
|
536 |
)
|
537 |
|
538 |
# Run tests
|
539 |
test_results = await self.tool_manager.execute_tool(
|
540 |
-
"test_runner",
|
541 |
-
test_generation["result"]
|
542 |
)
|
543 |
|
544 |
# Generate coverage report
|
545 |
coverage_report = await self.tool_manager.execute_tool(
|
546 |
-
"coverage_analyzer",
|
547 |
-
test_results["result"]
|
548 |
)
|
549 |
|
550 |
return {
|
551 |
"test_cases": test_generation["result"],
|
552 |
"test_results": test_results["result"],
|
|
|
553 |
}
|
554 |
except Exception as e:
|
555 |
raise Exception(f"Testing stage failed: {str(e)}")
|
556 |
|
557 |
-
|
558 |
def _validate_stage_output(self, stage: PipelineStage, result: Dict[str, Any]):
|
559 |
"""Validate stage output against defined criteria"""
|
560 |
validation_rules = self._get_validation_rules(stage)
|
@@ -1259,6 +1257,10 @@ if __name__ == "__main__":
|
|
1259 |
st.write(f"Available Memory: {psutil.virtual_memory().available / (1024**3):.1f} GB free")
|
1260 |
|
1261 |
|
|
|
|
|
|
|
|
|
|
|
1262 |
if __name__ == "__main__":
|
1263 |
-
import streamlit as st
|
1264 |
main()
|
|
|
1 |
import platform
|
2 |
+
import streamlit as st
|
3 |
import psutil
|
4 |
from typing import List, Dict, Optional, Any, Tuple
|
5 |
from dataclasses import dataclass
|
|
|
532 |
try:
|
533 |
# Generate tests
|
534 |
test_generation = await self.tool_manager.execute_tool(
|
535 |
+
"test_generator", context.get("generated_code", "")
|
|
|
536 |
)
|
537 |
|
538 |
# Run tests
|
539 |
test_results = await self.tool_manager.execute_tool(
|
540 |
+
"test_runner", test_generation["result"]
|
|
|
541 |
)
|
542 |
|
543 |
# Generate coverage report
|
544 |
coverage_report = await self.tool_manager.execute_tool(
|
545 |
+
"coverage_analyzer", test_results["result"]
|
|
|
546 |
)
|
547 |
|
548 |
return {
|
549 |
"test_cases": test_generation["result"],
|
550 |
"test_results": test_results["result"],
|
551 |
+
"coverage_report": coverage_report["result"]
|
552 |
}
|
553 |
except Exception as e:
|
554 |
raise Exception(f"Testing stage failed: {str(e)}")
|
555 |
|
|
|
556 |
def _validate_stage_output(self, stage: PipelineStage, result: Dict[str, Any]):
|
557 |
"""Validate stage output against defined criteria"""
|
558 |
validation_rules = self._get_validation_rules(stage)
|
|
|
1257 |
st.write(f"Available Memory: {psutil.virtual_memory().available / (1024**3):.1f} GB free")
|
1258 |
|
1259 |
|
1260 |
+
# Main entry point defined
|
1261 |
+
def main():
|
1262 |
+
app = AutonomousAgentApp()
|
1263 |
+
app.run()
|
1264 |
+
|
1265 |
if __name__ == "__main__":
|
|
|
1266 |
main()
|