tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Improve the design of the checks and phases in HTML report plugin

Open seberm opened this issue 1 year ago • 4 comments

I tried to fix the colspan of the main table, added a new column "Actions" into the table, and added the possibility to show/hide the checks and subresults row for each result using the toggle buttons.

The https://github.com/teemtee/tmt/pull/3094 is a prerequisite to test the code in this PR. To generate the subresults in the attached screenshots, I have for now faked the subresult data in the plans/example/execute/results.yaml as following:

...
    phase:
      - name: /tests/mine-rep-multi/test/good
        result: pass
        end-time: "2024-07-17T14:16:28.735039+00:00"
        __class__:
            module: tmt.result
            name: PhaseResult
      - name: /tests/mine-rep-multi/test/fail
        result: fail
        end-time: "2024-07-17T14:16:28.739501+00:00"
        __class__:
            module: tmt.result
            name: PhaseResult
      - name: /tests/mine-rep-multi/test/weird
        result: warn
        end-time: "2024-07-17T14:16:28.743959+00:00"
        __class__:
            module: tmt.result
            name: PhaseResult

    check:
      - name: dmesg
        result: skip
        note:
        log: []
        start-time: '2024-07-18T12:18:06.339547+00:00'
        end-time: '2024-07-18T12:18:06.339574+00:00'
        duration: 00:00:00
        event: before-test
        __class__:
            module: tmt.result
            name: CheckResult
...

Related to:

  • https://github.com/teemtee/tmt/issues/2826

Blocked by:

  • https://github.com/teemtee/tmt/pull/3106

TODOs:

  • [x] Somehow also show the phase checks.

Pull Request Checklist

  • [x] 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

Example screenshots:

3 4

seberm avatar Jul 18 '24 12:07 seberm

The phase checks should be also shown. Example:

phase-checks

seberm avatar Jul 23 '24 08:07 seberm

Just a note: in the light of renaming "phase" to "subresult", either this PR or https://github.com/teemtee/tmt/pull/3106 will require changes to produce the consistent subresults-in-html-report picture. https://github.com/teemtee/tmt/pull/3106 seems to be slightly closer to being merged, how about making it a prerequisite for this PR?

happz avatar Aug 12 '24 15:08 happz

Just a note: in the light of renaming "phase" to "subresult", either this PR or #3106 will require changes to produce the consistent subresults-in-html-report picture. #3106 seems to be slightly closer to being merged, how about making it a prerequisite for this PR?

The #3106 is the prerequisite for this PR (see "Blocked by" section in my first comment on this PR. I will rebase the changes on top of #3106. The same applies for #3107.

seberm avatar Aug 12 '24 15:08 seberm

Just an update of screenshots. The #3106 is still a prerequisite. My testing data:

...
    subresult:
      - name: /tests/mine-rep-multi/test/good
        result: pass
        end-time: "2024-07-17T14:16:28.735039+00:00"
        __class__:
            module: tmt.result
            name: SubResult
      - name: /tests/mine-rep-multi/test/fail
        result: fail
        end-time: "2024-07-17T14:16:28.739501+00:00"
        __class__:
            module: tmt.result
            name: SubResult
      - name: /tests/mine-rep-multi/test/weird
        result: warn
        end-time: "2024-07-17T14:16:28.743959+00:00"
        __class__:
            module: tmt.result
            name: SubResult
        check:
          - name: dmesg
            result: skip
            note:
            log: []
            start-time: '2024-07-22T10:34:41.135249+00:00'
            end-time: '2024-07-22T10:34:41.135279+00:00'
            duration: 00:00:00
            event: before-test
            __class__:
                module: tmt.result
                name: CheckSubResult
          - name: dmesg
            result: skip
            note:
            log: []
            start-time: '2024-07-22T10:34:41.393797+00:00'
            end-time: '2024-07-22T10:34:41.393819+00:00'
            duration: 00:00:00
            event: after-test
            __class__:
                module: tmt.result
                name: CheckSubResult
    check:
      - name: dmesg
        result: skip
        note:
        log: []
        start-time: '2024-08-13T12:00:22.021926+00:00'
        end-time: '2024-08-13T12:00:22.021978+00:00'
        duration: 00:00:00
        event: before-test
        __class__:
            module: tmt.result
            name: CheckResult
      - name: dmesg
        result: skip
        note:
        log: []
        start-time: '2024-08-13T12:00:22.268393+00:00'
        end-time: '2024-08-13T12:00:22.268414+00:00'
        duration: 00:00:00
        event: after-test
        __class__:
            module: tmt.result
            name: CheckResult

...

Screenshot 2024-08-13 at 14-53-21 Test results of _plans_example


Screenshot 2024-08-13 at 14-55-24 Test results of _plans_example-2

seberm avatar Aug 13 '24 13:08 seberm

I think I should maybe add some tests which will fake the subresults data and check the html result. What do you think?

seberm avatar Aug 22 '24 12:08 seberm

I think I should maybe add some tests which will fake the subresults data and check the html result. What do you think?

Good idea, deserves a test.

happz avatar Aug 22 '24 12:08 happz

I think I should maybe add some tests which will fake the subresults data and check the html result. What do you think?

Good idea, deserves a test.

I’ve added the tests. This PR should be ready to merge once the tests pass.

seberm avatar Aug 26 '24 12:08 seberm

Unrelated failures, merging.

happz avatar Aug 27 '24 18:08 happz