Skip to content

Commit

Permalink
Merge pull request #730 from fractal-analytics-platform/725-do-not-us…
Browse files Browse the repository at this point in the history
…e-verbose-query-parameter-in-get-apiv2taskcollectstate_id

Remove `verbose` query parameter
  • Loading branch information
tcompa authored Nov 4, 2024
2 parents 1577c46 + dab0ab0 commit 554c454
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
**Note**: Numbers like (\#123) point to closed Pull Requests on the fractal repository.

# 2.3.1 (unreleased)

* Internal:
* Update effect of `include_logs` for task-collection check command (\#730).

# 2.3.0

> WARNING: Starting from this release, Python3.9 is not supported any more.
Expand Down
6 changes: 3 additions & 3 deletions fractal_client/cmd/_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ def task_collection_check(
include_logs: bool,
) -> Interface:

res = client.get(
f"{settings.BASE_URL}/task/collect/{state_id}/?verbose={include_logs}"
)
res = client.get(f"{settings.BASE_URL}/task/collect/{state_id}/")
state = check_response(res, expected_status_code=200)

# Remove key-value pairs with None value
state["data"] = {key: val for (key, val) in state["data"].items() if val}
if (include_logs is False) and ("log" in state["data"]):
state["data"]["log"] = None

return Interface(retcode=0, data=state)

Expand Down
15 changes: 11 additions & 4 deletions tests/test_task_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,19 @@ def test_task_collection(invoke_as_custom_user, user_factory, new_name):
assert time.perf_counter() - starting_time < COLLECTION_TIMEOUT

res2 = invoke_as_custom_user(
f"task check-collection {state_id}", **new_user
)
assert res2.retcode == 0
assert res2.data["data"]["log"] is None

res3 = invoke_as_custom_user(
f"task check-collection {state_id} --include-logs", **new_user
)
debug(res2.data)
assert res2.retcode == 0j
res2.show()
assert res2.data["data"]["status"] == "OK"
assert res3.retcode == 0
assert res3.data["data"]["log"] is not None

res3.show()
assert res3.data["data"]["status"] == "OK"

res = invoke_as_custom_user("task list", **new_user)
assert len(res.data) == initial_task_list + 14
Expand Down

0 comments on commit 554c454

Please sign in to comment.