Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

Commit

Permalink
update example in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kaylarizi committed Jan 24, 2024
1 parent de977b8 commit 3140204
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 4 additions & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@ python3 -m src.main
curl --location 'http://localhost:3020/qujata-api/analyze' \
--header 'Content-Type: application/json' \
--data '{
"experimentName": "name",
"description" : "test description",
"algorithms": ["kyber512"],
"iterationsCount": 5
"iterationsCount": [5],
"messageSizes": [10]
}'
```

Expand Down
4 changes: 1 addition & 3 deletions api/src/services/analyze_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ def analyze(data):
start_time = int(datetime.timestamp(datetime.now() - timedelta(seconds=60)) * 1000)
iterations_count = data['iterationsCount']
algorithms = data['algorithms']
message_sizes = [0]
if 'messageSizes' in data:
message_sizes = data['messageSizes']
message_sizes = data['messageSizes'] if 'messageSizes' in data else [0]
first_run = True
for algorithm in algorithms:
for iterations in iterations_count:
Expand Down
4 changes: 2 additions & 2 deletions api/src/utils/test_suite_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ def serialize(test_suite):
"id": test_suite.id,
"name": test_suite.name,
"description": test_suite.description,
"codeRelease": test_suite.code_release,
"code_release": test_suite.code_release,
"start_time": test_suite.start_time,
"end_time": test_suite.end_time,
"environment_info": __get_environment_info(test_suite.env_info),
"testRuns": __get_test_runs_metrics(test_suite.test_runs)
"test_runs": __get_test_runs_metrics(test_suite.test_runs)
}
return response_data

Expand Down
2 changes: 1 addition & 1 deletion api/tests/test_tests_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_get_test_suite(self):
self.app.database_manager.get_by_id.return_value = test_suite
response = self.client.get(TEST_SUITES_GET_URL)
result = json.loads(response.data)
expected = {'codeRelease': '1.1.0', 'description': 'description', 'end_time': None, 'environment_info': {'cpu': None, 'cpuArchitecture': None, 'cpuClockSpeed': None, 'cpuCores': None, 'nodeSize': None, 'operatingSystem': None, 'resourceName': None}, 'id': None, 'name': 'name', 'start_time': None, 'testRuns': [{'algorithm': None, 'id': 1, 'iterations': None, 'results': {'averageCPU': 9.0, 'averageMemory': 14}}]}
expected = {'code_release': '1.1.0', 'description': 'description', 'end_time': None, 'environment_info': {'cpu': None, 'cpuArchitecture': None, 'cpuClockSpeed': None, 'cpuCores': None, 'nodeSize': None, 'operatingSystem': None, 'resourceName': None}, 'id': None, 'name': 'name', 'start_time': None, 'test_runs': [{'algorithm': None, 'id': 1, 'iterations': None, 'results': {'averageCPU': 9.0, 'averageMemory': 14}}]}
self.assertEqual(result, expected)

def test_get_test_suite_return_not_found(self):
Expand Down

0 comments on commit 3140204

Please sign in to comment.