Skip to content

Commit

Permalink
Fixing Soda Cloud agent flow after real dev testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tombaeyens committed Feb 22, 2025
1 parent d864199 commit 8e28c39
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
12 changes: 11 additions & 1 deletion soda-core/src/soda_core/common/soda_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,17 @@ def execute_contracts_on_agent(self, contract_yamls: list[ContractYaml]) -> list
self.logs.debug(f"Soda Cloud responded with {json.dumps(dict(logs_response.headers))}\n{logs_response.text}")

response_json: dict = logs_response.json()
logs: list[dict] = response_json.get("logs")
logs: list[dict] = response_json.get("content")
# TODO implement extra page loading if there are more pages of scan logs....
# response body: {
# "content": [...],
# "totalElements": 0,
# "totalPages": 0,
# "number": 0,
# "size": 0,
# "last": true,
# "first": true
# }
if isinstance(logs, list):
for log in logs:
if isinstance(log, dict):
Expand Down
11 changes: 8 additions & 3 deletions soda-core/tests/soda_core/tests/components/test_soda_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def test_execute_over_agent(data_source_test_helper: DataSourceTestHelper):
method=MockHttpMethod.GET,
status_code=200,
json_object={
"scanId": "ssscanid",
"logs": [
"content": [
{
"level": "debug",
"message": "m1",
Expand All @@ -97,7 +96,13 @@ def test_execute_over_agent(data_source_test_helper: DataSourceTestHelper):
"timestamp": "2025-02-21T06:16:59+00:00",
"index": 1,
}
]
],
"totalElements": 2,
"totalPages": 1,
"number": 0,
"size": 2,
"last": True,
"first": True
}
)
])
Expand Down

0 comments on commit 8e28c39

Please sign in to comment.