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

Propagate result phase into the report plugins #3094

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

seberm
Copy link
Collaborator

@seberm seberm commented Jul 18, 2024

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • adjust plugin docstring
  • modify the json schema
  • mention the version
  • include a release note

This is a prerequisite for report plugins to support "subresults" aka phases.

Related to:

@seberm seberm marked this pull request as ready for review July 18, 2024 12:31
@seberm seberm marked this pull request as draft July 18, 2024 13:07
@seberm seberm self-assigned this Jul 18, 2024
@seberm seberm added the code | trivial A simple patch - a couple of lines, an easy-to-understand change, a typo fix. label Jul 18, 2024
@seberm seberm marked this pull request as ready for review July 18, 2024 13:23
Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

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

Nice kick-off! Thanks. Looks good. Let's merge this soon to unblock experimeting in #3095 and with result presentation in individual report plugins.

@psss psss added area | results Related to how tmt stores and shares results status | blocking other work An important pull request, blocking other pull requests or issues labels Jul 18, 2024
@psss
Copy link
Collaborator

psss commented Jul 18, 2024

This one is really trivial, proposing to squeeze into 1.35.

@psss psss added this to the 1.35 milestone Jul 18, 2024
@psss psss added the ci | full test Pull request is ready for the full test execution label Jul 18, 2024
tmt/result.py Outdated Show resolved Hide resolved
@seberm seberm force-pushed the feature/propagate-phase branch 2 times, most recently from 528ea2b to 954992a Compare July 19, 2024 08:33
@psss psss requested a review from happz July 19, 2024 11:51
@seberm
Copy link
Collaborator Author

seberm commented Jul 22, 2024

Hello @happz @psss ,
I am still thinking about a tiny modification - I think we probably should create a new type for phase checks, e.g. PhaseCheckResult(CheckResult). This would allow us to easily differentiate between the result checks and the result phase checks, especially in the report plugins.

Do you agree?

@happz
Copy link
Collaborator

happz commented Jul 22, 2024

Hello @happz @psss , I am still thinking about a tiny modification - I think we probably should create a new type for phase checks, e.g. PhaseCheckResult(CheckResult).

What would be the difference between CheckResult and the new PhaseCheckResult class? The existing classes usually add new fields on top of their base class: CheckResult adds event, Result adds context and serial_number and so on, so what new fields would PhaseCheckResult carry that Check lacks?

This would allow us to easily differentiate between the result checks and the result phase checks, especially in the report plugins.

Test check results live in the check list, and phase check results live in the phases[N].check list. The structure, the fields describing the check outcome are the same, the position provides the context.

Do you agree?

Not as of now. Can you demonstrate in what way would different classes improve the code, e.g. making it simpler, easier to read and maintain, or easy to check for linters?

@seberm
Copy link
Collaborator Author

seberm commented Jul 22, 2024

The existing classes usually add new fields on top of their base class: CheckResult adds event, Result adds context and serial_number and so on, so what new fields would PhaseCheckResult carry that Check lacks?

It would carry no new fields, just a type.

Not as of now. Can you demonstrate in what way would different classes improve the code, e.g. making it simpler, easier to read and maintain, or easy to check for linters?

It would allow me to easily differentiate between the result types in display_outcome(result: BaseResult) -> None and use this method to show all kinds of results. It's just an early draft:

If you still think this does not make sense, I will try to find a different solution.

@happz
Copy link
Collaborator

happz commented Jul 23, 2024

The existing classes usually add new fields on top of their base class: CheckResult adds event, Result adds context and serial_number and so on, so what new fields would PhaseCheckResult carry that Check lacks?

It would carry no new fields, just a type.

Ack.

Not as of now. Can you demonstrate in what way would different classes improve the code, e.g. making it simpler, easier to read and maintain, or easy to check for linters?

It would allow me to easily differentiate between the result types in display_outcome(result: BaseResult) -> None and use this method to show all kinds of results. It's just an early draft:

I see, makes sense. Let's try it then and see how it goes.

Copy link
Collaborator

@thrix thrix left a comment

Choose a reason for hiding this comment

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

LGTM

@happz happz added the status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish. label Jul 23, 2024
@seberm seberm mentioned this pull request Jul 23, 2024
4 tasks
@happz
Copy link
Collaborator

happz commented Jul 23, 2024

Apparently unrelated failures in tests, going to merge this one and we'll see.

@happz happz merged commit f7152c8 into teemtee:main Jul 23, 2024
18 of 19 checks passed
The-Mule pushed a commit to The-Mule/tmt that referenced this pull request Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area | results Related to how tmt stores and shares results ci | full test Pull request is ready for the full test execution code | trivial A simple patch - a couple of lines, an easy-to-understand change, a typo fix. status | blocking other work An important pull request, blocking other pull requests or issues status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants