[pytest-dev] py.test implementation on timeline

Ayelet Regev ayelet at fabrixsystems.com
Mon Sep 8 21:04:53 CEST 2014


Hi,

regarding issue #1:

correct me if i'm wrong, item._request object is individual per each 
test executuion.
if this is the case i can create item._request,cfg to include my cfg 
params per each item, and to read them from the actual test function.

_*
*__*on conftest.py:*_


# Test starts hook
def pytest_runtest_call(item):
*item._request.cfg = item.cfg*
     while True:
         r = wait_for_depend_item(item)
         if r:
             break
     item.start_time = datetime.datetime.now()
     item.config.logger.info2("\n\nRun-test: %s - %s" % (item.name, 
item.cfg))



*_on t__est_cm file:_

* def test_cm_delete(request):

     cfg = request.cfg
     ....


Any comments will be welcomed.



On 08/09/14 17:29, Ayelet Regev wrote:
> Hi,
>
> We are developing tests timeline based on py.test.
> In our setup:
> each test can run multiple times with different configured 
> configuration parameters.
> some tests thats need to be executed in parallel.
> we are using xdist and starting the run-call hook each time our 
> pre-required milestones are met.
>
> our configured timeline data:
>
> [
>     {
>         "test_func_name": "test_cm_delete",
>         "timeline_name": "test_cm_delete_working20",
>         "cfg": [
>             {
>                 "comment": "ChannelMapname",
>                 "type": "string",
>                 "name": "channel_name",
>                 "value": "working_20"
>             }
>         ],
>         "dependency": [
>             {
>                 "id": null,
>                 "start_after": null,
>                 "sync_type": "event",
>                 "sync_interval": 30,
>                 "sync_interval_scale": "Sec"
>             }
>         ]
>     },
>     {
>         "test_func_name": "test_cm_delete",
>         "timeline_name": "test_cm_delete_working21",
>         "cfg": [
>             {
>                 "comment": "ChannelMapname",
>                 "type": "string",
>                 "name": "channel_name",
>                 "value": "working_21"
>             }
>         ],
>         "dependency": [
>             {
>                 "id": "test_cm_delete_working20",
>                 "start_after": null,
>                 "sync_type": "event",
>                 "sync_interval": 30,
>                 "sync_interval_scale": "Sec"
>             }
>         ]
>     }
> ]
>
>
> *our problems are:*
> 1) all nodes are started at once.
> for each node we need to send some other "cfg" data params to execute 
> the test.
> we would be happy to use request object as parameter for the tests, 
> but we cannot find any relation between the request and the executed test.
>
> 2) The other problems we are having related to the fact that each 
> xdist slave run in diffrent memory address so we cannot change config 
> object on one place to be read by all slaves during execution.
> Any suggestions are welcome.
>
>
>
>
> Can you assist us?

-- 
Best Regards,

Ayelet Regev Dabah
Email: ayelet at fabrixsystems.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pytest-dev/attachments/20140908/126313ca/attachment.html>


More information about the Pytest-dev mailing list