Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log Duplication #53

Closed
iejzh opened this issue May 27, 2024 · 5 comments
Closed

Log Duplication #53

iejzh opened this issue May 27, 2024 · 5 comments
Assignees

Comments

@iejzh
Copy link

iejzh commented May 27, 2024

The UnitTestGenerator logs twice, a detailed log with timestamps and an abbreviated log without timestamps.
截屏2024-05-27 10 57 56

@EmbeddedDevops1
Copy link
Collaborator

@iejzh I'm not seeing this issue on main anymore. Are you still seeing this?

@iejzh
Copy link
Author

iejzh commented Jun 3, 2024

@EmbeddedDevops1 Yes, I can still see this issue.

@EmbeddedDevops1
Copy link
Collaborator

How can I replicate it? Can you share the full command that you ran?

@iejzh
Copy link
Author

iejzh commented Jun 3, 2024

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"

@EmbeddedDevops1 EmbeddedDevops1 self-assigned this Jun 14, 2024
@EmbeddedDevops1
Copy link
Collaborator

EmbeddedDevops1 commented Jul 8, 2024

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants