Docker Compose Testing Guide
π³ Complete Testing Workflow
This guide shows you how to test your plugin build artifacts using the Docker Compose setup, ensuring everything works before deployment.
π― Quick Start Testing
1. Full Test Cycle
# Clean build and test everything
npm run build
docker compose down
docker compose up -d
2. Access Testing Environment
- Grafana: http://localhost:3001 (admin/admin)
- Prometheus: http://localhost:9090
- Blackbox Exporter: http://localhost:9115
π§ͺ Detailed Testing Steps
Step 1: Build and Prepare
# 1. Clean previous builds
rm -rf dist/
rm -f *.zip
# 2. Install dependencies (if needed)
npm install
# 3. Run quality checks
npm run typecheck
npm run lint
# 4. Build the plugin
npm run build
# 5. Verify build output
ls -la dist/
Expected output:
dist/
βββ CHANGELOG.md
βββ LICENSE
βββ README.md
βββ module.js # Main plugin file
βββ module.js.map # Source map
βββ plugin.json # Plugin metadata
βββ img/ # Assets
Step 2: Start Test Environment
# Stop any existing containers
docker compose down
# Start fresh environment
docker compose up -d
# Check all services are running
docker compose ps
Expected services:
- β grafana (port 3001)
- β prometheus (port 9090)
- β blackbox-exporter (port 9115)
Step 3: Verify Services
# Test Prometheus
curl http://localhost:9090/-/healthy
# Expected: Prometheus is Healthy.
# Test Blackbox Exporter
curl http://localhost:9115/
# Expected: HTML page loads
# Test Grafana
curl http://localhost:3001/api/health
# Expected: {"database":"ok","version":"..."}
Step 4: Plugin Testing in Grafana
4.1 Login to Grafana
- Open: http://localhost:3001
- Login: admin/admin
- Change password if prompted
4.2 Verify Plugin Installation
- Go to: Configuration β Plugins
- Find: βMinimal Status Panelβ
- Status: Should be βEnabledβ
4.3 Create Test Dashboard
- Click: + β Dashboard
- Click: Add visualization
- Select: Prometheus data source
- Select: Minimal Status Panel visualization
4.4 Test Basic Query
probe_success
Expected Results:
- β Panel loads without errors
- β Shows service status data
- β Displays google.com, github.com, prometheus
- β Heartbeat bars are visible and interactive
Step 5: Advanced Testing
5.1 Test All Display Modes
# In panel options, test:
- Display Mode: List, Grid, Compact
- Display Level: Ultra-minimal, Minimal, Full
5.2 Test Custom Names
{
"https://google.com": "Google Search",
"https://github.com": "GitHub",
"http://prometheus:9090": "Prometheus"
}
5.3 Test Different Queries
# Specific services
probe_success{instance="https://google.com"}
# With response time
{__name__=~"probe_success|probe_duration_seconds"}
# Filtered by job
probe_success{job="blackbox"}
Step 6: Performance Testing
6.1 Load Testing
- Set Max Items to 100
- Set Refresh Interval to 5 seconds
- Monitor browser performance
- Check for memory leaks
6.2 Error Handling
# Test invalid query
invalid_metric_name
# Test no results
probe_success{instance="nonexistent"}
π Troubleshooting
Plugin Not Loading
# Check Grafana logs
docker compose logs grafana
# Common issues:
- plugin.json syntax errors
- Missing module.js
- Permission issues with mounted volume
No Data Showing
# Check Prometheus targets
curl http://localhost:9090/api/v1/targets
# Check if blackbox exporter is working
curl "http://localhost:9115/probe?target=https://google.com&module=http_2xx"
Services Not Responding
# Restart all services
docker compose restart
# Check service health
docker compose ps
docker compose logs [service-name]
π§½ Testing Checklist
Build Quality
- β TypeScript compiles without errors
- β ESLint passes without warnings
- β Unit tests pass
- β Build produces expected artifacts
Container Environment
- β All services start successfully
- β Prometheus scrapes targets
- β Blackbox exporter probes work
- β Grafana connects to Prometheus
Plugin Functionality
- β Plugin appears in visualization list
- β Panel loads with basic query
- β All display modes work
- β All display levels work
- β Custom names work
- β Error handling works
User Experience
- β Interface is responsive
- β Animations are smooth
- β No console errors
- β Performance is acceptable
π Cleanup
# Stop and remove containers
docker compose down
# Remove volumes (if needed)
docker compose down -v
# Clean build artifacts
npm run clean
π Success Criteria
Your plugin is ready for release when:
- β All automated tests pass
- β Plugin loads in Grafana without errors
- β Basic functionality works with real data
- β All display modes render correctly
- β Configuration options work as expected
- β Error scenarios are handled gracefully
- β Performance is acceptable under load
- β No memory leaks detected
Ready to release! π