Skip to content

Commit a411aae

Browse files
Merge pull request #6710 from oliver-sanders/reinstall-log
reinstall: log reinstallation in the reinstall log
1 parent c523752 commit a411aae

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

changes.d/6710.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Restore `rsync` output into the workflow reinstallation log.

cylc/flow/install.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ def reinstall_workflow(
224224
# * command is constructed via internal interface
225225
stdout, stderr = (i.strip() for i in proc.communicate())
226226

227+
reinstall_log.info(
228+
f"Copying files from {source} to {rundir}"
229+
f"\n{stdout}"
230+
)
227231
if proc.returncode != 0:
228232
raise WorkflowFilesError(
229233
f'An error occurred reinstalling from {source} to {rundir}'

tests/functional/cylc-reinstall/01-file-transfer.t

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
if ! command -v 'tree' >'/dev/null'; then
2222
skip_all '"tree" command not available'
2323
fi
24-
set_test_number 9
24+
set_test_number 13
2525

2626
# Need to override any symlink dirs set in global.cylc:
2727
create_test_global_config "" "
@@ -41,6 +41,7 @@ make_rnd_workflow
4141
pushd "${RND_WORKFLOW_SOURCE}" || exit 1
4242
mkdir .git .svn dir1 dir2-be-removed
4343
touch .git/file1 .svn/file1 dir1/file1 dir2-be-removed/file1 file1 file2
44+
echo '01-*' > .cylcignore # filter out test files
4445
run_ok "${TEST_NAME}" cylc install
4546

4647
tree_excludes='*.log|01-file-transfer*|rose-suite*.conf|opt'
@@ -68,12 +69,12 @@ touch new_dir/new_file1 new_dir/new_file2
6869
rm -rf dir2-be-removed file2
6970
run_ok "${TEST_NAME}-reinstall" cylc reinstall "${RND_WORKFLOW_NAME}/run2"
7071
REINSTALL_LOG="$(find "${RND_WORKFLOW_RUNDIR}/run2/log/install" -type f -name '*reinstall.log')"
71-
grep_ok "
72-
del. dir2-be-removed/file1
73-
del. file2
74-
send new_dir/
75-
send new_dir/new_file1
76-
send new_dir/new_file2" "${REINSTALL_LOG}"
72+
log_scan "${TEST_NAME_BASE}-reinstall-log" "$REINSTALL_LOG" 1 0 \
73+
'del. dir2-be-removed/file1' \
74+
'del. file2' \
75+
'send new_dir/$' \
76+
'send new_dir/new_file1' \
77+
'send new_dir/new_file2'
7778

7879
tree -a -v -I "${tree_excludes}" --charset=ascii --noreport "${RND_WORKFLOW_RUNDIR}/run2" > 'after-reinstall-run2-tree.out'
7980
cmp_ok 'after-reinstall-run2-tree.out' <<__OUT__

0 commit comments

Comments
 (0)