Add qmtexec command for running QMT tests directly
This adds a new command qmtexec
which can be used to run QMT files. It only runs the basic command and doesn't include any validation of the result.
This was originally going to just be qmtlbexec
for lbexec QMT tests however it's trivial to allow it to run all qmt files. Hopefully this also makes it more discoverable as I know when I first saw a qmt file the first thing I tried was qmt<TAB>
.
Closes #240 (closed)
Usage
There are two modes of operation, one which actually runs the command immediately:
$ /LHCb/run qmtexec LHCb/GaudiConf/python/GaudiConf/QMTest/tests/basic.qmt
Hello world⏎
$ ./Moore/run qmtexec Moore/Hlt/RecoConf/tests/qmtest/hlt2_fast_reco.qmt
# Truncated
$ ./DaVinci/run qmtexec DaVinci/DaVinciTutorials/tests/qmtest/test_tutorial7_multiple_sel_lines.qmt
# Truncated
Or just print the command that would have been run (including any quoting you might need):
$ ./LHCb/run qmtexec --prepare-only LHCb/GaudiConf/python/GaudiConf/QMTest/tests/basic.qmt
echo -n 'Hello world'
$ ./Moore/run qmtexec --prepare-only Moore/Hlt/RecoConf/tests/qmtest/hlt2_fast_reco.qmt
gaudirun.py '$MOOREROOT/tests/options/mdf_input_and_conds_hlt2.py' '$MOOREROOT/tests/options/download_mdf_input.py' '$RECOCONFROOT/options/hlt2_fast_reco.py'
$ ./LHCb/run qmtexec --prepare-only -C LHCb/CaloFuture/CaloFutureDAQ/tests/qmtest/raw-to-digit.qmt
cd LHCb/CaloFuture/CaloFutureDAQ/tests/qmtest
/home/cburr/stack/Gaudi/InstallArea/x86_64_v2-centos7-gcc11-opt/bin/gaudirun.py /tmp/cburr/qmtexec-pcwq5fos.py
$ ./DaVinci/run qmtexec --prepare-only DaVinci/DaVinciTutorials/tests/qmtest/test_tutorial7_multiple_sel_lines.qmt
lbexec DaVinciTutorials.tutorial7_multiple_sel_lines:main /tmp/cburr/lbexec-hh9l43bv.yaml
Caveats
The only caveat I currently know of is that some tests depend on the current working directory being as expected, though I'm not convinced that's a desirable feature to add. If it's a problem we can always add a warning to stderr if the directory looks like it might be a problem. This has now been implemented as a --chdir
and -C
flag.
Example:
$ ./LHCb/run qmtexec --prepare-only LHCb/GaudiConf/tests/qmtest/gaudiconf.qms/iohelper.qmt
python ../test_iohelper.py
$ ./LHCb/run qmtexec LHCb/GaudiConf/tests/qmtest/gaudiconf.qms/iohelper.qmt
python: cant open file '/home/cburr/stack/../test_iohelper.py': [Errno 2] No such file or directory
$ cd LHCb/GaudiConf/tests/qmtest
$ ../../../run qmtexec gaudiconf.qms/iohelper.qmt
# Test runs sucessfully
Merge request reports
Activity
added testing label
assigned to @cburr
mentioned in issue #240 (closed)
added RTA label
- Resolved by Chris Burr
Thanks for the quick action @cburr
The first usage snippet probably shouldn't have the
--prepare-only
flag right? So without the flag it executes and with the flag it prints the command?TBH, I'm not sure if I understand the motivation of making this its own executable, what are the benefits in your opinion compared to just having
lbexec
do exactly this if it's given a.qmt
file?
I'm a little worried this method will lead to us in the end having a bunch of small scripts to reintroduce featuresgaudirun.py
had, and then the user always has to figure out which one to use.
This is making the users live harder to safe a little development complexity, which IMHO is the wrong tradeoff.But given that this user facing API I also think, the best we can do is maybe get a few more opinions on this. Maybe I am the only one seeing a problem here
So let's ping a few more people: @sstahl @jonrob @gunther
- Resolved by Chris Burr
@cburr Do you want to get this tested or better to wait for a green light from people involved?
mentioned in issue Moore#456 (closed)
added 71 commits
-
3fdf935b...72572e25 - 68 commits from branch
master
- 33b5ba07 - Add qmtexec command for running QMT tests directly
- f900623f - Support writing options from gaudirun qmtests
- ce2c2105 - Add --chdir/-C argument to qmtexec
Toggle commit list-
3fdf935b...72572e25 - 68 commits from branch
- Resolved by Chris Burr
/ci-test
added ci-test-triggered label
- [2022-08-05 11:29] Validation started with lhcb-master-mr#5344
mentioned in issue Moore#465 (closed)
mentioned in merge request !3725 (merged)