Closed danilo-lopes closed 6 months ago
You can use POST api but specify testId in the payload and it works as update. Example of a sample payload
{
"testId": "fhjOdqegK5",
"testName": "dasda",
"testDescription": "ada",
"testTaskConfigs": [
{
"concurrency": "1",
"taskCount": "1",
"region": "us-west-2"
}
],
"testScenario": {
"execution": [
{
"ramp-up": "0m",
"hold-for": "1m",
"scenario": "dasda"
}
],
"scenarios": {
"dasda": {
"requests": [
{
"url": "http://localhost:3000/create",
"method": "GET",
"body": {},
"headers": {}
}
]
}
}
},
"showLive": false,
"testType": "simple",
"fileType": "",
"regionalTaskDetails": {
"us-west-2": {
"vCPULimit": 4000,
"vCPUsPerTask": 2,
"vCPUsInUse": 0,
"dltTaskLimit": 2000,
"dltAvailableTasks": 2000
}
}
}
@danilo-lopes I changed the title and the label so when others have the same question they could find it here easily
With this example payload I was able to update or run the Load Test immediately:
{
'testId': dictionary['testId'],
'testName': dictionary['testName'],
'testDescription': dictionary['testDescription'],
'showLive': dictionary['showLive'],
'testType': dictionary['testType'],
'fileType': dictionary['fileType'],
'testTaskConfigs': [
{
'region': dictionary['testTaskConfigs'][0]['region'],
'taskCount': None,
'concurrency': None,
}
],
'testScenario': {
'execution': [
{
'ramp-up': None,
'hold-for': None,
'scenario': f'{project_id}.jmx',
'taskCount': None,
'concurrency': None
}
]
},
'regionalTaskDetails': {
dictionary['testTaskConfigs'][0]['region']: {
'vCPULimit': 4000,
'vCPUsPerTask': 2,
'vCPUsInUse': 0,
'dltTaskLimit': 2000,
'dltAvailableTasks': 2000
}
},
}
I think these are the basic necessary fields the API is waiting.
I think we can close this
Reading the documentation API it don't have an endpoint to update an existing Test or an option to run it now, if I understand correctly I can only create and schedule it.
For example, if I want to update the number of tasks, I could use the endpoint to update it or run it now:
Or just run it now:
The 'GET' operation on '/scenarios/' endpoint cancel the Test, I don't know, really confusing this approach.
My intention is to use this AWS solution to integrate with our CICD Pipeline to run the load tests and fail depending of the results.