Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove verbose query parameter #730

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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