Comments (9)
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.
from betelgeuse.
hmmmm we treat title
and id
as 2 different, distinct parameters, where the id
is a unique field to help us locate a test case. The title
however would be the first line found in the docstring:
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
from betelgeuse.
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.
from betelgeuse.
@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 @Title: Foo bar
.
from betelgeuse.
I think if @title
is present use that otherwise use the test method name would be a good resolution.
from betelgeuse.
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.
from betelgeuse.
@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?
from betelgeuse.
@spoore1 let's close this when the PR is merged. I will take some time and review it.
from betelgeuse.
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
"""
def test_something(self):
"""IDM-IPA-TC: IPA Betelgeuse Example 0001
@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 uuid.uuid4()
in order to generate the IDs, that will ensure the uniqueness and is more fail proof than other approaches.
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.
from betelgeuse.
Related Issues (20)
- upstream token is not valid across different project, make it editable only when present HOT 1
- Provide RST parsing errors and warnings
- We should be able to pass some tokens (Requirement,CaseLevel, CaseImportance, TestType, etc.) through command line HOT 2
- Please add Requirement and Automation Script fields to be used by Betelgeuse Configuration Module HOT 1
- Make use of <testcase status-id="approved"> to update Test Case status HOT 1
- Provide help message for the --config-module option
- Document a list of custom fields and its values - IDs in Polarion HOT 2
- allow '.' as test path
- Allow sending files to Polarion HOT 4
- Request to parse multiple lines for fields like "title" in docstrings HOT 2
- Make Betelgeuse Python 3.6+ only HOT 7
- Update the betelgeuse requirement command to generate the XML for the Requirement Importer
- Pytest style parametrization HOT 6
- test case id not derived by test-run
- [test-case] Higher-level metadata might be used when keys use inconsistent casing
- pylarion now supporting python 3 HOT 2
- Traceback when running betelgeuse for insights tests HOT 2
- "betelgeuse test-run --status inprogress" isnt updating the test-run correctly HOT 3
- AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren' with Python 3.9 HOT 2
- Move to Github Actions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from betelgeuse.