teemtee / tmt

Test Management Tool
MIT License
80 stars 121 forks source link

''require" does not take effect when I run test like this #2413

Closed guoguojenna closed 10 months ago

guoguojenna commented 10 months ago

My require: python3-pyverbs, but the package python3-pyverbs was not installed when I ran test as below. Could you help to check? Thanks.

$ tmt run -e "IBDEV=mlx5_0 PORT=1" discover -h fmf provision -h connect -g rdma-qe-41.rdma.lab.eng.rdu2.redhat.com -u root -p redhat execute -h tmt tests -n "rdma/pyverbs-tests-2" plans --default -d -vvv

$ cat main.fmf 
summary: KS-RDMA-TC:pyverbs-tests-2
description: pyverbs-tests-2
contact: Zhaojuan Guo <zguo@redhat.com>
component:
  - rdma
framework: shell
test: bash -x ./runtest.sh
require: python3-pyverbs
duration: 10m
tag:
  - regression
  - functional
  - cki
tier: 1
environment:
    ibdev: $IBDEV
    port: $PORT
lukaszachy commented 10 months ago

Either you are missing '-a' or '--all' as run argument or you need to specify 'prepare' on the command line (depends if you want to run 'finish' and 'report' as well).

The 'prepare' step didn't run (and that step is responsible for installing requires). See https://tmt.readthedocs.io/en/stable/examples.html#select-steps for more details but tl;dr: is "tmt run -a" is necessary if step names are used on the command line. Otherwise just those selected steps are run.

Just for the record: Other options to enable steps are --until, --since, --after and --before. There is even --skip.

guoguojenna commented 10 months ago

Either you are missing '-a' or '--all' as run argument or you need to specify 'prepare' on the command line (depends if you want to run 'finish' and 'report' as well).

The 'prepare' step didn't run (and that step is responsible for installing requires). See https://tmt.readthedocs.io/en/stable/examples.html#select-steps for more details but tl;dr: is "tmt run -a" is necessary if step names are used on the command line. Otherwise just those selected steps are run.

Just for the record: Other options to enable steps are --until, --since, --after and --before. There is even --skip.

Thank you! I thought once 'require' is detected, than it can be handled before or during execution. Actually, we have to explicitly specify the steps(prepare or --all) in the command line.