osmith submitted this change.

View Change

Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
testenv: improve output for missing -c argument

When a testsuite has multiple testenv.cfg files, the user needs to
explicitly choose a config, or "-c all" for all configs. Improve the
help output to directly print the arguments that need to be passed,
instead of printing the config file names. Mention that wildcards can be
used too.

Old:
[testenv] Found multiple testenv.cfg files:
[testenv] * testenv_generic.cfg
[testenv] * testenv_sccplite.cfg
[testenv] * testenv_vamos.cfg
[testenv] Select a specific config (e.g. '-c generic') or all ('-c all')

New:
[testenv] Found multiple testenv.cfg files, use one of:
[testenv] -c generic
[testenv] -c sccplite
[testenv] -c vamos
[testenv] You can also select all of them (-c all) or use the * character as wildcard.

Related: OS#6494
Change-Id: I3f273caff702b33d3d74a9e5c8d77b22f27d7cfc
---
M _testenv/testenv/testenv_cfg.py
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/_testenv/testenv/testenv_cfg.py b/_testenv/testenv/testenv_cfg.py
index 8bb4119..ea25614 100644
--- a/_testenv/testenv/testenv_cfg.py
+++ b/_testenv/testenv/testenv_cfg.py
@@ -209,11 +209,10 @@
sys.exit(1)

if len(ret) > 1 and not testenv.args.config:
- logging.error("Found multiple testenv.cfg files:")
+ logging.error("Found multiple testenv.cfg files, use one of:")
for path in ret:
- logging.error(f" * {os.path.basename(path)}")
- example = os.path.basename(ret[0]).split("_", 1)[1].split(".cfg", 1)[0]
- logging.error(f"Select a specific config (e.g. '-c {example}') or all ('-c all')")
+ logging.error(f" -c {os.path.basename(path).replace('testenv_', '', 1).replace('.cfg', '')}")
+ logging.error("You can also select all of them (-c all) or use the * character as wildcard.")
sys.exit(1)

return ret

To view, visit change 38520. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I3f273caff702b33d3d74a9e5c8d77b22f27d7cfc
Gerrit-Change-Number: 38520
Gerrit-PatchSet: 4
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>