Giter Site home page Giter Site logo

failure when using Id token about betelgeuse HOT 9 CLOSED

spoore1 avatar spoore1 commented on September 26, 2024
failure when using Id token

from betelgeuse.

Comments (9)

spoore1 avatar spoore1 commented on September 26, 2024

FYI, I coupled that fix above with another slight modification here:

spoore1@6f37fd1

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.

omaciel avatar omaciel commented on September 26, 2024

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.

spoore1 avatar spoore1 commented on September 26, 2024

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.

omaciel avatar omaciel commented on September 26, 2024

@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.

elyezer avatar elyezer commented on September 26, 2024

I think if @title is present use that otherwise use the test method name would be a good resolution.

from betelgeuse.

spoore1 avatar spoore1 commented on September 26, 2024

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.

spoore1 avatar spoore1 commented on September 26, 2024

@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.

elyezer avatar elyezer commented on September 26, 2024

@spoore1 let's close this when the PR is merged. I will take some time and review it.

from betelgeuse.

elyezer avatar elyezer commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.