-
Notifications
You must be signed in to change notification settings - Fork 164
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (76 loc) · 2.44 KB
/
Makefile
File metadata and controls
95 lines (76 loc) · 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Makefile for MetasploitMCP testing and development
.PHONY: help install-deps test test-unit test-integration test-options test-helpers test-tools coverage clean lint format
# Default target
help:
@echo "Available targets:"
@echo " help - Show this help message"
@echo " install-deps - Install test dependencies"
@echo " test - Run all tests"
@echo " test-unit - Run unit tests only"
@echo " test-integration - Run integration tests only"
@echo " test-options - Run options parsing tests only"
@echo " test-helpers - Run helper function tests only"
@echo " test-tools - Run MCP tools tests only"
@echo " coverage - Run tests with coverage report"
@echo " coverage-html - Run tests with HTML coverage report"
@echo " lint - Run linting checks"
@echo " format - Format code"
@echo " clean - Clean up generated files"
# Install test dependencies
install-deps:
python -m pip install -r requirements-test.txt
# Test targets
test:
python run_tests.py --all
test-unit:
python run_tests.py --unit
test-integration:
python run_tests.py --integration
test-options:
python run_tests.py --options
test-helpers:
python run_tests.py --helpers
test-tools:
python run_tests.py --tools
# Coverage targets
coverage:
python run_tests.py --all --coverage
coverage-html:
python run_tests.py --all --coverage --html
@echo "Coverage report: file://$(PWD)/htmlcov/index.html"
# Code quality targets
lint:
@echo "Running flake8..."
-python -m flake8 MetasploitMCP.py tests/ --max-line-length=120 --ignore=E203,W503
@echo "Running pylint..."
-python -m pylint MetasploitMCP.py --disable=C0301,C0103,R0903,R0913
format:
@echo "Running black code formatter..."
-python -m black MetasploitMCP.py tests/ --line-length=120
@echo "Running isort import formatter..."
-python -m isort MetasploitMCP.py tests/
# Cleanup
clean:
rm -rf __pycache__/
rm -rf tests/__pycache__/
rm -rf .pytest_cache/
rm -rf htmlcov/
rm -rf .coverage
rm -rf *.pyc
rm -rf tests/*.pyc
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} +
# Development targets
dev-setup: install-deps
@echo "Development environment setup complete"
check: lint test
@echo "All checks passed!"
# CI/CD targets
ci-test:
python run_tests.py --all --coverage --verbose
# Quick test (no coverage)
quick-test:
pytest tests/ -x -v
# Test with failure details
test-debug:
pytest tests/ -v --tb=long --capture=no