Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tldr tmt pages #3176

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/tldr/pages/linux/tmt-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# tmt run

> `run` command is used to execute test steps. By default all test steps are run. See also: `tmt`, `tmt-try`.
> More information: <https://tmt.readthedocs.io/en/stable/overview.html#run>.

- Run all test steps for each plan:

`tmt run`

- Run selected plans and tests:

`tmt run plan -n <plan_name> test -n <test_name>`

- Show what tests a specific plan would run:

`tmt run -vv discover plan -n <plan_name>`

- Show test results from the last run in a web browser:

`tmt run -l report --how html --open`

- Add context to a test run:

`tmt --context foo=bar --context baz=qux,quux run ...`

- Allow only specific provision plugins:

`tmt run -a provision --allowed-how 'container|local|virtual'`

- Disable output capturing and interact directly with the test from the terminal:

`tmt run --all execute --how tmt --interactive`
Comment on lines +26 to +32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these are a bit too specialized, and can depend on the implementation. How about having a tl;dr part that is more abstract demystifying what the keywords do

Suggested change
- Allow only specific provision plugins:
`tmt run -a provision --allowed-how 'container|local|virtual'`
- Disable output capturing and interact directly with the test from the terminal:
`tmt run --all execute --how tmt --interactive`
- Overwrite (or add) a step that is otherwise read from the `.fmf` definition
`tmt run -a <discover|provision|prepare|...> (--insert) ...`


- Use dry mode to see what actions would happen and use highest verbosity:

`tmt run --dry -vvv`
32 changes: 32 additions & 0 deletions docs/tldr/pages/linux/tmt-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# tmt try

> Quickly experiment with tests and environments. See also: `tmt`, `tmt-run`.
> More information: <https://tmt.readthedocs.io/en/stable/stories/cli.html#try>.

- Run a test stored in current working directory:

`cd tests/core/smoke && tmt try`

- Use a specific operating system:

`tmt try fedora-41`

- Try a test in a container:

`tmt try fedora@container`

- Use custom filter to select tests instead of using cwd:

`tmt try --test feature`

- Do nothing, just provision the guest and ask what to do:

`tmt try --ask`

- Explicitly ask for login only if there are tests around:

`tmt try --login`

- List all available options:

`tmt try --help`
36 changes: 36 additions & 0 deletions docs/tldr/pages/linux/tmt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# tmt

> Test Management Tool for creating, running and debugging tests. See also: `tmt-run`, `tmt-try`.
> More information: <https://tmt.readthedocs.io>.

- View documentation for `tmt run`:

`tldr tmt-run`

- View documentation for `tmt try`:

`tldr tmt-try`
Comment on lines +6 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- View documentation for `tmt run`:
`tldr tmt-run`
- View documentation for `tmt try`:
`tldr tmt-try`
- View sub-commands documentations `tmt <run|try>`:
`tldr tmt-<run|try>`

Should we consolidate these?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, maybe. In order to replace it with different example? Otherwise it might be more understandable as is.


- Initialize `tmt` files/project structure:

`tmt init`

- Create a new test with optional arguments like template and link:

`tmt create --template beakerlib --link verifies:issue#1234`

- List available tests, plans, or stories:

`tmt <test|plan|story> ls [<pattern>]`

- Validate metadata:

`tmt lint`
Comment on lines +26 to +28
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Validate metadata:
`tmt lint`
- Validate `tmt` files:
`tmt lint`

Could be more specific here I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for being more specific. I'm sure @psss will have the perfect words. :)


- Docs, test & implementation coverage for selected stories:

`tmt story coverage [<pattern>]`

- Use filter:

`tmt tests ls --filter tag:foo --filter tier:0`
Comment on lines +34 to +36
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think -c context would be more interesting to document, e.g. "Tmt tests can change due to the context in which it runs"

tmt -c distro=foo tests show

This would be overlapping with the tmt run documented part though 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

Loading