Giter Site home page Giter Site logo

satelliteqe / betelgeuse Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 18.0 292 KB

Betelgeuse reads standard Python test cases and offers tools to interact with Polarion.

License: GNU General Public License v3.0

Python 97.11% Makefile 0.76% Shell 2.13%
hacktoberfest polarion python python3 python36 python37 python38

betelgeuse's People

Contributors

akasurde avatar elyezer avatar jacobcallahan avatar jyejare avatar lpramuk avatar mirekdlugosz avatar ntkathole avatar omaciel avatar spoore1 avatar sthirugn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

betelgeuse's Issues

Description contains all tags

Currently betelgeuse adds docstring into description of testcase. Instead, it should only add testcase description in Polarion.

screenshot from 2016-06-06 16-32-57

Automatic Test Specification Creation by betelgeuse

Currently RHDS team is creating Test Specification in Polarion manually.

In our case, we create a test plan for each RFE/feature, and we add all the test case for that feature as work items to the test plan document.
Can we please modify betelgeuse to create such test plans automatically from command line, so that it can create all the headers as Scope, Purpose, Setup etc in a Polarion document(test plan)?

Make Betelgeuse more configurable

Currently Betelgeuse parses the test docstrings and assign fields in a way that does not apply to every scenario. This means that some of the default values may not be available on all Polarion projects, Polarion custom fields can be created per project basis and Betelgeuse will not be able to fill all of them, the user may want to apply its own rules to generate Requirements, field values, test case names so on and so forth.

The better way to solve this is allowing the user to specify a Python module as a customization module. On that module functions like get_test_case_name may be present and if they are they should be called in order to get the value. Continuing with the get_test_case_name example, that function can receive a testcase object along with the raw docstring, this way the user can create its own logic in order to create the test case name, for example the test case name can contain the value from some other field like the OS.

If no customization module is provided Betelgeuse will use its own rules and default values. The same will happen if the customization module is provided but the use didn't provide some specific function, then the default Betelgeuse behavior will be used. On the other hand, depending on the filed, Betelgeuse can expect so user configuration to be present, but currently I don't see any case of this.

Need an option to specify the token mark for example use :...: instead of @...:

It will be great if I can use :...: instead of @....: in my source code file for betelgeuse.

For example the following docstring:

"""My test

@requirement: My Requirement
@steps: Do this
@expectedresults: Expected result
"""

Would be like this:

"""My test

:requirement: My Requirement
:steps: Do this
:expectedresults: Expected result
"""

PicklingError while creating a new requirement

Saw the following error happen 4 times in a row while attempting to create a new HotBackup Requirement:

Creating test case test_positive_directory_exists for requirement: HotBackup.
No handlers could be found for logger "suds.client"
Traceback (most recent call last):
  File "/home/jenkins/shiningpanda/jobs/5ba1b881/virtualenvs/d8de43bd/bin/betelgeuse", line 11, in <module>
    sys.exit(cli())
  File "/home/jenkins/shiningpanda/jobs/5ba1b881/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/jenkins/shiningpanda/jobs/5ba1b881/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/jenkins/shiningpanda/jobs/5ba1b881/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/jenkins/shiningpanda/jobs/5ba1b881/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jenkins/shiningpanda/jobs/5ba1b881/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/jenkins/shiningpanda/jobs/5ba1b881/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/jenkins/shiningpanda/jobs/5ba1b881/virtualenvs/d8de43bd/lib/python2.7/site-packages/betelgeuse.py", line 637, in test_case
    pool.map(add_test_case, testcases.items())
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 567, in get
    raise self._value
multiprocessing.pool.MaybeEncodingError: Error sending result: 'WebFault(u"Server raised fault: 'Not authorized.'",)'. Reason: 'PicklingError("Can't pickle suds.sudsobject.Fault: attribute lookup suds.sudsobject.Fault failed",)'

Using the @title token for polarion test case title

Can we have the option (via command line arg) to use the test case Test token for the polarion test case title on import?

I would like to use this instead of using the python module, class, method/function names.

Allow Test Run types to be passed when creating a new Test Run

As per existing information in Polarion, a Test Run can have a type of one of the following:

  • buildacceptance
  • regression
  • featureverification

I'd like for the test-run method to accept a type parameter with a default of buildacceptance if none are passed.

Make sure that Test Cases set some specific fields

