Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
133 lines
3.2 KiB
YAML
133 lines
3.2 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# Unit tests
|
|
test-unit:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.test
|
|
container_name: mev-bot-test-unit
|
|
command: >
|
|
sh -c "
|
|
echo '🧪 Running Unit Tests...' &&
|
|
go test -v -race -short -coverprofile=coverage.out ./pkg/... ./internal/... &&
|
|
echo '✅ Unit tests passed!'
|
|
"
|
|
volumes:
|
|
- ./coverage:/app/coverage
|
|
environment:
|
|
- GO_ENV=test
|
|
- CGO_ENABLED=1
|
|
|
|
# Integration tests
|
|
test-integration:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.test
|
|
container_name: mev-bot-test-integration
|
|
command: >
|
|
sh -c "
|
|
echo '🔗 Running Integration Tests...' &&
|
|
go test -v -race -run Integration ./test/integration/... &&
|
|
echo '✅ Integration tests passed!'
|
|
"
|
|
environment:
|
|
- GO_ENV=test
|
|
- CGO_ENABLED=1
|
|
depends_on:
|
|
- test-unit
|
|
|
|
# Race condition tests
|
|
test-race:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.test
|
|
container_name: mev-bot-test-race
|
|
command: >
|
|
sh -c "
|
|
echo '🏁 Running Race Detector Tests...' &&
|
|
go test -race -v ./pkg/arbitrage/... ./pkg/scanner/... &&
|
|
echo '✅ No race conditions detected!'
|
|
"
|
|
environment:
|
|
- GO_ENV=test
|
|
- CGO_ENABLED=1
|
|
|
|
# Build verification
|
|
test-build:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.test
|
|
container_name: mev-bot-test-build
|
|
command: >
|
|
sh -c "
|
|
echo '🔨 Testing Build Process...' &&
|
|
go build -o /tmp/mev-bot-test ./cmd/mev-bot &&
|
|
echo '✅ Build successful!' &&
|
|
ls -lh /tmp/mev-bot-test
|
|
"
|
|
environment:
|
|
- GO_ENV=test
|
|
- CGO_ENABLED=0
|
|
|
|
# Coverage report
|
|
test-coverage:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.test
|
|
container_name: mev-bot-test-coverage
|
|
command: >
|
|
sh -c "
|
|
echo '📊 Generating Coverage Report...' &&
|
|
go test -coverprofile=coverage.out -covermode=atomic ./... &&
|
|
go tool cover -func=coverage.out &&
|
|
go tool cover -html=coverage.out -o coverage/coverage.html &&
|
|
echo '✅ Coverage report generated: coverage/coverage.html'
|
|
"
|
|
volumes:
|
|
- ./coverage:/app/coverage
|
|
environment:
|
|
- GO_ENV=test
|
|
- CGO_ENABLED=1
|
|
depends_on:
|
|
- test-unit
|
|
- test-integration
|
|
|
|
# Security scan
|
|
test-security:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.test
|
|
container_name: mev-bot-test-security
|
|
command: >
|
|
sh -c "
|
|
echo '🔒 Running Security Scans...' &&
|
|
go install github.com/securego/gosec/v2/cmd/gosec@latest &&
|
|
gosec -fmt=json -out=coverage/gosec-report.json ./... &&
|
|
gosec ./... &&
|
|
echo '✅ Security scan complete!'
|
|
"
|
|
volumes:
|
|
- ./coverage:/app/coverage
|
|
environment:
|
|
- GO_ENV=test
|
|
|
|
# Linting
|
|
test-lint:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.test
|
|
command: >
|
|
sh -c "
|
|
echo '🧹 Running Linters...' &&
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest &&
|
|
golangci-lint run --timeout=5m ./... &&
|
|
echo '✅ Linting passed!'
|
|
"
|
|
environment:
|
|
- GO_ENV=test
|
|
|
|
networks:
|
|
default:
|
|
name: mev-bot-test-network
|