ginkgo
ginkgo copied to clipboard
Support for KeyValue atttributes in specs
Gingko nodes currently support label nodes but these label nodes only accept string values. A great addition would be support for key-value attribute nodes. This could open up more options for reporters
E.g,
The JUnit reporters could be able to use this to add attributes like owner
to the testcase
xml node.
Are there other usecases? or is this a request for adding an Owner
decorator for junit? my hesitation is it would then be natural to want to filter specs by key:value pairs. or by specs with key Y with value X but not key Z. all to say that it would naturally expand the scope of the filtering language which i’d prefer not to do….
Yes the main use case is for the Owner attribute. We have a large codebase owned my multiple different teams. It would be great if the owner attribute is present on specs so it's easy to identify who owns a spec. The owner
attribute is natively supported in Azure devops pipelines as seen here
great, thanks @nonsocode . I could imagine that after adding an Owner
decorator there will quickly be requests for implementing filtering specs by Owner
. One idea that comes to mind is to teach the JUnit reporter to look for special labels and interpret them. So, for example, the first label matching Label(“owner:.*”)
could be detected by the reporter and interpreted as the owner for the spec. I think i’d be up for that and documenting it as a feature of the junit reporter. This way the existing filtering mechanisms would still apply. WDYT?
Yes I think that's a great alternative. I'm happy with this idea
alright - this is now on master. i'll be cutting a release soon. you can now set Label(owner:X)
and X
will get set to the Owner
attribute of the test case. if you could give it a try and make sure it works for you end-to-end on azure devops that would be great.
This works great. Thank you