-
Notifications
You must be signed in to change notification settings - Fork 144
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
report: support multiple results reported in one test #2236
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see there's only one use of
classname
, it's set totest.name
, is it the correct move? I'm not very fluent in junit, can you help me understand what's the purpose ofclassname
field? I'm slightly worried it's a junit feature leaking into a genericResult
class, and maybe we could find a better name for the attribute, because, well,Result.classname
is surprisingly not holding a class name :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing!
While junit format origins from Java, classname is refer to a test class which could contain a few steps.
If there is only one step, set "classname" to None and use "name" to identify the result is enough.
If there are multiple sub-results within one test, like steps in a Java class, we need to use "classname" to id the testcase, and use "name" to id the steps.
I see your points of class name :) Python class :)
OK, I'll try to find a better way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thank you. It seems to me tmt has no use for
classname
as you described it, now, tmt'sinternal
execute plugin does not recognize classes likepytest
or Java frameworks - I guess if we ever get apytest
framework support, this feature would be needed there as well.Having support for subresults makes sense to me, that's sure. First, I'd definitely keep
name
around, your patch is dropping it, replacing it withclassname
-name
represents a test name as known to tmt, the one defined in fmf data, that's a crucial piece of information and I don't see it going away. New fields are fine, droppingname
not so much :)Second, right now, there's just one tmt test, and with custom results, https://tmt.readthedocs.io/en/stable/spec/tests.html#result, a test can generate "virtual" results nested under the test name, e.g. test
/tests/foo
can produce results withname
set to/tests/foo/bar
and/tests/foo/baz
. That's similar to your subresults, but without any formal field for the structure.subresult
field looks like a very good addition then, we can use it already for these "virtual" custom results -name
would be set as it is now, plus we would setsubresult
to whatever the custom result brings in. This would be worth its own PR, BTW, it'd be a useful feature on its own.But, I'm not sure the
subresult
concept in this sense fits the test/class/method relationship. I suppose that under a single tmt test, several Python/Java classes can be executed, each with multiple test methods, giving us plenty of (class, method) tuples. I would maybe try to addclassname
andmethodname
fields right away, but I'm not so sure we should fill them with values that are not classname or methodname, e.g.test.name
. I'm not very fond of encoding multiple pieces of info and a single field, if we wish to store classname and methodname, if recognized by the test, then let's have two explicit fields for it :) It would be excellent if we could set these two fields viatmt-report-result
explicitly, not masking them as a subresult or test name. In other words, adding fields rather than changing the semantics of existing ones. What do you think?