[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] valyuta/007 e2f2679c 09/18: Clean up beforehand, not
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] valyuta/007 e2f2679c 09/18: Clean up beforehand, not afterward |
Date: |
Sun, 24 Apr 2022 18:46:14 -0400 (EDT) |
branch: valyuta/007
commit e2f2679c8fbc192355505e769902ffe3c91cc4a7
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Clean up beforehand, not afterward
Formerly, files created as testing artifacts in a temporary directory
were obliterated at the end of the run. This made it less easy to
discern the reason for any failure. And anything left over from an
earlier run became a demonstration of Murphy's Law. And the cleanup
command was in effect
rm "$throwaway_dir"/*
which could have a surprising effect under various circumstances.
Now, the temporary directory is obliterated before its first use, by
rm -rf "$throwaway_dir"
which is less unsafe to copy and paste to the command line--so no old
artifacts can cause trouble, and the files remain for analysis after
the run completes (or fails to complete). This does waste two megabytes
of storage, but anyone who cares can clean up manually.
---
nychthemeral_test.sh | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/nychthemeral_test.sh b/nychthemeral_test.sh
index 737c3d35..3338c343 100755
--- a/nychthemeral_test.sh
+++ b/nychthemeral_test.sh
@@ -363,8 +363,11 @@ java -jar /opt/lmi/third_party/rng/jing.jar -c xrc.rnc
./*.xrc 2>&1 \
| tee "$log_dir"/xrc
# Run the following tests in a throwaway directory so that the files
-# they create can be cleaned up easily.
+# they create can be cleaned up easily. To guard against interference
+# from any files left over from previous runs, destroy that directory
+# first, then recreate it.
throwaway_dir="$log_dir"/tmp
+rm -rf "$throwaway_dir"
mkdir --parents "$throwaway_dir"
cd "$throwaway_dir"
@@ -458,11 +461,6 @@ printf '%b' "\
srcdir=. datadir=. /opt/lmi/src/lmi/mst_to_xst.sh
cmp eraseme.xst eraseme.touchstone
-# Clean up stray output. (The zsh '(N)' glob qualifier turns on
-# null_glob for a single expansion.)
-# shellcheck disable=SC2039,SC3002
-for z in "$throwaway_dir"/*(N); do rm "$z"; done
-
printf '\n# test PETE rebuild\n\n'
# Automatically-generated PETE files are in the repository.
- [lmi-commits] [lmi] valyuta/007 9201d7ef 01/18: Allow "touchstone" files to contain '\t', (continued)
- [lmi-commits] [lmi] valyuta/007 9201d7ef 01/18: Allow "touchstone" files to contain '\t', Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 ba639668 08/18: Reorder format-style map, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 b480490b 13/18: Distinguish two ledger formats, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 9bc66a02 18/18: Revert "Temporarily filter out factor-of-100 errors", Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 e8a5d1a4 17/18: Temporarily filter out factor-of-100 errors, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 f77d9219 05/18: Add two new ledger emission options, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 7e2c48ae 03/18: Filter unexpectedly small system-test discrepancies, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 e3830e7a 07/18: Fix omissions earlier on this branch, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 2a247e37 16/18: Mark or expunge unused fields, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 6fa464d3 02/18: Avoid writing " \n", Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 e2f2679c 09/18: Clean up beforehand, not afterward,
Greg Chicares <=
- [lmi-commits] [lmi] valyuta/007 2dfc93c1 14/18: Rearrange ledger formats, Greg Chicares, 2022/04/24
- [lmi-commits] [lmi] valyuta/007 847f3e0f 15/18: Use a more reasonable format for an unused field, Greg Chicares, 2022/04/24