teemtee / tmt

Test Management Tool
MIT License
81 stars 122 forks source link

create a provision method aliases #349

Open sopos opened 4 years ago

sopos commented 4 years ago

make tmt X an alias for tmt run -a provision -h X for all X in provision methods

sopos commented 4 years ago

Actually as I'm playing with that it appears I would rather use it for local execution the same as I'm used to with make run and maybe even just tmt run and for running all the tests it might be better to use something like tmt run --all. Or what is actually the recommended way to run a test locally, e.g. on a VM?

psss commented 4 years ago

The simple tmt run is already reserved for the use case of running all available tests. The default provision method is virtual so this would execute tests in a VM. To run tests on your local host just choose the local provision method:

tmt run -a provision -h local

We can definitely introduce shortcuts/aliases, perhaps something like tmt local or tmt debug or even tmt . for the most common use cases but I don't think we're going to change what tmt run without any options does.

sopos commented 4 years ago

tmt . sounds promising to me. The question is what the alias should be for. The complexity of tmt makes the decision harder. Personally, I have following usecases:

Looking at my use cases, it appears that the aliases are basically shortcuts to run -a provision -h <alias_name>. So it means there might be some generic rule - unknown first parameter would act as that alias. And about the scope - . seems to work for tests already to limit the scope to the current directory tree so the meaning would stay the same. Or vice versa, '.' could be implicit while '/' would cause to start at the root no matter where in the tree structure I am - this would save two character in most cases - ' .'.

sopos commented 4 years ago

Looking at tne $ tmt --help output it looks like . should be already implicit default but it is not in case of e.g. tests ls So it seems to me as a bug.

Usage: tmt [OPTIONS] COMMAND [ARGS]...

  Test Management Tool

Options:
  -r, --root PATH  Path to the tree root, '.' by default.
  -v, --verbose    Show more details. Use multiple times to raise verbosity.
  -d, --debug      Provide debugging information. Repeat to see more details.
  -q, --quiet      Be quiet. Exit code is just enough for me.
  --help           Show this message and exit.

Commands:
  run      Run test steps.
  tests    Manage tests (L1 metadata).
  plans    Manage test plans (L2 metadata).
  stories  Manage user stories.
  init     Initialize a new tmt tree.

I filed a seperate issue https://github.com/psss/tmt/issues/371 for this one.

psss commented 4 years ago

Looking at tne $ tmt --help output it looks like . should be already implicit default but it is not in case of e.g. tests ls So it seems to me as a bug.

Current working directory is used as the default place where to start looking for the metadata tree root. This is similar to how git detects root of the git repository. So this is working as expected. By default you always get all available objects, no filter is applied.