# Test PR

Test pull requests with comprehensive validation and generate structured test results

- Repository: https://github.com/GetBindu/Bindu (10015 stars)
- Category: Testing
- License: see repository
- Last updated: 2026-09-06
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add GetBindu/Bindu --skill test-pr -g -a claude-code -y`
Codex: `npx skills add GetBindu/Bindu --skill test-pr -g -a codex -y`
Cursor: `npx skills add GetBindu/Bindu --skill test-pr -g -a cursor -y`
Gemini CLI: `npx skills add GetBindu/Bindu --skill test-pr -g -a gemini-cli -y`

## Description

Test pull requests with comprehensive validation and generate structured test results

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Test PR Skill

## Overview

Test a pull request to ensure code quality, functionality, and compatibility before merging.

## Inputs

- PR number or URL
- Optional: specific test patterns to run

## Safety

- Never modify code in this skill
- Only read and test
- Generate artifacts in `.local/` directory
- Do not push changes

## Execution Contract

1. Fetch PR metadata
2. Checkout PR branch in isolated worktree
3. Install dependencies
4. Run test suite
5. Run pre-commit hooks
6. Generate structured test results
7. Output recommendation

## Steps

### 1. Initialize PR Testing

```bash
# Get PR metadata
PR_NUMBER=$1
gh pr view $PR_NUMBER --json number,title,author,headRefName,baseRefName > .local/pr-meta.json

# Create isolated worktree
git worktree add .worktrees/pr-$PR_NUMBER origin/main
cd .worktrees/pr-$PR_NUMBER

# Fetch PR branch
git fetch origin pull/$PR_NUMBER/head:pr-$PR_NUMBER
git checkout pr-$PR_NUMBER
```

### 2. Install Dependencies

```bash
# Install with frozen lockfile
uv sync --frozen

# Verify installation
uv run python -c "import bindu; print(bindu.__version__)"
```

### 3. Run Test Suite

```bash
# Run all tests with coverage
uv run pytest --cov=bindu --cov-report=json --json-report --json-report-file=.local/test-results.json

# Extract coverage percentage
COVERAGE=$(jq -r '.totals.percent_covered' coverage.json)
echo "Coverage: $COVERAGE%"
```

### 4. Run Pre-Commit Hooks

```bash
# Run all hooks
uv run pre-commit run --all-files > .local/precommit-results.txt 2>&1

# Check exit code
if [ $? -eq 0 ]; then
    echo "✅ All pre-commit hooks passed"
else
    echo "❌ Some pre-commit hooks failed"
fi
```

### 5. Check for Common Issues

```bash
# Check for print statements (should use logger)
grep -r "print(" bindu/ --include="*.py" | grep -v "# noqa" || echo "✅ No print statements"

# Check for TODO comments
grep -r "TODO\|FIXME\|XXX" bindu/ --include="*.py" || echo "✅ No TODO comments"

The rest: https://github.com/GetBindu/Bindu/blob/HEAD/.agents/skills/test-pr/SKILL.md
