-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 UniqueID to XML Output #5092
Conversation
Signed-off-by: Ish Shah <ishah@redhat.com>
@theishshah can you link the |
Here is the API PR, this one merged a while back. The type and name were chosen based on QE's requests for it in Xunit. |
Signed-off-by: Ish Shah <ishah@redhat.com>
@@ -142,8 +142,7 @@ func (c *scorecardCmd) convertXunit(output v1alpha3.TestList) xunit.TestSuites { | |||
} | |||
tSuite.TestCases = append(tSuite.TestCases, tCase) | |||
tSuite.URL = item.Spec.Image | |||
//TODO: Add TestStuite ID when API updates version | |||
//tSuite.ID = item.Spec.UniqueID | |||
tSuite.ID = item.Spec.UniqueID |
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.
What happens if item.Spec.UnqiueID
is unset? Does tSuite.ID
stay empty?
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.
Just ran it with UniqueID unset to confirm, tSuite.ID stays empty.
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.
Well this should probably have a default (random) value if not configured with one right?
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.
So the only users of this field are folks using this for xunit, and in those scenarios the ID's are being fed in the config anyways and there aren't really other use cases for this value (since the testcase names themselves are also unique).
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.
Will leaving the ID field of XUnit output empty cause errors when an XUnit parser attempts to parse this stuff? If so we should either set this to the testcase name, some random string, or (probably better) error out.
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.
That's a good question I will find out. If it would cause errors, I agree with the solution of erroring out if the field is left empty. I am not opposed to setting the field to the testcase name if we absolute must populate it, as opposed to the current omit if empty behavior.
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.
Having an empty UID field does not appear to cause issues in the polarion importer
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.
Is this an optional field that can be set or leave as unset?
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.
Also, would this need to conform to any naming conventions?
Will the XUnit parser work for all special characters?
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.
Have a couple of questions.
@@ -142,8 +142,7 @@ func (c *scorecardCmd) convertXunit(output v1alpha3.TestList) xunit.TestSuites { | |||
} | |||
tSuite.TestCases = append(tSuite.TestCases, tCase) | |||
tSuite.URL = item.Spec.Image | |||
//TODO: Add TestStuite ID when API updates version | |||
//tSuite.ID = item.Spec.UniqueID | |||
tSuite.ID = item.Spec.UniqueID |
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.
Is this an optional field that can be set or leave as unset?
@@ -142,8 +142,7 @@ func (c *scorecardCmd) convertXunit(output v1alpha3.TestList) xunit.TestSuites { | |||
} | |||
tSuite.TestCases = append(tSuite.TestCases, tCase) | |||
tSuite.URL = item.Spec.Image | |||
//TODO: Add TestStuite ID when API updates version | |||
//tSuite.ID = item.Spec.UniqueID | |||
tSuite.ID = item.Spec.UniqueID |
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.
Also, would this need to conform to any naming conventions?
Will the XUnit parser work for all special characters?
Re: Rashmi's comments:
|
Signed-off-by: Ish Shah <ishah@redhat.com>
Setting it to a default value if it is empty is a good idea. /lgtm |
Signed-off-by: Ish Shah <ishah@redhat.com>
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.
/lgtm
Signed-off-by: Ish Shah ishah@redhat.com
Include optional Unique ID in XML output, change was withheld earlier as an API update was necessary