[PATCH 0/6] Journaling cleanups, custom TMP dir
by Jiri Jaburek
This is a series of cleanups/rewrites of the journaling subsystem,
ultimately leading to custom BEAKERLIB_DIR specification (its usage
from the external environment), taking several side benefits along
the way.
Historically, "journalling.py" had --id option for Beaker test ID
specification, but was not really environment-independent (PKGNVR,
BEAKERLIB variables). Each invocation had to pass --id.
This made sense for beaker jobs, /tmp/beakerlib-$id/journal.xml
(hardcoded) was used as temp dir.
During manual runs, however, a randomly generated and created (mktemp)
directory /tmp/beakerlib-XXXXXXX was created and the XXXXXXX used
as "run_id" (instead of Beaker-provided test run number).
There was whole lot of an infrastructure in journal.sh to support this
kind of hack, like BEAKERLIB_RUN, which was then contained in
BEAKERLIB_DIR's path. This would make custom specification of
BEAKERLIB_DIR quite complex.
This series therefore removes BEAKERLIB_RUN, makes "journalling.py"
get the test run number from TESTID env variable directly, which
eliminates the need for --id passing infrastructure inside
journalling.py and also solves the hardcoded /tmp/beakerlib-%s/journal.xml
in it, by using BEAKERLIB_JOURNAL directly.
That simplifies temporary directory management a lot, making custom
BEAKERLIB_DIR specification possible, along with certain side advantages.
BEAKERLIB_RUN has been removed, BEAKERLIB_DIR management is done only
by journal.sh, which exports BEAKERLIB_JOURNAL for "journalling.py".
Furthermore, test_id is now present in final journal.xml only during
Beaker runs (where TESTID is available). This might lead to a potential
API change, assuming journal.xml is considered to be an API.
Specifics for each commit/change are in respective commit messages,
the series has been tested both in Beaker and during manual test runs,
test coverage for custom BEAKERLIB_DIR specification has been made.
Thanks for review.
--jjk
Jiri Jaburek (6):
Use BEAKERLIB_JOURNAL instead of hardcoded path with testid
Use TESTID env var, remove --id, restructuralize code
Remove BEAKERLIB_RUN from journal.sh completely
Do no use testid at all if TESTID env var is unset
Document Test run ID as a number rather than a string
Allow custom specification of BEAKERLIB_DIR
src/beakerlib.sh | 2 +-
src/journal.sh | 38 +++++++-------
src/python/journalling.py | 127 ++++++++++++++++++++++++----------------------
src/test/journalTest.sh | 43 ++++++++++++----
4 files changed, 122 insertions(+), 88 deletions(-)
--
1.7.11.2
11 years, 6 months
[PATCH 0/2] Minor code cleanups
by Jiri Jaburek
Those two minor changes have been found while doing somewhat bigger
rewrite, but I'd like to submit them separately, because they're not
related to that rewrite.
The first change finally adds meaningful error descriptions, possibly
making smaller number of people confused. I personally stumbled upon
those errors when *using* beakerlib, so it's not a "will never happen"
kind of scenario.
The second one removes useless local TID variable. Probably an unfinished
feature to use "debugging" when TESTID is unset (local test run).
Since I found no other related code, since this problem is already dealt
with in a different way and also since I've rewritten code related to
this area, it makes less than no sense to keep this TID local variable
without further reasons.
-- jjk
Jiri Jaburek (2):
Use meaningful messages for argument parsing errors
Remove unused local variable `TID' from rljAddMessage
src/journal.sh | 1 -
src/python/journalling.py | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
--
1.7.11.2
11 years, 7 months