Closed iejzh closed 2 weeks ago
@iejzh I'm not seeing this issue on main
anymore. Are you still seeing this?
@EmbeddedDevops1 Yes, I can still see this issue.
How can I replicate it? Can you share the full command that you ran?
The commands are as follows:
cover-agent \
--source-file-path "templated_tests/python_fastapi/app.py" \
--test-file-path "templated_tests/python_fastapi/test_app.py" \
--code-coverage-report-path "templated_tests/python_fastapi/coverage.xml" \
--test-command "pytest --cov=. --cov-report=xml --cov-report=term" \
--test-command-dir "templated_tests/python_fastapi" \
--coverage-type "cobertura" \
--desired-coverage 70 \
--max-iterations 10
The days of cover_agent.UnitTestGenerator are printed twice in the console output: 2024-06-03 14:24:28,452 - cover_agent.UnitTestGenerator - INFO - Running build/test command to generate coverage report: "pytest --cov=. --cov-report=xml --cov-report=term" INFO:cover_agent.UnitTestGenerator:Running build/test command to generate coverage report: "pytest --cov=. --cov-report=xml --cov-report=term"
@iejzh I was able to reproduce this but only by importing Cover agent from an installed pip package and running it against a completely different repo in debug mode using VSCode (that also has a custom logger class). Otherwise, I can't see the log duplication.
What's your environment set up? You ran this command straight after installing the pip package?
cover-agent \
--source-file-path "templated_tests/python_fastapi/app.py" \
--test-file-path "templated_tests/python_fastapi/test_app.py" \
--code-coverage-report-path "templated_tests/python_fastapi/coverage.xml" \
--test-command "pytest --cov=. --cov-report=xml --cov-report=term" \
--test-command-dir "templated_tests/python_fastapi" \
--coverage-type "cobertura" \
--desired-coverage 70 \
--max-iterations 10
The UnitTestGenerator logs twice, a detailed log with timestamps and an abbreviated log without timestamps.