Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Application settings
APP_NAME=JMeter Toolkit
APP_VERSION=2.0.0
DEBUG=false
ENVIRONMENT=production
LOG_LEVEL=INFO
LOG_FILE=
SECRET_KEY=your-secret-key-change-in-production

# Server settings
HOST=0.0.0.0
PORT=8000
RELOAD=false

# Database settings
DATABASE_URL=postgresql://jmeter:jmeter@localhost:5432/jmeter_toolkit
DATABASE_ECHO=false

# Redis settings
REDIS_URL=redis://localhost:6379/0

# Celery settings
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0

# File settings
UPLOAD_MAX_SIZE=104857600 # 100MB
ALLOWED_FILE_EXTENSIONS=[".jmx"]

# JMeter settings
JMETER_VERSION=5.5
JMETER_HOME=/opt/apache-jmeter-5.5
JMETER_MAX_HEAP=2g
JMETER_TIMEOUT=3600

# Security settings
ALLOWED_HOSTS=["*"]
CORS_ORIGINS=["*"]

# Monitoring settings
ENABLE_METRICS=true
METRICS_PORT=9090

# Logging settings
LOG_ROTATION=1 day
LOG_RETENTION=30 days
25 changes: 25 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[flake8]
max-line-length = 127
max-complexity = 10
exclude =
.git,
__pycache__,
venv,
.venv,
htmlcov,
.pytest_cache,
build,
dist,
*.egg-info
ignore =
E203,
E501,
W503,
F401
per-file-ignores =
__init__.py:F401
*/migrations/*:E501,F401
tests/*:E501,F401
select = E,W,F,C
statistics = True
count = True
149 changes: 149 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# GitHub Actions Workflows

This directory contains all the GitHub Actions workflows for the JMeter Toolkit project.

## 🔄 Workflows Overview

### 1. **CI/CD Pipeline** (`ci.yml`)
**Triggers**: Push to main branches, Pull requests
- ✅ **Multi-Python Testing** (3.9, 3.10, 3.11, 3.12)
- 🧪 **Full Test Suite** with coverage reporting
- 🐳 **Docker Build Testing**
- 🔗 **Integration Tests** with PostgreSQL
- 📦 **Deployment Readiness Check**

### 2. **Code Quality** (`code-quality.yml`)
**Triggers**: Push to main branches, Pull requests
- 🔍 **Linting** (flake8, pylint)
- 🎨 **Code Formatting** (black, isort)
- 🏷️ **Type Checking** (mypy)
- 📊 **Complexity Analysis** (radon)
- 🔒 **Dependency Security** (safety, pip-audit)

### 3. **Performance Tests** (`performance.yml`)
**Triggers**: Weekly schedule, Manual trigger, Main branch changes
- ⚡ **Performance Testing**
- 🚛 **Load Testing** (Locust)
- 💾 **Memory Usage Monitoring**
- 📈 **Concurrent Request Testing**

### 4. **Release Management** (`release.yml`)
**Triggers**: Version tags (v*), Manual trigger
- 🏷️ **Automated Release Creation**
- 📦 **Release Package Generation**
- 🐳 **Docker Image Building**
- 📋 **Release Notes Generation**
- 📤 **Asset Upload** (tar.gz, zip, docker)

### 5. **Dependency Updates** (`dependency-update.yml`)
**Triggers**: Weekly schedule, Manual trigger
- 🔄 **Automated Dependency Updates**
- 🔒 **Security Vulnerability Scanning**
- 📝 **Update Report Generation**
- 🔀 **Automated Pull Request Creation**

## 📊 Status Badges

Add these badges to your main README.md:

```markdown
![CI/CD](https://github.com/YOUR_USERNAME/jmeter_toolit/workflows/CI/CD%20Pipeline/badge.svg)
![Code Quality](https://github.com/YOUR_USERNAME/jmeter_toolit/workflows/Code%20Quality/badge.svg)
![Security](https://github.com/YOUR_USERNAME/jmeter_toolit/workflows/Security%20Scan/badge.svg)
```

## 🔧 Configuration Files

The workflows use these configuration files:
- `.flake8` - Flake8 linting configuration
- `pyproject.toml` - Black, isort, mypy, pytest configuration
- `requirements.txt` - Python dependencies

## 🚀 Triggering Workflows

### Automatic Triggers
- **Push to main/master/develop**: Runs CI/CD and Code Quality
- **Pull Requests**: Runs CI/CD and Code Quality
- **Weekly Schedule**: Runs Performance Tests and Dependency Updates
- **Version Tags**: Runs Release workflow

### Manual Triggers
All workflows can be triggered manually through the GitHub Actions interface:
1. Go to the **Actions** tab in your repository
2. Select the workflow you want to run
3. Click **Run workflow**
4. Choose the branch and any required inputs

## 📋 Requirements

### Secrets Required
- `GITHUB_TOKEN` (automatically provided)

### Optional Secrets
- `CODECOV_TOKEN` (for code coverage reporting)
- `DOCKER_HUB_USERNAME` and `DOCKER_HUB_TOKEN` (for Docker registry)

## 🛠️ Customization

### Adding New Tests
1. Add test files to the `tests/` directory
2. Tests will automatically run in the CI pipeline

### Modifying Python Versions
Edit the `matrix.python-version` in `ci.yml`:
```yaml
strategy:
matrix:
python-version: [3.9, 3.10, 3.11, 3.12]
```

### Changing Schedule
Modify the `cron` expression in workflow files:
```yaml
schedule:
- cron: '0 9 * * 1' # Every Monday at 9 AM UTC
```

### Adding Environment Variables
Add to the workflow file:
```yaml
env:
MY_VARIABLE: value
```

## 🔍 Monitoring

### Viewing Results
- **Actions Tab**: See all workflow runs and their status
- **Artifacts**: Download test reports, coverage reports, and logs
- **Checks**: See status on Pull Requests

### Notifications
- **Email**: GitHub sends notifications for failed workflows
- **Status Checks**: Required checks prevent merging with failures
- **Slack/Discord**: Can be integrated with webhooks

## 🐛 Troubleshooting

### Common Issues

1. **Tests Failing**: Check the test logs in the Actions tab
2. **Dependencies**: Update requirements.txt if imports fail
3. **Python Version**: Ensure compatibility with all tested versions
4. **Docker Build**: Check Dockerfile syntax and dependencies

### Debug Mode
Add this to any workflow step for debugging:
```yaml
- name: Debug
run: |
echo "Debug information"
env
ls -la
```

## 📚 Resources

- [GitHub Actions Documentation](https://docs.github.com/en/actions)
- [Workflow Syntax](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions)
- [Marketplace Actions](https://github.com/marketplace?type=actions)
Loading
Loading