-
Notifications
You must be signed in to change notification settings - Fork 18
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
failure when using Id token #68
Comments
FYI, I coupled that fix above with another slight modification here: Not sure if this is something we want long term since you're working on other solutions. But, FYI, I was able to get it to import cases using the Id token as the test title that way. |
hmmmm we treat class IpaBetelgeuseExampleClass(object):
def test_betelgeuse_example_0001(self):
"""IDM-IPA-TC: IPA Betelgeuse Example 0001
@Id: IDM-IPA-TC: IPA Betelgeuse Example 0001
@Description: New test 0001
"""
pass |
I need to set the polarion test case "title" which I think is actually accessed via pylarion as the test case "name" right? And, yeah, when I add Id token entry to first line, the @id: is included in the title as well. Is the testimony title imported to polarion in any way for test cases? FYI, this case was really just meant to show that error and adding quotes around the test_case_id. Not sure if you guys wanted me to post a pull request for that or wait to see if other changes in the pipe would resolve that. |
@spoore1 send in a PR and let's have a discussion about it. It is true that the polarion title is derived from the test case name (which would be the name of your python test method). You want to specify a different name instead, right? Like |
I think if |
Yes, I want to specify the polarion test case name somewhere per case. At the moment, my "patch" just allows me to use Id token but, I am by no means opposed to using Title. That makes more sense I think but, that doesn't work now does it? I just saw the comment about @id and thought I'd try that. |
@omaciel I created a PR with both the test_case_id quoting and new changes to allow using Title token for test.name per suggestion from @elyezer . I did have a slight deviation where I let it use Title first, Id if no Title, and then function if neither. I guess at this point, this thread can be closed and discussion can move to that PR? |
@spoore1 let's close this when the PR is merged. I will take some time and review it. |
I was not able to reproduce the exception, I am using latest Betelgeuse, Testimony and Pylarion. I've tried the following: def test_something(self):
"""@ID: id with spaces
@description: Description of the test
""" def test_something(self):
"""@ID: IDM-IPA-TC: IPA Betelgeuse Example 0001
@description: Description of the test
"""
All the above attempts worked well. Looking at the bottom of the stack trace we can see that there is an assertion error and the only place we use assert o Betelgeuse test is https://github.com/SatelliteQE/betelgeuse/blob/master/betelgeuse.py#L467-L469. That means that Polarion query is returning more than one test case, probably because the spaces which explains the need of the quotes since Polarion will try to match on every word. I went ahead on my investigation and tried the following: def test_something(self):
"""IDM-IPA-TC: IPA Betelgeuse Example 0001
@ID: IDM-IPA-TC: IPA Betelgeuse Example 0001
@description: Description of the test
"""
def test_something_1(self):
"""IDM-IPA-TC: IPA Betelgeuse Example 0002
@ID: IDM-IPA-TC: IPA Betelgeuse Example 0002
""" Trying to make Polarion return more than one result and I was not able to raise any exception. My conclusion is that on the Project you are trying there is another test case which is being returned by the query for that specific ID, I recommend you trying to search on the UI for that ID and see what are the test cases returned so you can delete and adjust. Using an unique ID is not a Betelgeuse's responsibility and the recommended way is to use I will go ahead and close this issue since it is not a Betelguese bug. I have created #73 which will make Betelgeuse output useful information when more than one test case are returned. |
While looking at #65 I looked at the betelgeuse code and I noticed in add_test_case:
So, I thought I'd try to use that to set the test case "title" in polarion:
But, I see this error:
That error, I think is related to the test_case_id including spaces. I added a simple patch to my local copy to add quotes:
That seemed to resolve the issue I was seeing.
But, it appears as if the test case was still created with the method name instead of the 'Id' token value.
The text was updated successfully, but these errors were encountered: