Skip to content

Commit

Permalink
Merge pull request #2028 from fractal-analytics-platform/2023-wrong-n…
Browse files Browse the repository at this point in the history
…ewline-escaping-in-part-of-task-collection-log

Fix wrong newline escaping Task collection log
  • Loading branch information
tcompa authored Nov 13, 2024
2 parents c7e47ae + 640427d commit 3703ba2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
* Add `FractalSSH.remote_exists` method (\#2008).
* Testing:
* Drop `fetch-depth` from `checkout` in GitHub actions (\#2039).

* Internal:
* Fix escaping of newlines within f-strings (\#2028).

# 2.8.1

Expand Down
6 changes: 4 additions & 2 deletions fractal_server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ def execute_command_sync(
stdout = res.stdout
stderr = res.stderr
logger.debug(f"{returncode=}")
logger.debug(f"{stdout=}")
logger.debug(f"{stderr=}")
logger.debug("STDOUT:")
logger.debug(stdout)
logger.debug("STDERR:")
logger.debug(stderr)
if res.returncode != 0:
logger.debug(f"ERROR in subprocess call to '{command}'")
raise RuntimeError(
Expand Down
4 changes: 4 additions & 0 deletions tests/v2/03_api/test_api_task_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ async def test_task_collection_from_wheel(
assert res.status_code == 200
task_group_activity = res.json()
debug(task_group_activity)

assert task_group_activity["log"].count("\n") > 0
assert task_group_activity["log"].count("\\n") == 0

assert task_group_activity["status"] == "OK"
assert task_group_activity["timestamp_ended"] is not None
# Check that log were written, even with CRITICAL logging level
Expand Down

0 comments on commit 3703ba2

Please sign in to comment.