Skip to content

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ΒΆ

# Install all dependencies for API and client (Yarn workspaces)
yarn install

Step 3: Start PostgreSQL DatabaseΒΆ

# Start PostgreSQL using the convenient script
yarn db

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 server token (or use simple values for testing)
SERVER_TOKEN=$(openssl rand -base64 12 | tr -d '=+/')

# Display tokens (save these!)
echo "Your SERVER_TOKEN (for CS2 servers): $SERVER_TOKEN"

# Export environment variables
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 values:

export SERVER_TOKEN=server123

Step 5: Start Development ServerΒΆ

# Start both backend and frontend in development mode
yarn dev

This will start:

  • Backend API: http://localhost:3000
  • Frontend: http://localhost:5173

Access the application at: http://localhost:5173 and sign in with Steam/SSO from the login page.

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:

export FRONTEND_BASE_URL=http://localhost:5173
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 need FRONTEND_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
SERVER_TOKEN=$(openssl rand -base64 12 | tr -d '=+/' )

# Display tokens
echo "Your SERVER_TOKEN (for CS2 servers): $SERVER_TOKEN"

# Export them
export SERVER_TOKEN

# Optional: Override database defaults
export DB_USER=postgres
export DB_PASSWORD=postgres
export DB_NAME=matchzy_tournament

Quick testing option:

export SERVER_TOKEN=server123

Step 3: Build and Start with Docker ComposeΒΆ

# Build and start all services
docker compose -f docker/docker-compose.local.yml up -d --build

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ΒΆ

  1. Navigate to http://localhost:5173 (local dev) or http://localhost:3069 (Docker)
  2. Click "Login" (top right)
  3. Click Sign in with Steam (or another configured SSO provider). The first Steam login will become an admin automatically.

2. Navigate to Maps PageΒΆ

  1. Click "Maps" in the sidebar navigation
  2. You should see two tabs: "Maps" and "Map Pools"

3. Test Maps TabΒΆ

Add a New Map:

  1. Click "Add Map" button
  2. Fill in:
  3. Map ID: de_testmap (lowercase, numbers, underscores only)
  4. Display Name: Test Map
  5. Optionally upload an image or click "Fetch from GitHub"
  6. Click "Create"
  7. Verify the map appears in the list

Edit a Map:

  1. Click on any map card
  2. Click "Edit" in the actions modal
  3. Change the display name
  4. Click "Update"
  5. Verify changes are saved

Delete a Map:

  1. Click on a map card
  2. Click "Delete" in the actions modal
  3. Confirm deletion
  4. Verify map is removed

4. Test Map Pools TabΒΆ

Create a Map Pool:

  1. Switch to "Map Pools" tab
  2. Click "Create Map Pool" button
  3. Fill in:
  4. Map Pool Name: My Test Pool
  5. Select maps from the autocomplete dropdown
  6. Click "Create"
  7. Verify the pool appears in the list

Edit a Map Pool:

  1. Click on a map pool card
  2. Click "Edit" in the actions modal
  3. Add or remove maps
  4. Click "Update"
  5. Verify changes are saved

Delete a Map Pool:

  1. Click on a map pool card
  2. Click "Delete" in the actions modal
  3. Confirm deletion
  4. Verify pool is removed

5. Test Tournament IntegrationΒΆ

Create a Tournament with Map Pool:

  1. Navigate to "Tournament" page
  2. Click "Create Tournament" or edit existing tournament
  3. Fill in tournament details
  4. In Step 3: Map Pool, you should see:
  5. Dropdown with "Active Duty" option
  6. Any custom pools you created
  7. "Custom" option
  8. Select "Active Duty" or a custom pool
  9. If selecting "Custom":
  10. Select maps from autocomplete
  11. Click "Save Map Pool" to create a new pool
  12. Complete tournament creation
  13. Verify map pool is saved with tournament

Test Map Pool Validation:

  1. Create a tournament with BO1, BO3, or BO5 format
  2. Select a map pool with β‰  7 maps
  3. Verify warning message appears: "Map veto requires exactly 7 maps"
  4. Create a pool with exactly 7 maps
  5. 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:

  1. Check existing issues: Search GitHub Issues to see if it's already reported
  2. Create new issue: If not found, create a new issue with:
  3. Clear description of the problem
  4. Steps to reproduce
  5. Expected vs actual behavior
  6. Screenshots if applicable
  7. 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:

git checkout main
git branch -D pr-11-customizable-map-pool  # Remove local PR branch

Additional ResourcesΒΆ


Questions?ΒΆ

If you have questions about testing or need help:

Thank you for testing! πŸŽ‰