gen_test_desc.py: Create .testprop files in parallel with .test
These files have Jenkins property file format, specifically with
keys TEST_CONFIG (original test config) and TEST_DESC
(expanded/normalized test config). Using them will allow better
interfacing with Jenkins job parameters. Currently, a .test file
is posted as "binaryfile" parameter where file name encodes
TEST_DESC, while the content - TEST_CONFIG. Doing it this way
is not entirely clear to someone not initimately familiar with
Jenkins details (e.g. it's not easy to suppose that when passing
a file parameter, Jenkins passes not just the content, but also
a verbatim file name). Besides, passing it this way then requires
extra clicks to the file content (and again, only content is visible,
not the filename, which makes it all confusing).
This change will allow to pass both values as normal string parameters,
easily and clearly visible in Jenkins UI.
For now, value of TEST_DESC matches the previous filename, to minimize
corresponding changes to the tf-a-builder job which parses it. It may
be cleaned up in the future (to be more human-readable).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Change-Id: Ifa07e159701dd2462fdcab3c78d07161676ea6f5
diff --git a/script/gen_test_desc.py b/script/gen_test_desc.py
index 30f0633..7ee07b8 100755
--- a/script/gen_test_desc.py
+++ b/script/gen_test_desc.py
@@ -65,10 +65,17 @@
# Create descriptor. Write the name of the original test config as its
# content.
- desc = os.path.join(workspace, "%".join([str(num_spawn).zfill(4), os.path.basename(group),
- test_config + TEST_SUFFIX]))
+ desc_base = "%".join([str(num_spawn).zfill(4), os.path.basename(group),
+ test_config + TEST_SUFFIX])
+ desc = os.path.join(workspace, desc_base)
with open(desc, "wt") as fd:
print(test, file=fd)
+ # Create .testprop file for smoother integration with Jenkins
+ # (allows to pass test config as a normal string param instead
+ # of binary file which takes extra clicks to view).
+ with open(desc + "prop", "wt") as fd:
+ print("TEST_CONFIG={}".format(test), file=fd)
+ print("TEST_DESC={}".format(desc_base), file=fd)
num_spawn += 1