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

Save the subresults for tmt-report-result #3200

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

seberm
Copy link
Collaborator

@seberm seberm commented Sep 9, 2024

All the results generated by tmt-report-results become objects of tmt.result.SubResult and they get assigned under a parent tmt.Result. Also, set the TESTID and BEAKERLIB_COMMAND_REPORT_RESULT test environment variables, so every call of beakerlib's rlPhaseEnd macro becomes a subresult.

Related to:

TODOs:

  • Try to find all the possible documentation places where this needs to be modified/mentioned.
  • Add tests
  • Fix existing tests / fix the code to pass tests

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

@seberm seberm added enhancement area | results Related to how tmt stores and shares results labels Sep 9, 2024
@seberm seberm self-assigned this Sep 9, 2024
@seberm seberm added the ci | full test Pull request is ready for the full test execution label Sep 9, 2024
@@ -135,6 +139,12 @@ items:
duration:
$ref: "#/definitions/duration"

# TODO: Fixme? e.g. using ref. otherwise I am getting the error:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@happz Aren't we missing the data-path in the result and subresult schemas? Otherwise, I'm still getting the "result format violation" errors.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Result schema is definitely missing data-path key, subresults shouldn't have one, IIUIC, data path is a path in which tmt stores test data and info and stuff, so there is no dedicated subpath for a subresult.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Are you sure about the data-path in the subresult? I do not have much insight, but it seems the subresults generated by tmt-report-result are using this field when the tmt-report-results.yaml gets created:

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmmm, that does not look right. TMT_TEST_EXE is ${TMT_TREE/tree/execute}, TMT_TEST_DATA is said to be "Path to the directory where test can store logs and other artifacts generated during its execution." and I can't imagine that ${TMT_TEST_DATA/$TMT_TREE/tree/execute} could be anything sane.

@psss WDYT? There is "test data" for the test, TMT_TEST_DATA points to it, but data paths for Beakerlib phases? tmt does not manage those, in custom results we do not even have any idea whether the test used any subresult data paths, so we don't touch them, this seems like a mistake to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also, do you think we should somehow limit the data-path using a pattern in the schema?

For a parent result, the value is always a relative path (data/guest/default-0/tests/example-1/data). For subresults, the data-path seems to always start with pattern: "^/" - it's not relative, but absolute where root starts at 'execute' directory, e.g. /data/guest/default-0/tests/example-1/data.

Isn't it a bug? Also, the subresult's data-path seems to be always the same as the parent data-path (without / prefix).

@seberm seberm added this to the 1.38 milestone Sep 10, 2024
Copy link
Collaborator Author

@seberm seberm left a comment

Choose a reason for hiding this comment

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

I've tried to change the method docstrings, releases.rst and report-result.fmf story to reflect the subresults feature. Are there any other places where I should document this feature?

Let me know if you need any further adjustments / tests. Thanks.

tests/execute/result/subresults/test.fmf Outdated Show resolved Hide resolved
@seberm seberm force-pushed the feature/save-subresults branch 2 times, most recently from 918ef90 to 70d2fcf Compare September 16, 2024 09:36
@seberm
Copy link
Collaborator Author

seberm commented Sep 17, 2024

/packit build

@seberm seberm force-pushed the feature/save-subresults branch 3 times, most recently from 794f4fb to 701b4de Compare September 17, 2024 13:51
@psss psss removed the enhancement label Sep 17, 2024
@seberm seberm force-pushed the feature/save-subresults branch 2 times, most recently from 387636a to 821c8e1 Compare September 17, 2024 14:48
@seberm seberm marked this pull request as ready for review September 17, 2024 15:01
@seberm seberm marked this pull request as draft September 23, 2024 07:42
All the results generated by tmt-report-results become objects of
`tmt.result.SubResult`.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants