Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion .github/workflows/test-finder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- Include a descriptive test name that explains what is being tested
EOF

goose run -i /tmp/create_working_test.txt
goose run -i /tmp/create_working_test.txt --with-builtin developer --path /tmp/goose-home/.local/share/goose/sessions/test_generation.jsonl

# Check the result
if [ -f /tmp/test_result.txt ]; then
Expand All @@ -101,6 +101,20 @@ jobs:
echo "No result file created"
fi

- name: Extract token metrics
id: metrics
run: |
SESSION_FILE="/tmp/goose-home/.local/share/goose/sessions/test_generation.jsonl"
if [ -f "$SESSION_FILE" ]; then
TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_total_tokens // 0')
INPUT_TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_input_tokens // 0')
OUTPUT_TOKENS=$(head -1 "$SESSION_FILE" | jq -r '.accumulated_output_tokens // 0')
echo "total_tokens=${TOKENS}" >> $GITHUB_OUTPUT
echo "input_tokens=${INPUT_TOKENS}" >> $GITHUB_OUTPUT
echo "output_tokens=${OUTPUT_TOKENS}" >> $GITHUB_OUTPUT
echo "Token usage - Total: ${TOKENS}, Input: ${INPUT_TOKENS}, Output: ${OUTPUT_TOKENS}"
fi

- name: Create Pull Request
if: steps.find_untested.outputs.patch_created == 'true' && github.event.inputs.dry_run != 'true'
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # [email protected]
Expand All @@ -125,6 +139,11 @@ jobs:
- [ ] Test passes locally
- [ ] No unnecessary changes included

### Metrics
- **Total tokens used**: ${{ steps.metrics.outputs.total_tokens }}
- **Input tokens**: ${{ steps.metrics.outputs.input_tokens }}
- **Output tokens**: ${{ steps.metrics.outputs.output_tokens }}

---
*Generated by the Daily Test Coverage Finder workflow*
branch: goose/test-coverage-${{ github.run_number }}
Expand Down
Loading