Testing Pull Requests¶
Guide for testing pull requests, specifically for the Customizable Map Pool feature (PR #11, Issue #10).
Prerequisites¶
Before testing, ensure you have:
- Git installed
- Node.js 18+ (for local development) OR Docker & Docker Compose (for Docker setup)
- PostgreSQL (can be run via Docker)
- A GitHub account with access to the repository
Option 1: Local Development Setup¶
Step 1: Clone and Checkout PR Branch¶
# Clone the repository
git clone https://github.com/sivert-io/matchzy-auto-tournament.git
cd matchzy-auto-tournament
# Fetch the PR branch
git fetch origin pull/11/head:pr-11-customizable-map-pool
# Switch to the PR branch
git checkout pr-11-customizable-map-pool
Alternative: If you already have the repository cloned:
cd matchzy-auto-tournament
# Fetch latest changes
git fetch origin
# Checkout the PR branch
git checkout feature/10-feature-customizable-map-pool
Step 2: Install Dependencies¶
Step 3: Start PostgreSQL Database¶
This will:
- Create a PostgreSQL container if it doesn't exist
- Start the container
- Use default credentials:
postgres/postgres
Manual PostgreSQL setup (if preferred):
docker run -d --name matchzy-postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=matchzy_tournament \
-p 5432:5432 \
postgres:16-alpine
Step 4: Set Environment Variables¶
# Generate tokens (or use simple passwords for testing)
API_TOKEN=$(openssl rand -base64 12 | tr -d '=+/')
SERVER_TOKEN=$(openssl rand -base64 12 | tr -d '=+/')
# Display tokens (save these!)
echo "Your API_TOKEN (admin password): $API_TOKEN"
echo "Your SERVER_TOKEN (for CS2 servers): $SERVER_TOKEN"
# Export environment variables
export API_TOKEN
export SERVER_TOKEN
export DB_HOST=localhost
export DB_PORT=5432
export DB_USER=postgres
export DB_PASSWORD=postgres
export DB_NAME=matchzy_tournament
Note: For quick testing, you can use simple passwords:
Step 5: Start Development Server¶
This will start:
- Backend API:
http://localhost:3000 - Frontend:
http://localhost:5173
Access the application at: http://localhost:5173
Steam login in local development¶
When you use Login with Steam in local dev, Steam is redirected back to the API on port 3000,
and the API then redirects the browser to the frontend.
For Yarn dev (API on 3000, Vite on 5173), set a frontend base URL before starting yarn dev:
The Steam callback will then redirect to:
http://localhost:5173/player/<steamId>
Note: Docker stacks already run behind Caddy on a single port (typically
3069), so they do not needFRONTEND_BASE_URL– the default redirect host works there.
Option 2: Docker Compose Setup¶
Step 1: Clone and Checkout PR Branch¶
# Clone the repository
git clone https://github.com/sivert-io/matchzy-auto-tournament.git
cd matchzy-auto-tournament
# Fetch and checkout the PR branch
git fetch origin pull/11/head:pr-11-customizable-map-pool
git checkout pr-11-customizable-map-pool
Step 2: Set Environment Variables¶
# Generate tokens
API_TOKEN=$(openssl rand -base64 12 | tr -d '=+/')
SERVER_TOKEN=$(openssl rand -base64 12 | tr -d '=+/')
# Display tokens
echo "Your API_TOKEN (admin password): $API_TOKEN"
echo "Your SERVER_TOKEN (for CS2 servers): $SERVER_TOKEN"
# Export them
export API_TOKEN
export SERVER_TOKEN
# Optional: Override database defaults
export DB_USER=postgres
export DB_PASSWORD=postgres
export DB_NAME=matchzy_tournament
Quick testing option:
Step 3: Build and Start with Docker Compose¶
This will:
- Build the application from source
- Start PostgreSQL
- Start the MatchZy Tournament API
- Serve everything on port 3069
Access the application at: http://localhost:3069
Step 4: View Logs (Optional)¶
# View all logs
docker compose -f docker/docker-compose.local.yml logs -f
# View only API logs
docker compose -f docker/docker-compose.local.yml logs -f matchzy-tournament
Testing the Map Pool Feature¶
1. Login¶
- Navigate to
http://localhost:5173(local dev) orhttp://localhost:3069(Docker) - Click "Login" (top right)
- Enter your
API_TOKEN(the password you set above)
2. Navigate to Maps Page¶
- Click "Maps" in the sidebar navigation
- You should see two tabs: "Maps" and "Map Pools"
3. Test Maps Tab¶
Add a New Map:
- Click "Add Map" button
- Fill in:
- Map ID:
de_testmap(lowercase, numbers, underscores only) - Display Name:
Test Map - Optionally upload an image or click "Fetch from GitHub"
- Click "Create"
- Verify the map appears in the list
Edit a Map:
- Click on any map card
- Click "Edit" in the actions modal
- Change the display name
- Click "Update"
- Verify changes are saved
Delete a Map:
- Click on a map card
- Click "Delete" in the actions modal
- Confirm deletion
- Verify map is removed
4. Test Map Pools Tab¶
Create a Map Pool:
- Switch to "Map Pools" tab
- Click "Create Map Pool" button
- Fill in:
- Map Pool Name:
My Test Pool - Select maps from the autocomplete dropdown
- Click "Create"
- Verify the pool appears in the list
Edit a Map Pool:
- Click on a map pool card
- Click "Edit" in the actions modal
- Add or remove maps
- Click "Update"
- Verify changes are saved
Delete a Map Pool:
- Click on a map pool card
- Click "Delete" in the actions modal
- Confirm deletion
- Verify pool is removed
5. Test Tournament Integration¶
Create a Tournament with Map Pool:
- Navigate to "Tournament" page
- Click "Create Tournament" or edit existing tournament
- Fill in tournament details
- In Step 3: Map Pool, you should see:
- Dropdown with "Active Duty" option
- Any custom pools you created
- "Custom" option
- Select "Active Duty" or a custom pool
- If selecting "Custom":
- Select maps from autocomplete
- Click "Save Map Pool" to create a new pool
- Complete tournament creation
- Verify map pool is saved with tournament
Test Map Pool Validation:
- Create a tournament with BO1, BO3, or BO5 format
- Select a map pool with ≠ 7 maps
- Verify warning message appears: "Map veto requires exactly 7 maps"
- Create a pool with exactly 7 maps
- Verify no warning appears
What to Test¶
✅ Core Functionality¶
- Can add new maps with Map ID and display name
- Can edit map display name and image
- Can delete maps
- Can create map pools with multiple maps
- Can edit map pools (add/remove maps)
- Can delete map pools
- Map pools appear in tournament creation dropdown
- Can select Active Duty pool in tournament
- Can select custom pools in tournament
- Can create custom selection during tournament creation
- Map pool validation works (7 maps required for veto formats)
✅ UI/UX¶
- Maps page loads correctly
- Tabs switch between Maps and Map Pools
- Map cards display correctly (with/without images)
- Map pool cards show map count and preview chips
- Modals open and close correctly
- Form validation works (required fields, Map ID format)
- Error messages display correctly
- Success feedback appears after actions
✅ Edge Cases¶
- Cannot create map with invalid Map ID format (uppercase, special chars)
- Cannot create map pool without selecting maps
- Cannot create map pool without name
- Warning appears when pool has ≠ 7 maps for veto formats
- Can delete map that's in use (should handle gracefully)
- Can delete map pool that's in use (should handle gracefully)
Reporting Issues¶
If you find any bugs or issues while testing:
- Check existing issues: Search GitHub Issues to see if it's already reported
- Create new issue: If not found, create a new issue with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Screenshots if applicable
- Browser/OS information
Issue Template:
## Bug Report
**Description:**
[Clear description of the issue]
**Steps to Reproduce:**
1. [Step 1]
2. [Step 2]
3. [Step 3]
**Expected Behavior:**
[What should happen]
**Actual Behavior:**
[What actually happens]
**Environment:**
- OS: [e.g., macOS 14.0]
- Browser: [e.g., Chrome 120]
- Setup: [Local Dev / Docker]
- Branch: `feature/10-feature-customizable-map-pool`
**Screenshots:**
[If applicable]
Cleanup¶
After testing, you can clean up:
Local Development:
# Stop development server (Ctrl+C)
# Stop PostgreSQL
yarn db:stop
# Or remove PostgreSQL container
yarn db:remove
Docker Compose:
# Stop and remove containers
docker compose -f docker/docker-compose.local.yml down
# Remove volumes (deletes database data)
docker compose -f docker/docker-compose.local.yml down -v
Switch back to main branch:
Additional Resources¶
- Managing Maps Guide - Complete documentation for maps and map pools
- First Tournament Guide - Step-by-step tournament setup
- Troubleshooting Guide - Common issues and solutions
Questions?¶
If you have questions about testing or need help:
- Open a GitHub Discussion
- Comment on PR #11
- Check the documentation
Thank you for testing! 🎉