Codium-ai / cover-agent

CodiumAI Cover-Agent: An AI-Powered Tool for Automated Test Generation and Code Coverage Enhancement! ๐Ÿ’ป๐Ÿค–๐Ÿงช๐Ÿž
https://www.codium.ai/
GNU Affero General Public License v3.0
3.96k stars 262 forks source link

Unable to generate test cases in flutter #92

Open sandeepgurram opened 3 weeks ago

sandeepgurram commented 3 weeks ago

Command

  --source-file-path '/Users/sandeepgurram/Documents/codebase/turing-gorout/gr_ui/common_ui/lib/ui/snackbar/gr_snackbar.dart' \
  --test-file-path '/Users/sandeepgurram/Documents/codebase/turing-gorout/gr_ui/common_ui/test/snackbar/gr_snackbar_test.dart' \
  --code-coverage-report-path '/Users/sandeepgurram/Documents/codebase/turing-gorout/gr_ui/common_ui/coverage/coverage.xml' \
  --test-command "flutter test --coverage" \
  --coverage-type "lcov" 

Error

2024-06-10 02:15:41,128 - cover_agent.UnitTestGenerator - INFO - Running build/test command to generate coverage report: "flutter test --coverage"
2024-06-10 02:15:43,719 - cover_agent.UnitTestGenerator - ERROR - Error in coverage processing: Fatal: The coverage report file was not updated after the test command. file_mod_time_ms: 1717965894440, time_of_test_command: 1717965941128. False
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.11/bin/cover-agent", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cover_agent/main.py", line 94, in main
    agent = CoverAgent(args)
            ^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cover_agent/CoverAgent.py", line 20, in __init__
    self.test_gen = UnitTestGenerator(
                    ^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cover_agent/UnitTestGenerator.py", line 75, in __init__
    self.run_coverage()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cover_agent/UnitTestGenerator.py", line 144, in run_coverage
    coverage_processor.process_coverage_report(
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cover_agent/CoverageProcessor.py", line 49, in process_coverage_report
    self.verify_report_update(time_of_test_command)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/cover_agent/CoverageProcessor.py", line 70, in verify_report_update
    file_mod_time_ms > time_of_test_command
AssertionError: Fatal: The coverage report file was not updated after the test command. file_mod_time_ms: 1717965894440, time_of_test_command: 1717965941128. False
EmbeddedDevops1 commented 3 weeks ago

Lcov is currently not supported. Feel free to iether use Cobertura or propose a new PR using docs/Add_New_Coverage_Type_Instructions.md as a guideline.