testit-tms / adapters-python

Apache License 2.0
11 stars 11 forks source link

Многопоточное выполнение с использованием step #97

Open tester-sn opened 1 year ago

tester-sn commented 1 year ago

Многопоточное выполнение не поддерживается? Возможно добавить поддержку? Например если такой код:

def func1():
    with step('mystep1'):
        with step('mystep1.1'):
            with step('mystep1.1.1'):
                ...

def func2():
    with step('mystep2'):
        with step('mystep2.1'):
            ...

def func3():
    with step('mystep3'):
        with step('mystep3.1'):
            ...

with ThreadPoolExecutor() as executor:
    for future in as_completed([
        executor.submit(func1),
        executor.submit(func2),
        executor.submit(func3)
    ]):
        ...

То в результате в описании тестрана на testit.software получаем что-то такое:

ДЕТАЛИ:
    ШАГИ:
        mystep1
            mystep1.1
                mystep2
                    mystep2.1
                    mystep3
                        mystep3.1
                        mystep1.1.1
TatianaKlimova91 commented 11 months ago

ваш код не покрыт нашими аннотациями, по крайней мере в примере, если запускать так, то все шаги передатся корректно (версия адаптера последняя)

def func():
    with testit.step('mystep1'):
        with testit.step('mystep1.1'):
            with testit.step('mystep1.1.1'):
                ...

def func1():
    with testit.step('mystep2'):
        with testit.step('mystep2.1'):
            ...

def func2():
    with testit.step('mystep3'):
        with testit.step('mystep3.1'):
            ...

@testit.externalId("Test1")
@testit.displayName("Name")
def test_1():
    with ThreadPoolExecutor() as executor:
        for _ in as_completed([
            executor.submit(func),
            executor.submit(func1),
            executor.submit(func2)]):
                ...

результат:

image