@intentsolutionsio/performance-test-suite 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +19 -0
- package/LICENSE +21 -0
- package/README.md +282 -0
- package/agents/performance-tester.md +296 -0
- package/package.json +40 -0
- package/skills/running-performance-tests/SKILL.md +140 -0
- package/skills/running-performance-tests/assets/README.md +7 -0
- package/skills/running-performance-tests/assets/example_test_configurations.json +121 -0
- package/skills/running-performance-tests/assets/report_template.html +203 -0
- package/skills/running-performance-tests/assets/test_template.js +65 -0
- package/skills/running-performance-tests/references/README.md +4 -0
- package/skills/running-performance-tests/scripts/README.md +11 -0
- package/skills/running-performance-tests/scripts/analyze_results.py +134 -0
- package/skills/running-performance-tests/scripts/init_test.py +94 -0
- package/skills/running-performance-tests/scripts/run_test.sh +100 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
performance-test-suite - Initialization Script
|
|
4
|
+
Script to initialize a performance test based on user input.
|
|
5
|
+
Generated: 2025-12-10 03:48:17
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
import json
|
|
10
|
+
import argparse
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
def create_project_structure(project_name: str, output_dir: str = "."):
|
|
14
|
+
"""Create project structure for performance-test-suite."""
|
|
15
|
+
base_path = Path(output_dir) / project_name
|
|
16
|
+
|
|
17
|
+
# Create directories
|
|
18
|
+
directories = [
|
|
19
|
+
base_path,
|
|
20
|
+
base_path / "config",
|
|
21
|
+
base_path / "data",
|
|
22
|
+
base_path / "output",
|
|
23
|
+
base_path / "logs"
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
for dir_path in directories:
|
|
27
|
+
dir_path.mkdir(parents=True, exist_ok=True)
|
|
28
|
+
print(f"ā Created {dir_path}")
|
|
29
|
+
|
|
30
|
+
# Create configuration file
|
|
31
|
+
config = {
|
|
32
|
+
"project": project_name,
|
|
33
|
+
"version": "1.0.0",
|
|
34
|
+
"skill": "performance-test-suite",
|
|
35
|
+
"category": "testing",
|
|
36
|
+
"created": time.strftime('%Y-%m-%d %H:%M:%S'),
|
|
37
|
+
"settings": {
|
|
38
|
+
"debug": False,
|
|
39
|
+
"verbose": True,
|
|
40
|
+
"max_workers": 4
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
config_file = base_path / "config" / "settings.json"
|
|
45
|
+
with open(config_file, 'w') as f:
|
|
46
|
+
json.dump(config, f, indent=2)
|
|
47
|
+
print(f"ā Created configuration: {config_file}")
|
|
48
|
+
|
|
49
|
+
# Create README
|
|
50
|
+
readme_content = f"""# {project_name}
|
|
51
|
+
|
|
52
|
+
Initialized with performance-test-suite skill
|
|
53
|
+
|
|
54
|
+
## Structure
|
|
55
|
+
- config/ - Configuration files
|
|
56
|
+
- data/ - Input data
|
|
57
|
+
- output/ - Generated output
|
|
58
|
+
- logs/ - Application logs
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
See skill documentation for usage instructions.
|
|
62
|
+
"""
|
|
63
|
+
|
|
64
|
+
readme_file = base_path / "README.md"
|
|
65
|
+
readme_file.write_text(readme_content)
|
|
66
|
+
print(f"ā Created README: {readme_file}")
|
|
67
|
+
|
|
68
|
+
return base_path
|
|
69
|
+
|
|
70
|
+
def main():
|
|
71
|
+
parser = argparse.ArgumentParser(description="Script to initialize a performance test based on user input.")
|
|
72
|
+
parser.add_argument('--project', '-p', required=True, help='Project name')
|
|
73
|
+
parser.add_argument('--output', '-o', default='.', help='Output directory')
|
|
74
|
+
parser.add_argument('--config', '-c', help='Configuration file')
|
|
75
|
+
|
|
76
|
+
args = parser.parse_args()
|
|
77
|
+
|
|
78
|
+
print(f"š Initializing {args.project}...")
|
|
79
|
+
project_path = create_project_structure(args.project, args.output)
|
|
80
|
+
|
|
81
|
+
if args.config:
|
|
82
|
+
# Load additional configuration
|
|
83
|
+
if Path(args.config).exists():
|
|
84
|
+
with open(args.config) as f:
|
|
85
|
+
extra_config = json.load(f)
|
|
86
|
+
print(f"ā Loaded configuration from {args.config}")
|
|
87
|
+
|
|
88
|
+
print(f"\nā
Project initialized successfully at {project_path}")
|
|
89
|
+
return 0
|
|
90
|
+
|
|
91
|
+
if __name__ == "__main__":
|
|
92
|
+
import sys
|
|
93
|
+
import time
|
|
94
|
+
sys.exit(main())
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
performance-test-suite - run_test.sh
|
|
4
|
+
Script to execute the performance test using k6 or other tools.
|
|
5
|
+
Generated: 2025-12-10 03:48:17
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import os
|
|
9
|
+
import sys
|
|
10
|
+
import json
|
|
11
|
+
import argparse
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from datetime import datetime
|
|
14
|
+
|
|
15
|
+
def process_file(file_path: Path) -> bool:
|
|
16
|
+
"""Process individual file."""
|
|
17
|
+
if not file_path.exists():
|
|
18
|
+
print(f"ā File not found: {file_path}")
|
|
19
|
+
return False
|
|
20
|
+
|
|
21
|
+
print(f"š Processing: {file_path}")
|
|
22
|
+
|
|
23
|
+
# Add processing logic here based on skill requirements
|
|
24
|
+
# This is a template that can be customized
|
|
25
|
+
|
|
26
|
+
try:
|
|
27
|
+
if file_path.suffix == '.json':
|
|
28
|
+
with open(file_path) as f:
|
|
29
|
+
data = json.load(f)
|
|
30
|
+
print(f" ā Valid JSON with {len(data)} keys")
|
|
31
|
+
else:
|
|
32
|
+
size = file_path.stat().st_size
|
|
33
|
+
print(f" ā File size: {size:,} bytes")
|
|
34
|
+
|
|
35
|
+
return True
|
|
36
|
+
except Exception as e:
|
|
37
|
+
print(f" ā Error: {e}")
|
|
38
|
+
return False
|
|
39
|
+
|
|
40
|
+
def process_directory(dir_path: Path) -> int:
|
|
41
|
+
"""Process all files in directory."""
|
|
42
|
+
processed = 0
|
|
43
|
+
failed = 0
|
|
44
|
+
|
|
45
|
+
for file_path in dir_path.rglob('*'):
|
|
46
|
+
if file_path.is_file():
|
|
47
|
+
if process_file(file_path):
|
|
48
|
+
processed += 1
|
|
49
|
+
else:
|
|
50
|
+
failed += 1
|
|
51
|
+
|
|
52
|
+
return processed, failed
|
|
53
|
+
|
|
54
|
+
def main():
|
|
55
|
+
parser = argparse.ArgumentParser(
|
|
56
|
+
description="Script to execute the performance test using k6 or other tools."
|
|
57
|
+
)
|
|
58
|
+
parser.add_argument('input', help='Input file or directory')
|
|
59
|
+
parser.add_argument('--output', '-o', help='Output directory')
|
|
60
|
+
parser.add_argument('--verbose', '-v', action='store_true', help='Verbose output')
|
|
61
|
+
parser.add_argument('--config', '-c', help='Configuration file')
|
|
62
|
+
|
|
63
|
+
args = parser.parse_args()
|
|
64
|
+
|
|
65
|
+
input_path = Path(args.input)
|
|
66
|
+
|
|
67
|
+
print(f"š performance-test-suite - run_test.sh")
|
|
68
|
+
print(f" Category: testing")
|
|
69
|
+
print(f" Plugin: performance-test-suite")
|
|
70
|
+
print(f" Input: {input_path}")
|
|
71
|
+
|
|
72
|
+
if args.config:
|
|
73
|
+
if Path(args.config).exists():
|
|
74
|
+
with open(args.config) as f:
|
|
75
|
+
config = json.load(f)
|
|
76
|
+
print(f" Config: {args.config}")
|
|
77
|
+
|
|
78
|
+
# Process input
|
|
79
|
+
if input_path.is_file():
|
|
80
|
+
success = process_file(input_path)
|
|
81
|
+
result = 0 if success else 1
|
|
82
|
+
elif input_path.is_dir():
|
|
83
|
+
processed, failed = process_directory(input_path)
|
|
84
|
+
print(f"\nš SUMMARY")
|
|
85
|
+
print(f" ā
Processed: {processed}")
|
|
86
|
+
print(f" ā Failed: {failed}")
|
|
87
|
+
result = 0 if failed == 0 else 1
|
|
88
|
+
else:
|
|
89
|
+
print(f"ā Invalid input: {input_path}")
|
|
90
|
+
result = 1
|
|
91
|
+
|
|
92
|
+
if result == 0:
|
|
93
|
+
print("\nā
Completed successfully")
|
|
94
|
+
else:
|
|
95
|
+
print("\nā Completed with errors")
|
|
96
|
+
|
|
97
|
+
return result
|
|
98
|
+
|
|
99
|
+
if __name__ == "__main__":
|
|
100
|
+
sys.exit(main())
|