devdox-ai-locust 0.1.1__py3-none-any.whl → 0.1.2__py3-none-any.whl
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.
Potentially problematic release.
This version of devdox-ai-locust might be problematic. Click here for more details.
- devdox_ai_locust/config.py +1 -1
- devdox_ai_locust/prompt/domain.j2 +33 -0
- devdox_ai_locust/prompt/locust.j2 +22 -0
- devdox_ai_locust/prompt/test_data.j2 +62 -0
- devdox_ai_locust/prompt/validation.j2 +17 -0
- devdox_ai_locust/prompt/workflow.j2 +145 -0
- {devdox_ai_locust-0.1.1.dist-info → devdox_ai_locust-0.1.2.dist-info}/METADATA +1 -1
- {devdox_ai_locust-0.1.1.dist-info → devdox_ai_locust-0.1.2.dist-info}/RECORD +12 -7
- {devdox_ai_locust-0.1.1.dist-info → devdox_ai_locust-0.1.2.dist-info}/WHEEL +0 -0
- {devdox_ai_locust-0.1.1.dist-info → devdox_ai_locust-0.1.2.dist-info}/entry_points.txt +0 -0
- {devdox_ai_locust-0.1.1.dist-info → devdox_ai_locust-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {devdox_ai_locust-0.1.1.dist-info → devdox_ai_locust-0.1.2.dist-info}/top_level.txt +0 -0
devdox_ai_locust/config.py
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Based on this API analysis, create domain-specific user flows for Locust testing:
|
|
2
|
+
{{domain_analysis}}
|
|
3
|
+
|
|
4
|
+
API Analysis: Use the analyze_api_domain function output which includes:
|
|
5
|
+
- API Title and Description
|
|
6
|
+
- Total Endpoints count
|
|
7
|
+
- HTTP Methods used
|
|
8
|
+
- Common Path Patterns
|
|
9
|
+
- Main Resources identified
|
|
10
|
+
|
|
11
|
+
Endpoints Available: Complete Swagger documentation with all endpoint details including:
|
|
12
|
+
{{ endpoints }}
|
|
13
|
+
|
|
14
|
+
# Limit for token efficiency
|
|
15
|
+
|
|
16
|
+
Generate a Python file with domain-specific user flow classes that extend the base CustomUserFlow. Focus on realistic business workflows that users would actually perform.
|
|
17
|
+
|
|
18
|
+
Requirements:
|
|
19
|
+
1. Create 2-3 domain-specific flow classes based on the identified main resources
|
|
20
|
+
2. Use sequential tasks for related API calls and use correlation between them
|
|
21
|
+
3. To check payload and update it if it is not valid using the Swagger schemas
|
|
22
|
+
4. Each flow should represent a complete business process workflow
|
|
23
|
+
5. Include proper error handling and realistic wait times
|
|
24
|
+
6. Use the available endpoints from Swagger documentation in logical sequences
|
|
25
|
+
7. Add meaningful logging and data tracking
|
|
26
|
+
8. Parse Swagger schemas to generate valid request payloads
|
|
27
|
+
9. Implement data correlation (e.g., use created resource IDs in subsequent calls)
|
|
28
|
+
10. Add requirement sent by developer:{{ custom_requirement }}
|
|
29
|
+
|
|
30
|
+
Always return your code wrapped in <code></code> tags with no explanations outside the tags
|
|
31
|
+
DO NOT TRUNCATE THE CODE. IMPORTANT: Return the SAME code with ONLY formatting fixes. Do not enhance or add anything
|
|
32
|
+
|
|
33
|
+
Format: <code>your_python_code_here</code>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Enhance this Locust test file to be more professional and realistic and fix the indentation issues:
|
|
2
|
+
|
|
3
|
+
```python
|
|
4
|
+
{{ base_content }}
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
Available Endpoints: {{ endpoints_for_prompt }}
|
|
8
|
+
API Info: {{ api_info.title }} v {{ api_info.version }}
|
|
9
|
+
|
|
10
|
+
Fix ONLY the formatting and indentation issues in this Locust test file.
|
|
11
|
+
|
|
12
|
+
STRICT REQUIREMENTS:
|
|
13
|
+
- Fix indentation and formatting ONLY
|
|
14
|
+
- Do NOT add new tasks, methods, or endpoints
|
|
15
|
+
- Do NOT modify existing task logic
|
|
16
|
+
- Do NOT add new functionality
|
|
17
|
+
- Keep the exact same tasks and methods
|
|
18
|
+
- Only fix Python syntax, imports, and indentation
|
|
19
|
+
|
|
20
|
+
Always return your code wrapped in <code></code> tags with no explanations outside the tags DO NOT TRUNCATE THE CODE.
|
|
21
|
+
IMPORTANT: Return the SAME code with ONLY formatting fixes. Do not enhance or add anything
|
|
22
|
+
Format: <code>your_python_code_here</code>:
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
Enhance this test data generator with domain-specific realistic data while preserving ALL existing methods and their signatures:
|
|
2
|
+
|
|
3
|
+
Current File:
|
|
4
|
+
{{base_content}}
|
|
5
|
+
|
|
6
|
+
API Schemas Found:
|
|
7
|
+
{{ schemas_info }}
|
|
8
|
+
|
|
9
|
+
API Endpoints Context:
|
|
10
|
+
[
|
|
11
|
+
{% for ep in endpoints -%}
|
|
12
|
+
"Path: {{ ep.path }}, Method: {{ ep.method }}, Tags: {{ ep.tags }}"{% if not loop.last %},{% endif %}
|
|
13
|
+
{% endfor -%}
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
REQUIREMENTS - Enhance by adding NEW functionality while keeping ALL existing methods intact:
|
|
17
|
+
|
|
18
|
+
1. **Domain-Specific Data Generators**:
|
|
19
|
+
- Add methods like `generate_affiliate_data()`, `generate_user_credentials()`, `generate_product_data()`
|
|
20
|
+
- Create realistic data based on API endpoint patterns (affiliate, user, product, etc.)
|
|
21
|
+
- Add specific payload generators for common API patterns
|
|
22
|
+
|
|
23
|
+
2. **Realistic ID Generation**:
|
|
24
|
+
- Add `generate_realistic_id(entity_type: str)` for entity-specific IDs
|
|
25
|
+
- Create correlated IDs (user_id -> session_id -> transaction_id)
|
|
26
|
+
- Add methods like `generate_affiliate_id()`, `generate_partner_id()`, etc.
|
|
27
|
+
|
|
28
|
+
3. **Payload Templates**:
|
|
29
|
+
- Add `get_payload_template(endpoint_path: str, method: str)`
|
|
30
|
+
- Create endpoint-specific payload generators
|
|
31
|
+
- Add `generate_login_payload()`, `generate_registration_payload()`, etc.
|
|
32
|
+
|
|
33
|
+
4. **Data Relationships & Correlation**:
|
|
34
|
+
- Add session management: `create_user_session()`, `get_session_data()`
|
|
35
|
+
- Create data dependency chains (parent-child relationships)
|
|
36
|
+
- Add `link_related_entities(parent_id, child_type)` for realistic relationships
|
|
37
|
+
|
|
38
|
+
5. **Smart Caching & Performance**:
|
|
39
|
+
- Add `cache_generated_data(key, data)` and `get_cached_data(key)`
|
|
40
|
+
- Create reusable entity pools for better performance
|
|
41
|
+
- Add `get_or_create_entity(entity_type, **kwargs)`
|
|
42
|
+
|
|
43
|
+
6. **Specialized Pattern Generators**:
|
|
44
|
+
- Add `generate_api_key_data()`, `generate_webhook_payload()`
|
|
45
|
+
- Create `generate_pagination_data()`, `generate_filter_data()`
|
|
46
|
+
- Add `generate_error_scenarios()` for negative testing
|
|
47
|
+
|
|
48
|
+
7. **Validation & Constraints**:
|
|
49
|
+
- Add `validate_generated_data(data, schema)`
|
|
50
|
+
- Create constraint-aware generation
|
|
51
|
+
- Add business rule validation
|
|
52
|
+
|
|
53
|
+
CRITICAL CONSTRAINTS:
|
|
54
|
+
- MUST preserve ALL existing method signatures exactly as they are
|
|
55
|
+
- MUST keep all existing functionality working
|
|
56
|
+
- MUST maintain backward compatibility
|
|
57
|
+
- ADD new methods, don't modify existing ones
|
|
58
|
+
- Keep the global `test_data_generator` instance
|
|
59
|
+
|
|
60
|
+
Focus on making the data generation smarter and more realistic while ensuring all existing code that imports and uses this generator continues to work without changes.
|
|
61
|
+
|
|
62
|
+
Output: Complete enhanced Python file with ALL existing content preserved + new intelligent features
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Enhance this utils file with smarter response validation:
|
|
2
|
+
|
|
3
|
+
Current File:
|
|
4
|
+
{{base_content}}
|
|
5
|
+
|
|
6
|
+
Validation Patterns Needed:
|
|
7
|
+
{{ validation_patterns }}
|
|
8
|
+
|
|
9
|
+
Enhance by:
|
|
10
|
+
1. Adding endpoint-specific validation rules
|
|
11
|
+
2. Creating schema-based response validation
|
|
12
|
+
3. Adding business logic validation
|
|
13
|
+
4. Implementing response data integrity checks
|
|
14
|
+
5. Adding performance threshold validation
|
|
15
|
+
|
|
16
|
+
Keep existing utility functions but add smarter validation logic.
|
|
17
|
+
Output: Complete enhanced Python file content.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
CRITICAL CONSTRAINTS: Only use endpoints that exist in the OpenAPI specification. DO NOT create, modify, or reference any endpoints not listed below.
|
|
2
|
+
TASK: Enhance this Locust workflow file with realistic load testing patterns and LOGICAL TASK ORDERING.
|
|
3
|
+
STRICT REQUIREMENTS:
|
|
4
|
+
1. ONLY use these exact API endpoints from OpenAPI spec:
|
|
5
|
+
{{ grouped_enpoints }}
|
|
6
|
+
2. Check Authentication Endpoints :
|
|
7
|
+
{{ auth_endpoints }}
|
|
8
|
+
- If their is endpoints to login , add login task at the beginning of the workflow If we don't have login endpoint, we can't login and retry the task
|
|
9
|
+
- In case of getting 401 so login and retry the task
|
|
10
|
+
- If their is endpoints to logout , add logout task at the end of the workflow
|
|
11
|
+
3. PRESERVE EXISTING STRUCTURE:
|
|
12
|
+
- Keep ALL existing @task methods, classes, and functions
|
|
13
|
+
- DO NOT remove any existing functionality
|
|
14
|
+
- DO NOT change existing method signatures unless enhancing them
|
|
15
|
+
- ADD to existing methods, don't replace them
|
|
16
|
+
4. ADD NEW FUNCTIONALITY WHEN NEEDED:
|
|
17
|
+
- If an API endpoint requires specific IDs, ADD new methods to generate/store those IDs
|
|
18
|
+
- ADD new test data generators to test_data.py functions
|
|
19
|
+
- ADD new example usage patterns to example.py
|
|
20
|
+
- CREATE data flow between related API calls
|
|
21
|
+
|
|
22
|
+
5. DATA FLOW AND ID MANAGEMENT:
|
|
23
|
+
- ADD instance variables to store IDs (self.reseller_id, self.user_id, etc.)
|
|
24
|
+
- ADD methods to extract and store IDs from API responses
|
|
25
|
+
- ADD logic to use stored IDs in subsequent API calls
|
|
26
|
+
- CREATE realistic data dependencies between tasks
|
|
27
|
+
|
|
28
|
+
6. ENHANCEMENT AREAS (ADD, don't replace):
|
|
29
|
+
- ADD better error handling to existing methods
|
|
30
|
+
- ADD realistic test data usage from test_data.py
|
|
31
|
+
- ADD authentication handling if auth endpoints exist
|
|
32
|
+
- ADD cleanup methods for created resources
|
|
33
|
+
- ADD data correlation between sequential tasks
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
CURRENT WORKFLOW FILE:
|
|
37
|
+
{{base_content}}
|
|
38
|
+
|
|
39
|
+
BASE WORKFLOW: {{base_workflow}}
|
|
40
|
+
|
|
41
|
+
TEST DATA AVAILABLE: {{test_data_content}}
|
|
42
|
+
1. **REORDER TASKS FOR LOGICAL FLOW**: Arrange @task methods in a meaningful business workflow sequence:
|
|
43
|
+
|
|
44
|
+
- Start with data creation tasks (e.g., add_reseller)
|
|
45
|
+
|
|
46
|
+
- Follow with data retrieval to get IDs for subsequent operations (e.g., get_reseller, get_reseller_by_id)
|
|
47
|
+
|
|
48
|
+
- Then perform operations using those IDs (e.g., customize_corporate_price, available_reseller_properties)
|
|
49
|
+
|
|
50
|
+
- End with cleanup operations (e.g., delete_reseller)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
2. **DATA CORRELATION**: Use data from previous tasks in subsequent tasks:
|
|
55
|
+
|
|
56
|
+
- Store reseller IDs from add_reseller for use in get_reseller_by_id, customize_price, etc.
|
|
57
|
+
|
|
58
|
+
- Pass generated data between related API calls
|
|
59
|
+
|
|
60
|
+
- Maintain state between sequential tasks for realistic workflows
|
|
61
|
+
|
|
62
|
+
3. Fix indentation issues
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
4. **Test Data Enhancement** (if needed, suggest additions):
|
|
66
|
+
If APIs need specific data formats, suggest:
|
|
67
|
+
- New functions to add to test_data.py
|
|
68
|
+
- New example patterns to add to example.py
|
|
69
|
+
- New data generators for specific ID requirements
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
5. Use realistic functions and classes from base_workflow.py and don't remove classes or functions from this file
|
|
74
|
+
|
|
75
|
+
6. Add intelligent request chaining between related API calls
|
|
76
|
+
|
|
77
|
+
7. Add authentication handling ONLY if auth endpoints exist in OpenAPI spec
|
|
78
|
+
|
|
79
|
+
8. Add error recovery for existing methods
|
|
80
|
+
|
|
81
|
+
9. Add data cleanup on stop for resources created during testing
|
|
82
|
+
|
|
83
|
+
10. Improve data parameterization using available test data generators
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
LOGICAL TASK SEQUENCE EXAMPLE:
|
|
88
|
+
|
|
89
|
+
For reseller workflow, the logical order should be:
|
|
90
|
+
|
|
91
|
+
1. add_reseller (create) → store reseller_id
|
|
92
|
+
|
|
93
|
+
2. get_reseller (list/search)
|
|
94
|
+
|
|
95
|
+
3. get_reseller_by_id (using stored reseller_id)
|
|
96
|
+
|
|
97
|
+
4. available_reseller_properties (using reseller_id)
|
|
98
|
+
|
|
99
|
+
5. customize_corporate_price (using reseller_id)
|
|
100
|
+
|
|
101
|
+
6. customize_corporate_price_csv (using reseller_id)
|
|
102
|
+
|
|
103
|
+
7. customize_price (using reseller_id)
|
|
104
|
+
|
|
105
|
+
8. customize_price_csv (using reseller_id)
|
|
106
|
+
|
|
107
|
+
9. topup_reseller_balance (using reseller_id)
|
|
108
|
+
|
|
109
|
+
10. edit_reseller (using reseller_id)
|
|
110
|
+
|
|
111
|
+
11. delete_reseller (cleanup using reseller_id)
|
|
112
|
+
|
|
113
|
+
VALIDATION RULES:
|
|
114
|
+
- Every @task method must correspond to an actual OpenAPI endpoint
|
|
115
|
+
- PRESERVE all existing functionality
|
|
116
|
+
- ADD new functionality only where needed for data flow
|
|
117
|
+
- Use only test_data.py functions that exist or suggest new ones to ADD
|
|
118
|
+
- Ensure realistic user workflows with proper data dependencies
|
|
119
|
+
- ADD error handling and resource cleanup
|
|
120
|
+
|
|
121
|
+
SUGGESTIONS FOR ADDITIONS (if needed):
|
|
122
|
+
If the workflow needs new test data generators or example patterns,
|
|
123
|
+
provide suggestions for what to ADD to:
|
|
124
|
+
|
|
125
|
+
test_data.py additions:
|
|
126
|
+
```python
|
|
127
|
+
# Suggest new functions to ADD (don't replace existing)
|
|
128
|
+
def get_specific_id_data():
|
|
129
|
+
# New function for ID-dependent APIs
|
|
130
|
+
pass
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
example.py additions:
|
|
134
|
+
```python
|
|
135
|
+
# Suggest new example patterns to ADD
|
|
136
|
+
def example_id_workflow():
|
|
137
|
+
# New example showing ID usage
|
|
138
|
+
pass
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Return the complete enhanced file in <code></code> tags without truncation.
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
Format:
|
|
145
|
+
<code>your_complete_enhanced_python_code_here</code>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devdox_ai_locust
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.2
|
|
4
4
|
Summary: AI-powered Locust load test generator from API documentation
|
|
5
5
|
Author-email: Hayat Bourji <hayat.bourgi@montyholding.com>
|
|
6
6
|
Maintainer-email: Hayat Bourji <hayat.bourgi@montyholding.com>
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
devdox_ai_locust/__init__.py,sha256=LhG8nXZxLkyvWwJxB_OCe9t4TLa4udLtzAVfHpD3CkU,276
|
|
2
2
|
devdox_ai_locust/cli.py,sha256=LefUjiboe05vvZAorWqqyAQUQf1WNKLeWEsSg4aCLfE,13834
|
|
3
|
-
devdox_ai_locust/config.py,sha256=
|
|
3
|
+
devdox_ai_locust/config.py,sha256=Ywf66At22QqKK8BtvfbEOnndCuxp7dIXZwWhyH2_9fs,447
|
|
4
4
|
devdox_ai_locust/hybrid_loctus_generator.py,sha256=e3ZBZlewNiORygxYDnPf5SG-yRKRH0RYX7l7pGvgnr8,33363
|
|
5
5
|
devdox_ai_locust/locust_generator.py,sha256=dt455ONBs91W4JxRipNX395PlDmHojigM79aKWHHHxs,27017
|
|
6
6
|
devdox_ai_locust/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
devdox_ai_locust/prompt/domain.j2,sha256=ThK1mZK8bmDF6v1YsOB9wjvijljPRoseLy6lWEUG-vM,1570
|
|
8
|
+
devdox_ai_locust/prompt/locust.j2,sha256=1OM-g5X1Y8fqerfSHjSBPWGRVgeLm9h22aBsA7Bt5fc,852
|
|
9
|
+
devdox_ai_locust/prompt/test_data.j2,sha256=8tGmPUGkhoc2Oxe5I-2Nr1LGND5KH0LgUjDR_S3h0zA,2659
|
|
10
|
+
devdox_ai_locust/prompt/validation.j2,sha256=4r-T8oVpkIjv3ADabD9d5klKqYfHICy85xpL0TVZKr4,487
|
|
11
|
+
devdox_ai_locust/prompt/workflow.j2,sha256=5Ea0y0_zyAyiFMXQGNvG_bDD-cJHhdWi10IstS3NaRk,5330
|
|
7
12
|
devdox_ai_locust/schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
13
|
devdox_ai_locust/schemas/processing_result.py,sha256=jja6oJh19FLrcnV7zHAQYXQ7g0_g_xt4JEQz3i9Sa9A,789
|
|
9
14
|
devdox_ai_locust/templates/base_workflow.py.j2,sha256=KQNamuRuTFAPsmY3MhH2WkYNiNP_Vu2iBUze8ZyENJk,6346
|
|
@@ -21,9 +26,9 @@ devdox_ai_locust/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
21
26
|
devdox_ai_locust/utils/file_creation.py,sha256=sN6rW07VBKfzwUEAG298tCRvmnzx0886w_phdEnsQZg,3957
|
|
22
27
|
devdox_ai_locust/utils/open_ai_parser.py,sha256=EJsPpPSM9RiTZ0iySYIJ66knREegS324Q7mSk_4CxGM,13158
|
|
23
28
|
devdox_ai_locust/utils/swagger_utils.py,sha256=L2CV_5J4krCYyIcl-KYW_SAkBxzIKOsn2kcHhZ2CI7k,3191
|
|
24
|
-
devdox_ai_locust-0.1.
|
|
25
|
-
devdox_ai_locust-0.1.
|
|
26
|
-
devdox_ai_locust-0.1.
|
|
27
|
-
devdox_ai_locust-0.1.
|
|
28
|
-
devdox_ai_locust-0.1.
|
|
29
|
-
devdox_ai_locust-0.1.
|
|
29
|
+
devdox_ai_locust-0.1.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
30
|
+
devdox_ai_locust-0.1.2.dist-info/METADATA,sha256=AVhpixM4Y5nwy-mWxdPWTYf2P2gNKauONCMMchG0dDU,13342
|
|
31
|
+
devdox_ai_locust-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
32
|
+
devdox_ai_locust-0.1.2.dist-info/entry_points.txt,sha256=Eoq-gJd4WxkwwQ8pUMsqeSrfZG3yW-NmJ82iVxOc9JA,95
|
|
33
|
+
devdox_ai_locust-0.1.2.dist-info/top_level.txt,sha256=ZIpK9RS5xc9RXgG8mw9xPs0kwln8Kggi_7VURxtERQE,17
|
|
34
|
+
devdox_ai_locust-0.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|