fix: add missing stream parameter to autogen_mcp run_eval fixture #47
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Agent Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| checks: write | |
| concurrency: | |
| group: agent-tests-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Check for agent changes | |
| id: changes | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| base_ref="origin/${{ github.event.pull_request.base.ref }}" | |
| if git diff --name-only "${base_ref}...HEAD" | grep -q '^agents/'; then | |
| echo "agents=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| else | |
| echo "agents=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Setup Python | |
| if: steps.changes.outputs.agents == 'true' | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.12" | |
| - name: Install uv | |
| if: steps.changes.outputs.agents == 'true' | |
| uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7.6.0 | |
| - name: Run tests | |
| if: steps.changes.outputs.agents == 'true' | |
| id: run-tests | |
| run: | | |
| # Discover agent dirs containing unit-test files | |
| discovered=$(find agents/*/*/tests -maxdepth 1 -name 'test_*.py' -type f 2>/dev/null \ | |
| | cut -d'/' -f1-3 | sort -u) | |
| # On PRs, filter to only agents with changed files | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| base_ref="origin/${{ github.event.pull_request.base.ref }}" | |
| changed_files=$(git diff --name-only "${base_ref}...HEAD") | |
| filtered="" | |
| while IFS= read -r agent_dir; do | |
| [ -z "$agent_dir" ] && continue | |
| if echo "$changed_files" | grep -q "^${agent_dir}/"; then | |
| filtered="${filtered}${filtered:+$'\n'}${agent_dir}" | |
| fi | |
| done <<< "$discovered" | |
| discovered="$filtered" | |
| fi | |
| count=$(echo "$discovered" | grep -c '[^[:space:]]' || true) | |
| if [ "$count" -eq 0 ]; then | |
| echo "No testable agents found (or none changed). Skipping." | |
| exit 0 | |
| fi | |
| echo "Running tests for ${count} agents" | |
| mkdir -p test-results | |
| failed=0 | |
| while IFS= read -r agent_dir; do | |
| [ -z "$agent_dir" ] && continue | |
| name=$(echo "$agent_dir" | sed 's|agents/||; s|/|-|g') | |
| echo "" | |
| echo "::group::${name}" | |
| echo "=== Testing ${agent_dir} ===" | |
| if make -C "$agent_dir" test PYTEST_ARGS="--junitxml=$(pwd)/test-results/${name}.xml -v --tb=short"; then | |
| echo "✓ ${name} passed" | |
| else | |
| echo "✗ ${name} failed" | |
| failed=1 | |
| fi | |
| echo "::endgroup::" | |
| done <<< "$discovered" | |
| exit "$failed" | |
| - name: Publish test report | |
| if: always() && steps.run-tests.outcome != 'skipped' | |
| uses: mikepenz/action-junit-report@bccf2e31636835cf0874589931c4116687171386 # v6.4.0 | |
| with: | |
| report_paths: test-results/*.xml | |
| check_name: Agent Test Results | |
| include_passed: true | |
| annotate_only: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }} |