Skip to content

Conversation

@andsimakov
Copy link
Contributor

@andsimakov andsimakov commented May 27, 2025

PR Type

Enhancement


Description

  • Added --max-run-time-sec argument support to test_with_docker.sh

  • Passed --max-run-time-sec from integration test script

  • Updated command construction to include max run time


Changes walkthrough 📝

Relevant files
Enhancement
test_with_docker.sh
Add and handle --max-run-time-sec argument in test_with_docker.sh

tests_integration/test_with_docker.sh

  • Introduced MAX_RUN_TIME_SEC variable with default value
  • Parsed --max-run-time-sec argument in CLI options
  • Appended --max-run-time-sec to agent command if set
  • +6/-0     
    test_all.sh
    Pass max run time argument to test_with_docker.sh               

    tests_integration/test_all.sh

    • Passed --max-run-time-sec 240 to test_with_docker.sh invocation
    +1/-0     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • @qodo-free-for-open-source-projects

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ No major issues detected

    @qodo-free-for-open-source-projects
    Copy link

    qodo-free-for-open-source-projects bot commented May 27, 2025

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Fix conditional logic

    The condition checks if MAX_RUN_TIME_SEC is non-empty, but the variable is
    initialized with a default value of 30, so it will always be non-empty. You
    should check if it's non-zero or different from the default value instead.

    tests_integration/test_with_docker.sh [120-122]

    -if [ -n "$MAX_RUN_TIME_SEC" ]; then
    +if [ "$MAX_RUN_TIME_SEC" != "30" ]; then
       COMMAND="$COMMAND --max-run-time-sec $MAX_RUN_TIME_SEC"
     fi
    • Apply / Chat
    Suggestion importance[1-10]: 7

    __

    Why: The suggestion correctly identifies a logical flaw where MAX_RUN_TIME_SEC is always non-empty due to the default value, causing --max-run-time-sec 30 to always be added even when not specified by the user. The proposed fix appropriately only adds the parameter when it differs from the default.

    Medium
    • Update

    @andsimakov andsimakov changed the title Freature-339: Accept --max-run-time-sec in test_with_docker.sh Feature-339: Accept --max-run-time-sec in test_with_docker.sh May 27, 2025
    self.logger.info(
    f"Reached above target coverage of {desired_coverage}% "
    f"(Current Coverage: {current_coverage}%) in {iteration_count} iterations."
    f"(Current Coverage: {current_coverage}%) in {iteration_count + 1} iterations."
    Copy link
    Contributor Author

    @andsimakov andsimakov May 27, 2025

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    This fixes a situation where the desired coverage is reached during the first iteration, but it appears as if it was reached in 0 iterations.

    from pathlib import Path
    from typing import AsyncIterator, List, Tuple, Optional
    from cover_agent.AICaller import AICaller
    from cover_agent.ai_caller import AICaller
    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Fix after an unintentional rollback.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Projects

    None yet

    Development

    Successfully merging this pull request may close these issues.

    1 participant