Whether creating for the first time or updating existing Test Cases, the following fields should be set:

  • Title - Short description of the test case
  • Status - (defaults to DRAFT but other acceptable values are PROPOSED, NEEDS UPDATE, APPROVED and INACTIVE)
  • Test Type - (defaults to FUNCTIONAL but other acceptable values are NON-FUNCTIONAL and STRUCTURAL)
  • Subtype 1 - More specific selection for certain types. (defaults to -)
  • Pos/Neg - Set this to indicate if the test is a positive or negative style test . (defaults to POSITIVE but other acceptable values are NEGATIVE)
  • Importance- This field should have been imported from TCMS. (defaults to MEDIUM but other acceptable values are LOW,HIGHandCRITICAL`)
  • Level - Set the level of the test based on the definitions here.Test Types, Levels, and Importance (defaults to COMPONENT but other acceptable values are INTEGRATION, SYSTEMand ACCEPTANCE)
  • Automation- Acceptable values are AUTOMATED, MANUAL ONLY, NOT AUTOMATED

As you can see, Betelgeuse already sets these fields but some of the defaults values used need to be flexible to allow for more flexibility.

For the time being, specially for the Satellite 6 QE team, the following rules should be used:

  • Status: DRAFT as we want to be able to automatically update them whenever the docstring changes. If we were to set the Status to any other value, updating a Test Case would require several steps to change the Status back to DRAFT.
  • Pos/Neg: Since all of our tests use a nomenclature similar to test_positive/negative_*, we should use this information when importing/updating Test Cases
  • Automation: We currently rely on Testimony flag found in the docstring to determine whether something is automated or not.

No changes required for the other fields for now.

xml-test-run --status=inprogress option is not working

Betelgeuse help statues that --status option can accepts finished and inprogress as possible values but when setting inprogress the generated XML does not have the expected property: <property name="polarion-set-testrun-finished" value="false" />.

xml-test-run command fails when the option --response-property isn't provided

Here is the stack trace:

Traceback (most recent call last):
  File "/home/elyezer/.virtualenvs/betelgeuse/bin/betelgeuse", line 9, in <module>
    load_entry_point('Betelgeuse', 'console_scripts', 'betelgeuse')()
  File "/home/elyezer/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/elyezer/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/elyezer/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 1058, in invoke
    sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
  File "/home/elyezer/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 620, in make_context
    self.parse_args(ctx, args)
  File "/home/elyezer/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 874, in parse_args
    value, args = param.handle_parse_result(ctx, opts, args)
  File "/home/elyezer/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 1398, in handle_parse_result
    self.callback, ctx, self, value)
  File "/home/elyezer/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 77, in invoke_param_callback
    return callback(ctx, param, value)
  File "/home/elyezer/code/betelgeuse/betelgeuse.py", line 91, in validate_key_value_option
    key, value = value.split('=', 1)
AttributeError: 'NoneType' object has no attribute 'split'

The validator callback needs to deal when None value is passed, for more information check [1]

[1] http://click.pocoo.org/6/options/#callbacks-and-eager-options

test case steps and expectedresults missing

I'm able to create new test cases and link to an existing requirement but, I'm no longer seeing the steps and expected results.

I'm using similar to this:

class TestClass(object):
    def test_case_0001(self):
        """
        @Title:  Some new test case title
        @Description:   
        @Requirement: Some Existing Requirement    
        @caselevel: Acceptance
        @casecomponent: ipa
        @setup:
        1. Setup1
        2. Setup2
        3. Setup3

        @steps:
        1. Step1

        @expectedresults:
        1. Result1
        """

betelgeuse --token-prefix "@" test-case --path /root/test_suite_dir/test_cases.py RedHatEnterpriseLinux7

Test Cases must provide new automation_script field

Test Cases in Polarion now require the following field to be set: automation_script

This field will store a URL pointing to the location of the specific test case in the source code. Though one can provide a generic URL such as https://github.com/SatelliteQE/robottelo, we should be able to provide something more accurate such as https://github.com/SatelliteQE/robottelo/blob/master/tests/foreman/cli/test_contentview.py#L160.

Add test case `UUID` to generated xunit files

Reference

Please read our MOJO DOC-1073077.

Request

Given a xunit file, create a new method to parse through the source code for automated tests, and update the XML file to include the test case UUID for each test found. For example, given the following (snippet) xunit file:

<?xml version="1.0" encoding="utf-8"?><testsuite errors="3" failures="2" name="pytest" skips="0" tests="3" time="4157.148">
<testcase classname="tests.foreman.api.test_syncplan.SyncPlanSynchronizeTestCase" file="tests/foreman/api/test_syncplan.py" line="609" name="test_positive_synchronize_custom_product_future_sync_date" time="981.63787818">

The new method should look at the source code for the test named test_positive_synchronize_custom_product_future_sync_date in the file tests/foreman/api/test_syncplan.py and extract the uuid from it.

Once this information is made available, we would then generate a brand new xml file containing the uuid as part of a new <properties><property> block:

<?xml version="1.0" encoding="utf-8"?>
<testsuites>
    <properties>
        <property name="polarion-testrun-title" value="TITLE_GOES_HERE" />  
        <property name="polarion-project-id" value="PROJECT_ID_GOES_HERE"/>  
        <property name="polarion-user-id" value="USER_ID_GOES_HERE"/>  
        <property name="polarion-lookup-method" value="custom"/>  
    </properties>  
    <testsuite errors="3" failures="2" name="pytest" skips="0" tests="3" time="4157.148">
        <testcase classname="tests.foreman.api.test_syncplan.SyncPlanSynchronizeTestCase" file="tests/foreman/api/test_syncplan.py" line="609" name="test_positive_synchronize_custom_product_future_sync_date" time="981.63787818">
        <properties> 
            <property name="polarion-testcase-id" value="0495cb39-2f15-4b6e-9828-1e9517c5c826"/> 
        </properties> 
    </testcase>
</testsuites>

Specification

As you an see, this new method should accept the following arguments:

  • xunit_file - this should be the path to the original xunit file as generated by your automation process
  • polarion_user_id - your Polarion username
  • polarion_project_id - your projects's ID (e.g. RHSAT6)
  • polarion_testrun_name - The title for your TestRun (e.g. "Satellite 6.2.0 SNAP 1.0 - RHEL 7")

Fetch the `caseautomation` field for a Test Case

Now that Pylarion allows us to query for the caseautomation custom field, we should make sure that we explicitly query for it here

            results = TestCase.query(
                test_case_id, fields=['caseautomation', 'description', 'work_item_id'])

Now, when considering whether to update a Test Case or not, we no longer should have to fetch it first just to get access to its caseautomation field, as shown here, and avoid making another call to Polarion.

Add a README file

Add a README file containing some basic information about the project and pointing to official documentation via ReadTheDocs link.

Add Documentation

Add some basic documentation about the project and its supported commands. Docs should be hosted on ReadTheDocs and linked from the project's README file.

Mark --path and --path-to-source as required fields when using test-run

Seems that one needs to pass both --path and --path-to-source when using test-run or Betelgeuse will attempt to open files that were not provided:

betelgeuse test-run --test-run-id omaciel-delete-1 --test-run-type regression --test-template-id Empty --path /Users/omaciel/Dropbox/xml/tier1-parallel-results.xml --user omaciel --custom-fields arch=x8664 CLOUDTP
Traceback (most recent call last):
  File "/Users/omaciel/.virtualenvs/betelgeuse/bin/betelgeuse", line 9, in <module>
    load_entry_point('Betelgeuse', 'console_scripts', 'betelgeuse')()
  File "/Users/omaciel/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/Users/omaciel/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Users/omaciel/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/omaciel/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/omaciel/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/Users/omaciel/.virtualenvs/betelgeuse/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/omaciel/hacking/betelgeuse/betelgeuse.py", line 743, in test_run
    *testimony.get_testcases([source_code_path]).values()
  File "/Users/omaciel/.virtualenvs/betelgeuse/lib/python2.7/site-packages/testimony/__init__.py", line 347, in get_testcases
    if os.path.isfile(path):
  File "/Users/omaciel/.virtualenvs/betelgeuse/lib/python2.7/genericpath.py", line 37, in isfile
    st = os.stat(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found

Since source_code_path is required for a Test Run, we should possibly:

  • Make sure that the parameter is a requirement
  • Consider any other additional checks that we may want to perform to make sure that the provided value matches the expected format (or provide a friendlier message to the end user)

Allow users to edit token's value

Is it possible to add an option to prefix a test case title with the value passed on the command line?

So, I could have a test_0001.py:

def test_feature_0001():
    """ :title: Running Feature with command option 1 """
    pass

Then to import I could run this:

betelgeuse test-case --title-prefix "TEAM-TC: Feature Name: " --path test_0001.py PROJECT

And in Polarion PROJECT, the test case Title would be:

TEAM-TC: Feature Name: Running Feature with command option 1

Would that (or something similar) be possible?

support reading docstrings from conftest.py

Is it possible to have betelgeuse also read a tests conftest.py file if it exists and the path is a directory that contains a conftest py file?

`[root@ipa1 betelgeuse_testcase_importer]# cat test2/conftest.py
""" 
:requirement: IPA Feature 0001
:caselevel: Acceptance
:casecomponent: ipa
:caseautomation: Automated
:caseimportance: Medium
:testtype: Functional
:description: some default description
"""

import pytest

[root@ipa1 betelgeuse_testcase_importer]# cat test2/test_0001.py 
class TestFeature(object):
    def test_feature_command_with_option_a(self):
        """
        :title: IPA - Feature command run with option A
        :id: ipa_test_feature_command_with_option_a

        :setup: Prepare environment with servers and users
        :steps:
        1. step 1
        2. step 2
        :expectedresults:
        1. pass
        2. pass
        """
        option = "A"
        assert option == "A"

    def test_feature_command_with_option_b(self):
        """
        :title: IPA - Feature command run with option B
        :id: ipa_test_feature_command_with_option_b

        :setup: Prepare environment with servers and users
        :steps:
        1. step 1
        2. step 2
        :expectedresults:
        1. pass
        2. pass
        """
        option = "B"
        assert option == "B"

[root@ipa1 betelgeuse_testcase_importer]# betelgeuse test-case --path ./test2/ PROJECT

Thanks,
Scott

Update documentation

Betelgeuse have received a lot of improvements and the documentation is missing them. Documentation should be update in order to match the current Betelgeuse state.

Should be covered some topics like how to define test docstring, the tokens betelgeuse expects to be defined and the changes on the test-run command in order to map the test IDs with the jUnit results.

upstream token is not valid across different project, make it editable only when present

Check is upstream token is present and only if when present edit it. Not all projects have the upstream field.

# betelgeuse test-case --path /export/test RHDS --collect-only
Creating test case test_slapd_InstScriptsEnabled for requirement: Setup Ds.
Linking test case test_slapd_InstScriptsEnabled to requirement: Setup Ds.
# betelgeuse test-case --path /export/test RHDS
Password not in config file.
Enter Password:
Creating test case test_slapd_InstScriptsEnabled for requirement: Setup Ds.
Traceback (most recent call last):
  File "/usr/bin/betelgeuse", line 9, in <module>
    load_entry_point('Betelgeuse==0.7.1', 'console_scripts', 'betelgeuse')()
  File "/usr/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/export/betelgeuse/betelgeuse.py", line 649, in test_case
    pool.map(add_test_case, testcases.items())
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 250, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 554, in get
    raise self._value
pylarion.exceptions.PylarionLibException: These parameters are unknown: upstream

Support for additional parameters

This is tracking bug for adding additional parameters required for Polarion.

Currently,

  1. casecomponent
  2. caseimportance

is not supported.

failure when using Id token

While looking at #65 I looked at the betelgeuse code and I noticed in add_test_case:

371         # Fetch the test case id if the @Id tag is present otherwise generate a
372         # test_case_id based on the test Python import path

So, I thought I'd try to use that to set the test case "title" in polarion:

# cat test_spoore_betelgeuse_01.py 
class IpaBetelgeuseExampleClass(object):
    def test_betelgeuse_example_0001(self):
        """ @Id: IDM-IPA-TC: IPA Betelgeuse Example 0001
            @Description: New test 0001
        """
        pass

But, I see this error:

# betelgeuse test-case --path test_spoore_betelgeuse_01.py RedHatEnterpriseLinux7
Updating test case test_betelgeuse_example_0001 for requirement Spoore Betelgeuse 01.
Traceback (most recent call last):
  File "/usr/bin/betelgeuse", line 9, in <module>
    load_entry_point('Betelgeuse==0.4.0', 'console_scripts', 'betelgeuse')()
  File "/usr/lib/python2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.7/site-packages/click-6.6-py2.7.egg/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/click-6.6-py2.7.egg/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "build/bdist.linux-x86_64/egg/betelgeuse.py", line 625, in test_case
    pool.join()
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 250, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 554, in get
    raise self._value
AssertionError

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:

diff --git a/betelgeuse.py b/betelgeuse.py
index 3c2a035..c0f4d86 100644
--- a/betelgeuse.py
+++ b/betelgeuse.py
@@ -414,6 +414,7 @@ def add_test_case(args):

         results = []
         if not collect_only:
+            test_case_id = '"{}"'.format(test_case_id)
             results = TestCase.query(
                 test_case_id,
                 fields=[

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.

Test Cases must provide the approvee field

Polarion now requires that Test Cases should provide the approvee field. I think that we can use the user running the script to populate this field at runtime.

IMPORTANT: the user running the script must have the project_approver role in order to be able to approve a Test Case.

Here's an example:

testcase = TestCase(project_id='RHSAT6', work_item_id='RHSAT6-2726')
testcase.add_approvee('omaciel')
testcase.update()
testcase.edit_approval('omaciel', 'approved')

Skip test case creation for tests with invalid fields values

Test case command should not stop when a invalid value is provided and a PylarionLibException is raised.

Traceback (most recent call last):
  File "/home/jenkins/shiningpanda/jobs/e79539a1/virtualenvs/d8de43bd/bin/betelgeuse", line 11, in <module>
    sys.exit(cli())
  File "/home/jenkins/shiningpanda/jobs/e79539a1/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/jenkins/shiningpanda/jobs/e79539a1/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/jenkins/shiningpanda/jobs/e79539a1/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/jenkins/shiningpanda/jobs/e79539a1/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jenkins/shiningpanda/jobs/e79539a1/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/jenkins/shiningpanda/jobs/e79539a1/virtualenvs/d8de43bd/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/jenkins/shiningpanda/jobs/e79539a1/virtualenvs/d8de43bd/lib/python2.7/site-packages/betelgeuse.py", line 489, in test_case
    pool.map(add_test_case, testcases.items())
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 567, in get
    raise self._value
pylarion.exceptions.PylarionLibException: Acceptable values for testtype are:[functional, nonfunctional, structural]

add support for testrun-type-id

Can we get support added for the polarion-testrun-type-id property?

Elyezer discovered that was missing while helping me troubleshoot an issue with xml-test-run.

Thanks,
Scott

Drop token-prefix option

SatelliteQE/testimony#123 drops the token-prefix in favor of field-list RST syntax. Betelgeuse should reflect that change by dropping its token-prefix option too.

Whis issue should be worked and the testimony version must be pinned to at least the version where the token prefix is going to be dropped.

Provide more information when more than one test case is found

When querying for a Test Case Betelgeuse use assert which will stop the test case update and will raise an exception. It will be better to have more information when that happens so the user can clearly know what have happened.

Betelgeuse should inform the user that the ID is returning more than one test case and it can't proceed.

Provide RST parsing errors and warnings

Betelgeuse should only manage test cases that does not raises any RST parsing warnings and errors when parsing their docstring. Test cases with parsing warning or errors should be skipped and the user properly notified

RFE :: Steps should go in Test Steps and Assert should go in expected result.

Betelgeuse is currently taking the docstring from test cases and putting that into the description field of Polarion. It will be nice if all the information in docstring can go to the specific field ::

For Example :

@feature: Replication

@setup: Four masters, replication is configured

@steps:

  1. Install four instances of Directory Server on same host i.e. M1, M2, M3, M4
  2. Configure two way replcation between all instances.
  3. Add a test user in M1.
  4. Verify all the masters M2, M3 and M4 have that test user added.

@Assert: All masters should be in sync.

@Status: Manual

Steps should go in Test Steps and Assert should go in expected result.

Add support for unicode characters in testcase

Seems that betelgeuse fails to parse testcase docstring which contains unicode character

1. ipa ca-find é
Traceback (most recent call last):
  File "/data/akasurde/src/betelgeuse/venv/bin/betelgeuse", line 9, in <module>
    load_entry_point('Betelgeuse==0.5.0', 'console_scripts', 'betelgeuse')()
  File "/data/akasurde/src/betelgeuse/venv/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/data/akasurde/src/betelgeuse/venv/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/data/akasurde/src/betelgeuse/venv/lib/python2.7/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/data/akasurde/src/betelgeuse/venv/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/data/akasurde/src/betelgeuse/venv/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/data/akasurde/src/betelgeuse/venv/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "build/bdist.linux-x86_64/egg/betelgeuse.py", line 637, in test_case
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib64/python2.7/multiprocessing/pool.py", line 567, in get
    raise self._value
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 12: ordinal not in range(128)

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.