Skip to content

Commit

Permalink
add source_folder, test_folder input args
Browse files Browse the repository at this point in the history
  • Loading branch information
qododavid committed Jan 29, 2025
1 parent 153f851 commit 7af87eb
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/actions/qodo-cover-pr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ inputs:
description: "Whether the agent should modify the test command to run individual tests"
required: false
default: "true"
source_folder:
description: "Path, relative to project_root, to look for source files. Will ignore source files outside this folder. Defaults to `.`"
required: false
default: "."
test_folder:
description: "Path, relative to project_root, to look for test files. Will ignore test files outside this folder. Defaults to `.`"
required: false
default: "."

runs:
using: "composite"
Expand All @@ -60,6 +68,8 @@ runs:
--max-iterations "${{ inputs.max_iterations }}" \
--desired-coverage "${{ inputs.desired_coverage }}" \
--run-each-test-separately "${{ inputs.run_each_test_separately }}" \
--source-folder "${{ inputs.source_folder }}" \
--test-folder "${{ inputs.test_folder }}" \
--action-path "${{ github.action_path }}" \
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/qodo-cover-pr/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ while [[ "$#" -gt 0 ]]; do
--max-iterations) MAX_ITERATIONS="$2"; shift ;;
--desired-coverage) DESIRED_COVERAGE="$2"; shift ;;
--run-each-test-separately) RUN_EACH_TEST_SEPARATELY="$2"; shift ;;
--source-folder) SOURCE_FOLDER="$2"; shift ;;
--test-folder) TEST_FOLDER="$2"; shift ;;
--action-path) ACTION_PATH="$2"; shift ;;
*) echo "Unknown parameter: $1"; exit 1 ;;
esac
Expand Down Expand Up @@ -92,6 +94,8 @@ fi
--max-iterations "$MAX_ITERATIONS" \
--desired-coverage "$DESIRED_COVERAGE" \
--run-each-test-separately "$RUN_EACH_TEST_SEPARATELY" \
--source-folder "$SOURCE_FOLDER" \
--test-folder "$TEST_FOLDER" \
--report-dir "$REPORT_DIR" \
--modified-files-json "$MODIFIED_FILES_JSON"

Expand Down
10 changes: 10 additions & 0 deletions .github/actions/qodo-cover/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ inputs:
branch:
description: "Branch to run on"
required: true
source_folder:
description: "Path, relative to project_root, to look for source files. Will ignore source files outside this folder. Defaults to `.`"
required: false
default: "."
test_folder:
description: "Path, relative to project_root, to look for test files. Will ignore test files outside this folder. Defaults to `.`"
required: false
default: "."

runs:
using: "composite"
Expand All @@ -62,6 +70,8 @@ runs:
--max-iterations "${{ inputs.max_iterations }}" \
--desired-coverage "${{ inputs.desired_coverage }}" \
--run-each-test-separately "${{ inputs.run_each_test_separately }}" \
--source-folder "${{ inputs.source_folder }}" \
--test-folder "${{ inputs.test_folder }}" \
--action-path "${{ github.action_path }}" \
env:
GITHUB_TOKEN: ${{ inputs.github_token }}
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/qodo-cover/scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ while [[ "$#" -gt 0 ]]; do
--max-iterations) MAX_ITERATIONS="$2"; shift ;;
--desired-coverage) DESIRED_COVERAGE="$2"; shift ;;
--run-each-test-separately) RUN_EACH_TEST_SEPARATELY="$2"; shift ;;
--source-folder) SOURCE_FOLDER="$2"; shift ;;
--test-folder) TEST_FOLDER="$2"; shift ;;
--action-path) ACTION_PATH="$2"; shift ;;
*) echo "Unknown parameter: $1"; exit 1 ;;
esac
Expand Down Expand Up @@ -76,6 +78,8 @@ fi
--max-iterations "$MAX_ITERATIONS" \
--desired-coverage "$DESIRED_COVERAGE" \
--run-each-test-separately "$RUN_EACH_TEST_SEPARATELY" \
--source-folder "$SOURCE_FOLDER" \
--test-folder "$TEST_FOLDER" \
--report-dir "$REPORT_DIR"

# Skip git if in local mode
Expand Down

0 comments on commit 7af87eb

Please sign in to comment.