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

Add tldr tmt pages #3176

wants to merge 2 commits into from

Conversation

martinhoyer
Copy link
Collaborator

tldr.sh linter accepts only 8 examples and I find it quite hard to pick which ones to cut.
I'm thinking it might be a good idea to create a tmt run subcommand page in the same fashion as tmt try. What do you think?

I also have questions about maintainability.

  • do we keep .md files in tmt repo and/or in tldr-pages?
  • generate them somehow?
  • does it make sense to have tmt command printing the same info?

Resolves #968

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage

@martinhoyer martinhoyer added documentation Improvements or additions to documentation status | discuss Needs more discussion before closing code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. labels Aug 28, 2024
@martinhoyer martinhoyer self-assigned this Aug 28, 2024
Copy link
Contributor

@LecrisUT LecrisUT left a comment

Choose a reason for hiding this comment

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

👍 for separate tmt-run page. After the split you should be able to fit tmt <> show and tmt init/tmt <> create

Comment on lines 34 to 36
- View documentation for tmt-try:

`tldr tmt-try`
Copy link
Contributor

Choose a reason for hiding this comment

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

How does the [See also: \command1`, `command2`](https://github.com/tldr-pages/tldr/blob/main/CONTRIBUTING.md#subcommands) work from their documentation? I think we could combine the instructions for both tmt runandtmt try` into one snippet?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, I was following their example. +1 for "See also"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

Comment on lines 18 to 24
- 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`
Copy link
Contributor

Choose a reason for hiding this comment

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

How about documenting first:

  • tmt run <discover|provision|prepare|...>: as run only the step
  • tmt run -a <discover|provision|prepare|...>: as run all original steps and override
  • Example1: tmt run -v discover: Show all tests that would run


- Add context to a test run:

`tmt -c foo=bar -c baz=qux,quux run [...]`
Copy link
Contributor

Choose a reason for hiding this comment

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

I would put <run|...> to indicate that you can use this for other things, e.g. show would give you the expanded format after adjust is applied.

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.

@LecrisUT
Copy link
Contributor

I also have questions about maintainability.

* do we keep .md files in tmt repo and/or in tldr-pages?

The former is doable. We can use peter-evans/create-pull-request to create an automated PR when a new release is cut. I can customize it so that it also creates an immortal PR for review as well. (my example, better example)

* generate them somehow?

* does it make sense to have tmt command printing the same info?

I don't think it would be easy to do, e.g. -c is not easy to link to, and there are the tmt <plans|tests|...> variants.

Comment on lines +6 to +12
- View documentation for `tmt run`:

`tldr tmt-run`

- View documentation for `tmt try`:

`tldr tmt-try`
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.

docs/tldr/pages/linux/tmt.md Outdated Show resolved Hide resolved
Comment on lines +26 to +28
- Validate metadata:

`tmt lint`
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. :)

Comment on lines +34 to +36
- Use filter:

`tmt tests ls --filter tag:foo --filter tier:0`
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

Comment on lines +26 to +32
- 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`
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) ...`

@happz happz added this to the 1.37 milestone Sep 6, 2024
Co-authored-by: Cristian Le <github@lecris.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. documentation Improvements or additions to documentation status | discuss Needs more discussion before closing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a tldr version of the tmt man page
3 participants